Skip to content

Create index for project vulnerability_reads on common filters

What does this MR do and why?

This MR commits an asynchronously created index by Prepare async index for project vulnerability_r... (!124083 - merged).

rake command outputs
rake db:migrate:up
main: == 20230626101519 CreateIndexForVulnerabilityReadsOnCommonProjectFilters: migrating
main: -- transaction_open?()
main:    -> 0.0001s
main: -- view_exists?(:postgres_partitions)
main:    -> 0.1130s
main: -- index_exists?(:vulnerability_reads, [:project_id, :state, :report_type, :severity, :vulnerability_id], {:order=>{:severity=>:desc, :vulnerability_id=>:desc}, :name=>"index_project_vulnerability_reads_common_finder_query_desc", :algorithm=>:concurrently})
main:    -> 0.0100s
main: -- execute("SET statement_timeout TO 0")
main:    -> 0.0003s
main: -- add_index(:vulnerability_reads, [:project_id, :state, :report_type, :severity, :vulnerability_id], {:order=>{:severity=>:desc, :vulnerability_id=>:desc}, :name=>"index_project_vulnerability_reads_common_finder_query_desc", :algorithm=>:concurrently})
main:    -> 0.0122s
main: -- execute("RESET statement_timeout")
main:    -> 0.0004s
main: == 20230626101519 CreateIndexForVulnerabilityReadsOnCommonProjectFilters: migrated (0.1610s)
rake db:migrate:down
main: == [advisory_lock_connection] object_id: 223140, pg_backend_pid: 60579
main: == 20230626101519 CreateIndexForVulnerabilityReadsOnCommonProjectFilters: reverting
main: -- transaction_open?()
main:    -> 0.0000s
main: -- view_exists?(:postgres_partitions)
main:    -> 0.1128s
main: -- indexes(:vulnerability_reads)
main:    -> 0.0069s
main: -- execute("SET statement_timeout TO 0")
main:    -> 0.0001s
main: -- remove_index(:vulnerability_reads, {:algorithm=>:concurrently, :name=>"index_project_vulnerability_reads_common_finder_query_desc"})
main:    -> 0.0025s
main: -- execute("RESET statement_timeout")
main:    -> 0.0002s
main: == 20230626101519 CreateIndexForVulnerabilityReadsOnCommonProjectFilters: reverted (0.1356s)

Related to Unable to load the Vulnerability Report filtere... (#413697 - closed)

MR acceptance checklist

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

Edited by Mehmet Emin INAC

Merge request reports

Loading