Skip to content

Adding index on work_item_progresses.reminder_frequency

Darby Frey requested to merge index-reminder-frequency into master

What does this MR do and why?

A follow up to Adding OKR checkin reminder email notifications (!131426 - merged), this MR adds an index on work_item_progresses.reminder_frequency

Migration Output

bundle exec rake db:migrate:up:main VERSION=20230925170448

main: == [advisory_lock_connection] object_id: 226720, pg_backend_pid: 38545
main: == 20230925170448 AddIndexOnOkrReminderFrequency: migrating ===================
main: -- transaction_open?(nil)
main:    -> 0.0000s
main: -- view_exists?(:postgres_partitions)
main:    -> 0.2191s
main: -- index_exists?(:work_item_progresses, :reminder_frequency, {:name=>"idx_reminder_frequency_on_work_item_progresses", :algorithm=>:concurrently})
main:    -> 0.0019s
main: -- execute("SET statement_timeout TO 0")
main:    -> 0.0002s
main: -- add_index(:work_item_progresses, :reminder_frequency, {:name=>"idx_reminder_frequency_on_work_item_progresses", :algorithm=>:concurrently})
main:    -> 0.0055s
main: -- execute("RESET statement_timeout")
main:    -> 0.0005s
main: == 20230925170448 AddIndexOnOkrReminderFrequency: migrated (0.2470s) ==========

bundle exec rake db:migrate:down:main VERSION=20230925170448

main: == [advisory_lock_connection] object_id: 226780, pg_backend_pid: 39791
main: == 20230925170448 AddIndexOnOkrReminderFrequency: reverting ===================
main: -- transaction_open?(nil)
main:    -> 0.0000s
main: -- view_exists?(:postgres_partitions)
main:    -> 0.1789s
main: -- indexes(:work_item_progresses)
main:    -> 0.0058s
main: -- execute("SET statement_timeout TO 0")
main:    -> 0.0014s
main: -- remove_index(:work_item_progresses, {:algorithm=>:concurrently, :name=>"idx_reminder_frequency_on_work_item_progresses"})
main:    -> 0.0034s
main: -- execute("RESET statement_timeout")
main:    -> 0.0004s
main: == 20230925170448 AddIndexOnOkrReminderFrequency: reverted (0.3086s) ==========

main: == [advisory_lock_connection] object_id: 226780, pg_backend_pid: 39791

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

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.

Edited by Darby Frey

Merge request reports