PERF: index for deleted posts in a topic to speed up has_deleted detection
This commit is contained in:
parent
7d4aed66c7
commit
a5d0e0f277
|
@ -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
|
Loading…
Reference in New Issue