Remove index_deployments_on_project_id_and_status
Problem
See Reduce main database load by optimizing `deploy... (&10169)
This has duplicate columns with index_deployments_on_project_id_and_status_and_created_at
Usage rates of the indexes according to Thanos:
index | usage |
---|---|
index_deployments_on_project_id_and_status |
1.915169062145729 |
index_deployments_on_project_id_and_status_and_created_at |
0.07127976223796163 |
@tigerwnz
explained in this comment why we can delete this index
an index on
(project_id, status, created_at)
can serve queries specifying justproject_id
andstatus
, so we don't need both indexes.Seeing usage for a redundant index is not uncommon - in this case for some queries that don't specify
created_at
it can even be the more efficient choice, because we read fractionally less data from disk (as each index entry is smaller). However, this benefit doesn't outweigh the performance and storage penalty of maintaining an extra index.
Proposal
Edited by Pam Artiaga