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

Speeds up counting of likes in `About#stats`.
This commit is contained in:
Guo Xiang Tan 2019-04-05 12:44:48 +08:00
parent 81a1bafe54
commit ca4c9abec7

View File

@ -0,0 +1,5 @@
class AddIndexActionTypeCreatedAtOnUserActions < ActiveRecord::Migration[5.2]
def change
add_index :user_actions, [:action_type, :created_at]
end
end