Follow-up from "Validate that all foreign keys being indexed"
The following discussion from gitlab-ce!22694 should be addressed:
-
@smcgivern started a discussion: (+5 comments) I think reordering some indexes might help here, too. For instance, the
internal_ids
table has these indexes:usage, namespace_id
usage, project_id
And FKs on
namespace_id
andproject_id
. I don't think we ever query it just byusage
, so swapping the columns might help - although I'm not sure if it's worse from another perspective. (According to https://dba.stackexchange.com/questions/33196/multicolumn-index-and-performance, it shouldn't matter for performance? Not an expert!)