* Add index on posts.is_deleted. The modqueue was slow because we the appeal condition wasn't constrained to deleted posts, so it degraded to a full table scan. * Avoid extra queries for calculating the page count and disapproval counts.
6 lines
145 B
Ruby
6 lines
145 B
Ruby
class AddDeletedIndexOnPosts < ActiveRecord::Migration[6.0]
|
|
def change
|
|
add_index :posts, :is_deleted, where: "is_deleted = true"
|
|
end
|
|
end
|