Sync drop redundant index index_ci_build_needs_on_partition_id_build_id
What does this MR do and why?
The index index_ci_build_needs_on_partition_id_build_id was dropped asynchronously over the weekend on ~2025-05-31 with !192164 (merged).
The justification for index removal can be found here: !192164 (merged).
In this MR, we synchronously drop the index.
References
- Issue: #536403 (closed)
Database migration
Up
main: == [advisory_lock_connection] object_id: 136540, pg_backend_pid: 94582
main: == 20250602200712 RemoveIdxCiBuildNeedsOnPartitionIdBuildId: migrating ========
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- view_exists?(:postgres_partitions)
main: -> 0.0139s
main: -- indexes(:ci_build_needs)
main: -> 0.0020s
main: -- execute("SET statement_timeout TO 0")
main: -> 0.0003s
main: -- remove_index(:ci_build_needs, {:algorithm=>:concurrently, :name=>:index_ci_build_needs_on_partition_id_build_id})
main: -> 0.0020s
main: -- execute("RESET statement_timeout")
main: -> 0.0003s
main: == 20250602200712 RemoveIdxCiBuildNeedsOnPartitionIdBuildId: migrated (0.0305s)
main: == [advisory_lock_connection] object_id: 136540, pg_backend_pid: 94582
ci: == [advisory_lock_connection] object_id: 136540, pg_backend_pid: 94583
ci: == 20250602200712 RemoveIdxCiBuildNeedsOnPartitionIdBuildId: migrating ========
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- view_exists?(:postgres_partitions)
ci: -> 0.0004s
ci: -- indexes(:ci_build_needs)
ci: -> 0.0020s
ci: -- execute("SET statement_timeout TO 0")
ci: -> 0.0003s
ci: -- remove_index(:ci_build_needs, {:algorithm=>:concurrently, :name=>:index_ci_build_needs_on_partition_id_build_id})
ci: -> 0.0024s
ci: -- execute("RESET statement_timeout")
ci: -> 0.0003s
ci: == 20250602200712 RemoveIdxCiBuildNeedsOnPartitionIdBuildId: migrated (0.0169s)
ci: == [advisory_lock_connection] object_id: 136540, pg_backend_pid: 94583
Down
main: == [advisory_lock_connection] object_id: 136240, pg_backend_pid: 94508
main: == 20250602200712 RemoveIdxCiBuildNeedsOnPartitionIdBuildId: reverting ========
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- view_exists?(:postgres_partitions)
main: -> 0.0150s
main: -- index_exists?(:ci_build_needs, [:partition_id, :build_id], {:name=>:index_ci_build_needs_on_partition_id_build_id, :algorithm=>:concurrently})
main: -> 0.0020s
main: -- execute("SET statement_timeout TO 0")
main: -> 0.0009s
main: -- add_index(:ci_build_needs, [:partition_id, :build_id], {:name=>:index_ci_build_needs_on_partition_id_build_id, :algorithm=>:concurrently})
main: -> 0.0026s
main: -- execute("RESET statement_timeout")
main: -> 0.0003s
main: == 20250602200712 RemoveIdxCiBuildNeedsOnPartitionIdBuildId: reverted (0.0346s)
main: == [advisory_lock_connection] object_id: 136240, pg_backend_pid: 94508
ci: == [advisory_lock_connection] object_id: 136240, pg_backend_pid: 94542
ci: == 20250602200712 RemoveIdxCiBuildNeedsOnPartitionIdBuildId: reverting ========
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- view_exists?(:postgres_partitions)
ci: -> 0.0145s
ci: -- index_exists?(:ci_build_needs, [:partition_id, :build_id], {:name=>:index_ci_build_needs_on_partition_id_build_id, :algorithm=>:concurrently})
ci: -> 0.0019s
ci: -- execute("SET statement_timeout TO 0")
ci: -> 0.0003s
ci: -- add_index(:ci_build_needs, [:partition_id, :build_id], {:name=>:index_ci_build_needs_on_partition_id_build_id, :algorithm=>:concurrently})
ci: -> 0.0035s
ci: -- execute("RESET statement_timeout")
ci: -> 0.0003s
ci: == 20250602200712 RemoveIdxCiBuildNeedsOnPartitionIdBuildId: reverted (0.0365s)
ci: == [advisory_lock_connection] object_id: 136240, pg_backend_pid: 94542
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.
Related to #536403 (closed)
Edited by Leaminn Ma