feat: add index to conversation id and account_id (#6757)

- This PR adds an index to conversations id and account_id. This improves the performance of some reports query
This commit is contained in:
Shivam Mishra
2023-03-28 22:34:04 +05:30
committed by GitHub
parent 54a809ea54
commit bc8e8f3bb5
6 changed files with 27 additions and 1 deletions

View File

@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2023_03_15_105847) do
ActiveRecord::Schema.define(version: 2023_03_27_081350) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_stat_statements"
@@ -448,6 +448,7 @@ ActiveRecord::Schema.define(version: 2023_03_15_105847) do
t.datetime "assignee_last_seen_at"
t.datetime "first_reply_created_at"
t.index ["account_id", "display_id"], name: "index_conversations_on_account_id_and_display_id", unique: true
t.index ["account_id", "id"], name: "index_conversations_on_id_and_account_id"
t.index ["account_id", "inbox_id", "status", "assignee_id"], name: "conv_acid_inbid_stat_asgnid_idx"
t.index ["account_id"], name: "index_conversations_on_account_id"
t.index ["assignee_id", "account_id"], name: "index_conversations_on_assignee_id_and_account_id"