[go: up one dir, main page]

Skip to content

Add index on source_id of compliance management frameworks

What does this MR do and why?

Adding an index on source_id as we are querying as part of propagation of frameworks.

Migration Logs

rails db:migrate:down:main VERSION=20250708033402
main: == [advisory_lock_connection] object_id: 138840, pg_backend_pid: 31155
main: == 20250708033402 AddIndexOnComplianceFrameworks: reverting ===================
main: -- transaction_open?(nil)
main:    -> 0.0000s
main: -- view_exists?(:postgres_partitions)
main:    -> 0.0149s
main: -- indexes(:compliance_management_frameworks)
main:    -> 0.0044s
main: -- execute("SET statement_timeout TO 0")
main:    -> 0.0056s
main: -- remove_index(:compliance_management_frameworks, {:algorithm=>:concurrently, :name=>"index_compliance_management_frameworks_on_source_id"})
main:    -> 0.0065s
main: -- execute("RESET statement_timeout")
main:    -> 0.0040s
main: == 20250708033402 AddIndexOnComplianceFrameworks: reverted (0.0614s) ==========

main: == [advisory_lock_connection] object_id: 138840, pg_backend_pid: 31155
rails db:migrate:up:main VERSION=20250708033402
main: == [advisory_lock_connection] object_id: 138840, pg_backend_pid: 31233
main: == 20250708033402 AddIndexOnComplianceFrameworks: migrating ===================
main: -- transaction_open?(nil)
main:    -> 0.0000s
main: -- view_exists?(:postgres_partitions)
main:    -> 0.0164s
main: -- index_exists?(:compliance_management_frameworks, :source_id, {:name=>"index_compliance_management_frameworks_on_source_id", :algorithm=>:concurrently})
main:    -> 0.0038s
main: -- execute("SET statement_timeout TO 0")
main:    -> 0.0025s
main: -- add_index(:compliance_management_frameworks, :source_id, {:name=>"index_compliance_management_frameworks_on_source_id", :algorithm=>:concurrently})
main:    -> 0.0046s
main: -- execute("RESET statement_timeout")
main:    -> 0.0040s
main: == 20250708033402 AddIndexOnComplianceFrameworks: migrated (0.0533s) ==========

main: == [advisory_lock_connection] object_id: 138840, pg_backend_pid: 31233

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 #554106 (closed)

Edited by Jean van der Walt

Merge request reports

Loading