From 6ede7c462311e56d36b0dd4bbeff8c7bfb5099b0 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Fri, 3 Aug 2018 17:07:18 +0800 Subject: [PATCH] PERF: Add missing index on `EmailLog#bounced`. * Also remove index on `user_id_and_created_at` which isn't being used alot. --- .../20180803085321_add_index_email_logs_on_bounced.rb | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 db/migrate/20180803085321_add_index_email_logs_on_bounced.rb diff --git a/db/migrate/20180803085321_add_index_email_logs_on_bounced.rb b/db/migrate/20180803085321_add_index_email_logs_on_bounced.rb new file mode 100644 index 00000000000..549217abd07 --- /dev/null +++ b/db/migrate/20180803085321_add_index_email_logs_on_bounced.rb @@ -0,0 +1,6 @@ +class AddIndexEmailLogsOnBounced < ActiveRecord::Migration[5.2] + def change + add_index :email_logs, :bounced + remove_index :email_logs, [:user_id, :created_at] + end +end