Skip to content

A platform for community discussion. Free, open, simple.

PERF: Add index for (action_type,created_at)` on `user_actions` table.

Guo Xiang Tanca4c9abec776
diff --git a/db/migrate/20190405044140_add_index_action_type_created_at_on_user_actions.rb b/db/migrate/20190405044140_add_index_action_type_created_at_on_user_actions.rb
new file mode 100644
index 00000000000..b0d8be1adc8
--- /dev/null
+++ b/db/migrate/20190405044140_add_index_action_type_created_at_on_user_actions.rb
@@ -0,0 +1,5 @@
+class AddIndexActionTypeCreatedAtOnUserActions < ActiveRecord::Migration[5.2]
+ def change
+ add_index :user_actions, [:action_type, :created_at]
+ end
+end