Skip to content
Snippets Groups Projects

Index vulnerability_reads on casted_cluster_agent_id

Merged Tiger Watson requested to merge add-vulnerability-reads-agent-id-index into master
All threads resolved!

What does this MR do and why?

Adds an index to vulnerability_reads.casted_cluster_agent_id. Currently there is only a partial index on this column, which is not suitable for performing foreign key actions.

Migration output

main: == 20220630050050 IndexVulnerabilityReadsOnCastedClusterAgentIdFull: migrating
main: -- transaction_open?()
main:    -> 0.0000s
main: -- index_exists?(:vulnerability_reads, :casted_cluster_agent_id, {:name=>"index_vuln_reads_on_casted_cluster_agent_id_where_it_is_null", :where=>"casted_cluster_agent_id IS NOT NULL", :algorithm=>:concurrently})
main:    -> 0.0100s
main: -- execute("SET statement_timeout TO 0")
main:    -> 0.0006s
main: -- add_index(:vulnerability_reads, :casted_cluster_agent_id, {:name=>"index_vuln_reads_on_casted_cluster_agent_id_where_it_is_null", :where=>"casted_cluster_agent_id IS NOT NULL", :algorithm=>:concurrently})
main:    -> 0.0037s
main: -- execute("RESET statement_timeout")
main:    -> 0.0007s
main: == 20220630050050 IndexVulnerabilityReadsOnCastedClusterAgentIdFull: migrated (0.0235s)
main: == 20220630050050 IndexVulnerabilityReadsOnCastedClusterAgentIdFull: reverting
main: -- transaction_open?()
main:    -> 0.0000s
main: -- indexes(:vulnerability_reads)
main:    -> 0.0122s
main: -- execute("SET statement_timeout TO 0")
main:    -> 0.0004s
main: -- remove_index(:vulnerability_reads, {:algorithm=>:concurrently, :name=>"index_vuln_reads_on_casted_cluster_agent_id_where_it_is_null"})
main:    -> 0.0026s
main: -- execute("RESET statement_timeout")
main:    -> 0.0005s
main: == 20220630050050 IndexVulnerabilityReadsOnCastedClusterAgentIdFull: reverted (0.0279s)

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

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

#366615 (closed)

Edited by João Alexandre Cunha

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • @tigerwnz in the interest of time and since I assume what you have will end up being the best option I'll pass along to @Alexand .

    Edited by Dylan Griffith
  • Dylan Griffith requested review from @Alexand

    requested review from @Alexand

  • Dylan Griffith removed review request for @DylanGriffith

    removed review request for @DylanGriffith

  • Tiger Watson mentioned in merge request !91456 (merged)

    mentioned in merge request !91456 (merged)

  • Tiger Watson added 1 commit

    added 1 commit

    • 886f6e34 - Index vulnerability_reads on casted_cluster_agent_id

    Compare with previous version

  • Tiger Watson changed the description

    changed the description

  • Setting label(s) ~"devops::configure" sectionops based on ~"group::configure".

  • added 1 commit

    • 44f2bca0 - Change index name to include where clause

    Compare with previous version

  • A deleted user added database label

    added database label

  • added 92 commits

    Compare with previous version

  • João Alexandre Cunha resolved all threads

    resolved all threads

  • João Alexandre Cunha approved this merge request

    approved this merge request

  • :wave: @Alexand, thanks for approving this merge request.

    This is the first time the merge request is approved. To ensure full test coverage, a new pipeline has been started.

    For more info, please refer to the following links:

  • João Alexandre Cunha changed the description

    changed the description

  • added databaseapproved label and removed databasereviewed label

  • João Alexandre Cunha enabled an automatic merge when the pipeline for 9bff45f6 succeeds

    enabled an automatic merge when the pipeline for 9bff45f6 succeeds

  • mentioned in commit 9cf74412

  • no schema change; no impact to data warehouse

  • added workflowstaging label and removed workflowcanary label

  • Please register or sign in to reply
    Loading