Remove package_registry 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 grouppackage registry:
packages_debian_group_distributions table
- uniq_pkgs_debian_group_distributions_group_id_and_codename:
index_packages_debian_group_distributions_on_group_id
- uniq_pkgs_debian_group_distributions_group_id_and_suite:
index_packages_debian_group_distributions_on_group_id
packages_debian_project_distributions table
- uniq_pkgs_debian_project_distributions_project_id_and_codename:
index_packages_debian_project_distributions_on_project_id
- uniq_pkgs_debian_project_distributions_project_id_and_suite:
index_packages_debian_project_distributions_on_project_id
packages_tags table
- index_packages_tags_on_package_id_and_updated_at:
index_packages_tags_on_package_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)
cc @trizzi, @crystalpoole