Add [id, namespace_id] index to projects
What does this MR do and why?
This is an experiment to see if this improves the performance of queries fetching the parent namespace ID of a list of projects
More details in #466236 (comment 1941023133)
- Without index: https://postgres.ai/console/gitlab/gitlab-production-main/sessions/29302/commands/91173
- With index: https://postgres.ai/console/gitlab/gitlab-production-main/sessions/29302/commands/91181
The shared buffers hit in the plans are not very accurate due to: https://pganalyze.com/blog/5mins-explain-analyze-buffers-nested-loops#how-nested-loops-count-shared-buffers-hit. So we decided to just experiment on adding the index and looking at query runtimes on GitLab.com.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #466236
Edited by Heinrich Lee Yu