PERF: Add index to speed up `DirectoryItem.refresh_period!` query.

This commit is contained in:
Guo Xiang Tan 2017-03-03 15:14:49 +08:00
parent 89f056203e
commit 66a0a89591
1 changed files with 5 additions and 0 deletions

View File

@ -0,0 +1,5 @@
class AddIndexToTopicViewItems < ActiveRecord::Migration
def change
add_index :topic_views, [:user_id, :viewed_at]
end
end