Skip to content

Remove vulnerability_occurrences_location_temp_index

Sashi Kumar Kumaresan requested to merge sk/345561-remove-tmp-index into master

What does this MR do and why?

Addresses #345561 (closed)

!72788 (merged) introduced background migration to populate location in vulnerability_occurrences that contains nil values. In order to speed up the migration, an index (vulnerability_occurrences_location_temp_index) was added on id column. Now that the migration is complete,

Migrate up

== 20211214110307 RemoveTempIndexFromVulnerabilityOccurrences: migrating ======
-- transaction_open?()
   -> 0.0000s
-- indexes(:vulnerability_occurrences)
   -> 0.0072s
-- execute("SET statement_timeout TO 0")
   -> 0.0005s
-- remove_index(:vulnerability_occurrences, {:algorithm=>:concurrently, :name=>"vulnerability_occurrences_location_temp_index"})
   -> 0.0061s
-- execute("RESET statement_timeout")
   -> 0.0006s
== 20211214110307 RemoveTempIndexFromVulnerabilityOccurrences: migrated (0.0352s) 

Migrate Down

== 20211214110307 RemoveTempIndexFromVulnerabilityOccurrences: reverting ======
-- transaction_open?()
   -> 0.0000s
-- index_exists?(:vulnerability_occurrences, :id, {:where=>"location IS NULL", :name=>"vulnerability_occurrences_location_temp_index", :algorithm=>:concurrently})
   -> 0.0056s
-- execute("SET statement_timeout TO 0")
   -> 0.0006s
-- add_index(:vulnerability_occurrences, :id, {:where=>"location IS NULL", :name=>"vulnerability_occurrences_location_temp_index", :algorithm=>:concurrently})
   -> 0.0453s
-- execute("RESET statement_timeout")
   -> 0.0008s
== 20211214110307 RemoveTempIndexFromVulnerabilityOccurrences: reverted (0.0626s) 

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports