Remove tenant_scale duplicated indexes
After #385701 (closed), we can identify duplicated indexes. At the moment, there are many duplicate indexes that can be removed from our database, as they are not needed anymore.
The list of duplicated indexes can be found in the duplicate_indexes.yml
file.
We have identified the following duplicated indexes owned by grouptenant scale:
members table
- index_members_on_member_namespace_id_compound:
index_members_on_member_namespace_id
project_topics table
- index_project_topics_on_project_id_and_topic_id:
index_project_topics_on_project_id
projects table
- index_projects_api_path_id_desc:
index_on_projects_path
- index_projects_on_path_and_id:
index_on_projects_path
users table
- index_users_on_state_and_user_type:
index_users_on_state
NOTE: Consider removing indexes showed on the right. Indexes at the left are covering for the duplicated one.
Feel free to split this issue into several under &11436 (closed) if that aligns more with how your group works.
See the references below to remove indexes. If the table is larger or with a lot of traffic, please consider dropping the index asynchronously.
References:
- https://docs.gitlab.com/ee/development/database/adding_database_indexes.html#drop-indexes-asynchronously
- https://docs.gitlab.com/ee/development/migration_style_guide.html#removing-indexes
Related #423983 (closed)
Edited by Leonardo da Rosa