PERF: index for deleted posts in a topic to speed up has_deleted detection

This commit is contained in:
Sam 2016-07-19 10:29:07 +10:00
parent 7d4aed66c7
commit a5d0e0f277

View file

@ -0,0 +1,5 @@
class AddDeletedPostIndexToPosts < ActiveRecord::Migration
def change
add_index :posts, [:topic_id, :post_number], where: 'deleted_at IS NOT NULL', name: 'idx_posts_deleted_posts'
end
end