Drop temporary index on vulnerabilities table
What does this MR do and why?
This index was added to be a supporting index for a backfill in Asynchronously create an index to support batch... (#433252 - closed) • Michał Zając • 16.7
This commit adds a migration to drop the index as the backfill is complete
Changelog: removed
Migration Output
bundle exec rails db:migrate
main: == [advisory_lock_connection] object_id: 118220, pg_backend_pid: 168984
main: == 20240217100818 DropTmpFindingIndexFromVulnerabilities: migrating ===========
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- view_exists?(:postgres_partitions)
main: -> 0.0072s
main: -- indexes(:vulnerabilities)
main: -> 0.0180s
main: -- execute("SET statement_timeout TO 0")
main: -> 0.0005s
main: -- remove_index(:vulnerabilities, {:algorithm=>:concurrently, :name=>"tmp_index_vulnerabilities_on_id_finding_id_empty"})
main: -> 0.0020s
main: -- execute("RESET statement_timeout")
main: -> 0.0005s
main: == 20240217100818 DropTmpFindingIndexFromVulnerabilities: migrated (0.0523s) ==
main: == [advisory_lock_connection] object_id: 118220, pg_backend_pid: 168984
ci: == [advisory_lock_connection] object_id: 118440, pg_backend_pid: 168986
ci: == 20240217100818 DropTmpFindingIndexFromVulnerabilities: migrating ===========
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- view_exists?(:postgres_partitions)
ci: -> 0.0013s
ci: -- indexes(:vulnerabilities)
ci: -> 0.0202s
ci: -- execute("SET statement_timeout TO 0")
ci: -> 0.0007s
ci: -- remove_index(:vulnerabilities, {:algorithm=>:concurrently, :name=>"tmp_index_vulnerabilities_on_id_finding_id_empty"})
ci: -> 0.0020s
ci: -- execute("RESET statement_timeout")
ci: -> 0.0006s
ci: == 20240217100818 DropTmpFindingIndexFromVulnerabilities: migrated (0.0621s) ==
ci: == [advisory_lock_connection] object_id: 118440, pg_backend_pid: 168986
bundle exec rails db:migrate:down:main VERSION=20240131100818
main: == [advisory_lock_connection] object_id: 117420, pg_backend_pid: 819367
main: == 20240131100818 DropTmpFindingIndexFromVulnerabilities: reverting ===========
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- view_exists?(:postgres_partitions)
main: -> 0.0032s
main: -- index_exists?(:vulnerabilities, :id, {:where=>"finding_id IS NULL", :name=>"tmp_index_vulnerabilities_on_id_finding_id_empty", :algorithm=>:concurrently})
main: -> 0.0057s
main: -- execute("SET statement_timeout TO 0")
main: -> 0.0001s
main: -- add_index(:vulnerabilities, :id, {:where=>"finding_id IS NULL", :name=>"tmp_index_vulnerabilities_on_id_finding_id_empty", :algorithm=>:concurrently})
main: -> 0.0158s
main: -- execute("RESET statement_timeout")
main: -> 0.0004s
main: == 20240131100818 DropTmpFindingIndexFromVulnerabilities: reverted (0.0350s) ==
main: == [advisory_lock_connection] object_id: 117420, pg_backend_pid: 819367
bundle exec rails db:migrate:down:ci VERSION=20240131100818
ci: == [advisory_lock_connection] object_id: 117400, pg_backend_pid: 819770
ci: == 20240131100818 DropTmpFindingIndexFromVulnerabilities: reverting ===========
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- view_exists?(:postgres_partitions)
ci: -> 0.0039s
ci: -- index_exists?(:vulnerabilities, :id, {:where=>"finding_id IS NULL", :name=>"tmp_index_vulnerabilities_on_id_finding_id_empty", :algorithm=>:concurrently})
ci: -> 0.0070s
ci: -- execute("SET statement_timeout TO 0")
ci: -> 0.0003s
ci: -- add_index(:vulnerabilities, :id, {:where=>"finding_id IS NULL", :name=>"tmp_index_vulnerabilities_on_id_finding_id_empty", :algorithm=>:concurrently})
ci: -> 0.0020s
ci: -- execute("RESET statement_timeout")
ci: -> 0.0001s
ci: == 20240131100818 DropTmpFindingIndexFromVulnerabilities: reverted (0.0267s) ==
ci: == [advisory_lock_connection] object_id: 117400, pg_backend_pid: 819770
MR acceptance checklist
Please 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 #433143 (closed)
Edited by Michael Becker