Remove import_and_integrate 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 groupimport and integrate:
bulk_import_batch_trackers
table - !137661 (merged)
- i_bulk_import_trackers_id_batch_number:
index_bulk_import_batch_trackers_on_tracker_id
bulk_import_export_batches
table - !137662 (merged)
- i_bulk_import_export_batches_id_batch_number:
index_bulk_import_export_batches_on_export_id
jira_connect_subscriptions
table - !137658 (merged)
- idx_jira_connect_subscriptions_on_installation_id_namespace_id:
idx_jira_connect_subscriptions_on_installation_id
project_relation_exports
table - !137665 (merged)
- index_project_export_job_relation:
index_project_relation_exports_on_project_export_job_id
web_hook_logs
table - !137650 (merged)
- index_web_hook_logs_on_web_hook_id_and_created_at:
index_web_hook_logs_part_on_web_hook_id
web_hooks
table - !137572 (merged)
- index_web_hooks_on_project_id_recent_failures:
index_web_hooks_on_project_id
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 Bojan Marjanovic