Remove unused 'jira' indexes on `merge_requests` table
Related to #402490 (closed) and #402497 (closed)
There are many indexes on the merge_requests
table that have no usage or very low usage. All indexes slow down write operations and consume disk space. This is particularly problematic at the moment as the primary database is consuming a lot of CPU. Every update to this table needs to update all references in all indexes so unused indexes are very wasteful for large tables.
Unused indexes
There are 2 indexes that are related to jira
. The other indexes on the merge request table are handled in #402497 (closed)
From the the index usage metrics the following indexes have not been used at all in the last 8 weeks:
- index_merge_requests_on_target_project_id_and_iid_jira_title
- index_merge_requests_on_target_project_id_iid_jira_description
What to do?
Take a look through the indexes and unless you can find a good reason to keep them then create an MR like !115926 (merged) to remove them. Some good reasons to keep them:
- They are used for upcoming features that are being implemented or disabled by a feature flag (you can determine this by seeing when they were added)
- They are known to be used for self-managed features. To determine this you might need deeper knowledge of the features and possibly looking up the MR that introduced this index. Absent all evidence that it is used for self-managed then we should probably delete them