PERF: Dematerialize topic_reply_count (#9769)

* PERF: Dematerialize topic_reply_count

It's only ever used for trust level promotions that run daily, or compared to 0. We don't need to track it on every post creation.

* UX: Add symbol in TL3 report if topic reply count is capped

* DEV: Drop user_stats.topic_reply_count column
This commit is contained in:
Kane York
2020-05-14 15:42:00 -07:00
committed by GitHub
parent 675c9c38c8
commit 869f9b20a2
19 changed files with 73 additions and 119 deletions
-4
View File
@@ -111,14 +111,12 @@ describe PostOwnerChanger do
topic_count: 1,
post_count: 1,
first_post_created_at: p1.created_at,
topic_reply_count: 0
)
p2user.user_stat.update!(
topic_count: 0,
post_count: 1,
first_post_created_at: p2.created_at,
topic_reply_count: 1
)
UserAction.create!(action_type: UserAction::NEW_TOPIC, user_id: p1user.id, acting_user_id: p1user.id,
@@ -155,13 +153,11 @@ describe PostOwnerChanger do
p1_user_stat = p1user.user_stat
expect(p1_user_stat.first_post_created_at).to eq(nil)
expect(p1_user_stat.topic_reply_count).to eq(0)
expect(p1_user_stat.likes_received).to eq(0)
p2_user_stat = p2user.user_stat
expect(p2_user_stat.first_post_created_at).to eq(nil)
expect(p2_user_stat.topic_reply_count).to eq(0)
user_a_stat = user_a.user_stat