A platform for community discussion. Free, open, simple.
PERF: Tune indexes to speed up lookup for bounced email.
Guo Xiang Tan09a00016ad79
diff --git a/db/migrate/20180719103905_alter_indexes_on_email_logs.rb b/db/migrate/20180719103905_alter_indexes_on_email_logs.rbnew file mode 100644index 00000000000..380021a1852--- /dev/null+++ b/db/migrate/20180719103905_alter_indexes_on_email_logs.rb@@ -0,0 +1,12 @@+class AlterIndexesOnEmailLogs < ActiveRecord::Migration[5.2]+ def change+ remove_index :email_logs,+ name: "index_email_logs_on_user_id_and_created_at",+ column: [:user_id, :created_at]++ add_index :email_logs, :user_id++ remove_index :email_logs, [:skipped, :created_at]+ add_index :email_logs, [:skipped, :bounced, :created_at]+ end+end