PERF: Drop support for gaps in mega topics.

Based on our current implementation, there isn't a
practical way to determine the gaps of large topics
cheaply. We tried to load the gaps in chunks but felt
that the code becomes too complicated. Note that
megatopics are quite rare in the wild.
This commit is contained in:
Guo Xiang Tan 2018-07-10 16:23:53 +08:00
parent f2cc05c6c6
commit b4e1388f9b

View File

@ -104,7 +104,14 @@ class TopicView
def gaps
return unless @contains_gaps
@gaps ||= Gaps.new(filtered_post_ids, unfiltered_posts.order(:sort_order).pluck(:id))
@gaps ||= begin
if is_mega_topic?
nil
else
Gaps.new(filtered_post_ids, unfiltered_posts.order(:sort_order).pluck(:id))
end
end
end
def last_post