Remove unneeded health status index
We need to check to ensure index "idx_issues_on_health_status_not_null" btree (health_status) WHERE health_status IS NOT NULL is actually used and remove if not.
The migration style guide has a section on removing unneeded indeces, including a Thanos query for checking its use
See !95580 (comment 1072018431)
The following discussion from !95580 (merged) should be addressed:
-
@cablett started a discussion: (+6 comments) any_health_statusscopeHere's the SQL query when running the scope
any_health_status:SELECT "issues".* FROM "issues" WHERE "issues"."health_status" IS NOT NULLexplain
👉 https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/11600/commands/41220We have an index on health status:
CREATE INDEX idx_issues_on_health_status_not_null ON issues USING btree (health_status) WHERE (health_status IS NOT NULL);so that should be OK?
with_health_statusscopeAnd when running the scope
with_health_status:SELECT "issues".* FROM "issues" WHERE "issues"."health_status" = 3explain
👉 https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/11600/commands/41221