chore: Additional indexes and fixes (#6675)

- Fix breakage related to the look-up job in Heroku deploys 
- Add additional db indexes for performance optimisations
This commit is contained in:
Sojan Jose
2023-03-15 19:52:02 +05:30
committed by GitHub
parent 7331154f04
commit de8c26dce8
5 changed files with 18 additions and 3 deletions

View File

@@ -0,0 +1,11 @@
class AddIndexesForCommonQueries < ActiveRecord::Migration[6.1]
# disabling ddl transaction is required for concurrent index creation
# https://thoughtbot.com/blog/how-to-create-postgres-indexes-concurrently-in
disable_ddl_transaction!
def change
ActiveRecord::Migration[6.1].add_index(:inboxes, [:channel_id, :channel_type], algorithm: :concurrently)
ActiveRecord::Migration[6.1].add_index(:conversations, [:account_id, :inbox_id, :status, :assignee_id], name: 'conv_acid_inbid_stat_asgnid_idx',
algorithm: :concurrently)
end
end