mirror of
https://github.com/discourse/discourse.git
synced 2025-02-20 17:52:45 +08:00
PERF: Add index to speed up User#number_of_flagged_posts
.
On meta, we were seeing the query take almost 100ms.
This commit is contained in:
parent
54d3648c55
commit
f0f1e878fe
@ -0,0 +1,6 @@
|
||||
class AddIndexPostActionTypeIdDisagreedAtOnPostActions < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
add_index :post_actions, [:post_action_type_id, :disagreed_at],
|
||||
where: "(disagreed_at IS NULL)"
|
||||
end
|
||||
end
|
Loading…
x
Reference in New Issue
Block a user