mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
PERF: Active Record #pluck is twice faster
PERF: SqlBuilder bypasses AR converters and uses PG directly
This commit is contained in:
@@ -137,7 +137,6 @@ class TopicQuery
|
||||
pinned_ids = query.where('pinned_at IS NOT NULL AND category_id = ?', category.id)
|
||||
.order('pinned_at DESC').pluck(:id)
|
||||
non_pinned_ids = query.where('pinned_at IS NULL OR category_id <> ?', category.id).pluck(:id)
|
||||
|
||||
(pinned_ids + non_pinned_ids)[0...@options[:per_page]]
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user