mirror of
https://github.com/discourse/discourse.git
synced 2025-03-21 16:35:32 +08:00
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…
x
Reference in New Issue
Block a user