chore: Add indexes to improve reporting performance (#9478)

- Adding a new index on (account_id,created_at,message_type) based on
our performance improvement exercise. This index significantly improves
the page load speeds of messaging reports.
This commit is contained in:
Sojan Jose
2024-05-15 21:21:15 -07:00
committed by GitHub
parent 5657473573
commit 7b83480979
3 changed files with 10 additions and 1 deletions

View File

@@ -0,0 +1,7 @@
class AddIndexForMessageTypeAccountDate < ActiveRecord::Migration[7.0]
disable_ddl_transaction!
def change
add_index :messages, [:account_id, :created_at, :message_type], name: 'index_messages_on_account_created_type', algorithm: :concurrently
end
end