From ca2100d012bd5028750c8161f3b6e1ac6cb822c3 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 10 Sep 2014 22:19:24 +1000 Subject: [PATCH] PERF: work around LIMIT breaking query plan (CTE is a optimisation boundary, so limit no longer has any effect on plan) --- app/models/topic_tracking_state.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/topic_tracking_state.rb b/app/models/topic_tracking_state.rb index 2ed1bf5f0de..05334ccadae 100644 --- a/app/models/topic_tracking_state.rb +++ b/app/models/topic_tracking_state.rb @@ -130,6 +130,7 @@ class TopicTrackingState new = TopicQuery.new_filter(Topic, "xxx").where_values.join(" AND ").gsub!("'xxx'", treat_as_new_topic_clause) sql = <