Skip to content

All tables should have max 16 indexes

I think we can make a rule that all table should have max 16 indexes. All of the tables in !159609 (comment 2006090899) are likely large, or giant - and will affect both LwLock and WAL. It is unlikely a tiny table will have more than 16 indexes.

  • Exceptions can be made so that new indexes can be added but the rollout needs to be monitored.

Here are the top 25 tables with the most indices:

table_name index count
projects 55
issues 36
merge_requests 32
users 31
ci_builds 26
packages_packages 25
namespaces 25
p_ci_builds 25
ci_pipelines 24
sbom_occurrences 23
vulnerability_reads 23
members 19
deployments 17
vulnerability_occurrences 17
epics 17
vulnerabilities 15
packages_package_files 15
ci_runners 15
ci_job_artifacts 14
snippets 14
approval_merge_request_rules 14
events 14
p_ci_job_artifacts 14
Edited by Thong Kuah