feat(perf): contacts query performance (#7175)
* feat: use more indexable where condition * feat: add index concurrently * chore: update schema * refactor: update index name
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
class AddPartialIndexForResolvedContacts < ActiveRecord::Migration[7.0]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def change
|
||||
add_index :contacts, [:account_id, :email, :phone_number, :identifier], where: "(email <> '' OR phone_number <> '' OR identifier <> '')",
|
||||
name: 'index_contacts_on_nonempty_fields', algorithm: :concurrently
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user