Remove unused indexes from members table

What does this MR do and why?

  • Remove unused indexes from members table
  • Remove two unused temporary indexes from members table, index_project_members_on_id_temp and tmp_index_for_null_member_namespace_id
  • tmp_index_for_null_member_namespace_id has no no usage in the last 6 months and index_project_members_on_id_temp has very little usage in the last 6 months.
  • They were both created for background migrations 3 years ago. The background migrations also have been cleaned up - !99212 (merged) & !95881 (merged).

Database

main: == [advisory_lock_connection] object_id: 151520, pg_backend_pid: 32990
main: == 20250827050123 RemoveIndexProjectMembersOnIdTemp: migrating ================
main: -- transaction_open?(nil)
main:    -> 0.0000s
main: -- view_exists?(:postgres_partitions)
main:    -> 0.0378s
main: -- indexes(:members)
main:    -> 0.0087s
main: -- execute("SET statement_timeout TO 0")
main:    -> 0.0004s
main: -- remove_index(:members, {:algorithm=>:concurrently, :name=>"index_project_members_on_id_temp"})
main:    -> 0.0028s
main: -- execute("RESET statement_timeout")
main:    -> 0.0004s
main: == 20250827050123 RemoveIndexProjectMembersOnIdTemp: migrated (0.0664s) =======

main: == [advisory_lock_connection] object_id: 151520, pg_backend_pid: 32990

main: == [advisory_lock_connection] object_id: 151520, pg_backend_pid: 32993
main: == 20250827050202 RemoveTmpIndexForNullMemberNamespaceId: migrating ===========
main: -- transaction_open?(nil)
main:    -> 0.0000s
main: -- view_exists?(:postgres_partitions)
main:    -> 0.0004s
main: -- indexes(:members)
main:    -> 0.0061s
main: -- execute("SET statement_timeout TO 0")
main:    -> 0.0003s
main: -- remove_index(:members, {:algorithm=>:concurrently, :name=>"tmp_index_for_null_member_namespace_id"})
main:    -> 0.0029s
main: -- execute("RESET statement_timeout")
main:    -> 0.0003s
main: == 20250827050202 RemoveTmpIndexForNullMemberNamespaceId: migrated (0.0196s) ==

main: == [advisory_lock_connection] object_id: 151520, pg_backend_pid: 32993

How to set up and validate locally

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Hinam Mehra

Merge request reports

Loading