Include id in traversal_ids index
With the ID in the index we can avoid DB reads with namespace joins.
A traversal_ids
query filters the traversal_ids
column and uses the id
column to find the projects:
WHERE projects.namespace_id IN (SELECT id FROM namespaces WHERE traversal_ids ...)
The query will read the id
column from disk, which can be avoided if we have the traversal_ids, id
index present.
Edited by Alex Pooley