Drop redundant indexes
@ayufan raised the question of index set optimization in https://gitlab.com/gitlab-org/gitlab-ce/issues/46499#note_92148273
There are some low-hanging fruits:
index_ci_builds_on_status -- 3295 MB, redundant to index: index_ci_builds_on_status_and_type_and_runner_id, table ci_builds
index_ci_pipelines_on_project_id -- 772 MB, redundant to index: index_ci_pipelines_on_project_id_and_sha, index_ci_pipelines_on_project_id_and_ref_and_status_and_id, table ci_pipelines
index_ci_stages_on_pipeline_id -- 1657 MB, redundant to index: index_ci_stages_on_pipeline_id_and_position, redundant to index: index_ci_stages_on_pipeline_id_and_name, table ci_stages
index_container_repositories_on_project_id -- 2840 kB, redundant to index: index_container_repositories_on_project_id_and_name, table container_repositories
index_geo_node_namespace_links_on_geo_node_id -- 8192 bytes, redundant to index: index_geo_node_namespace_links_on_geo_node_id_and_namespace_id, table geo_node_namespace_links
index_issue_links_on_source_id -- 3800 kB, redundant to index: index_issue_links_on_source_id_and_target_id, table issue_links
index_notification_settings_on_user_id -- 224 MB, redundant to index: index_notifications_on_user_id_and_source_id_and_source_type, table notification_settings
index_pages_domains_on_project_id -- 920 kB, redundant to index: index_pages_domains_on_project_id_and_enabled_until, table pages_domains
index_pages_domains_on_verified_at -- 1640 kB, redundant to index: index_pages_domains_on_verified_at_and_enabled_until, table pages_domains
index_project_mirror_data_on_next_execution_timestamp -- 132 MB, redundant to index: index_mirror_data_on_next_execution_and_retry_count, table project_mirror_data
index_push_rules_is_sample -- 16 kB, redundant to index: index_push_rules_on_is_sample, table push_rules
index_releases_on_project_id -- 7496 kB, redundant to index: index_releases_on_project_id_and_tag, table releases
index_taggings_on_tag_id -- 682 MB, redundant to index: taggings_idx, table taggings
index_taggings_on_taggable_id_and_taggable_type -- 1112 MB, redundant to index: index_taggings_on_taggable_id_and_taggable_type_and_context, table taggings
index_term_agreements_on_user_id -- 24 MB, redundant to index: term_agreements_unique_index, table term_agreements
total disk space occupied ~ 8.4GB
Edited by Nikolay Samokhvalov