order by id instead of created_at
id is indexed while created_at is not
This commit is contained in:
@@ -106,7 +106,7 @@ class Forumthread < ActiveRecord::Base
|
||||
if order_phrase.present?
|
||||
threads = threads.order("GREATEST(relevance, reply_rel) DESC")
|
||||
else
|
||||
threads = threads.order("sticky desc", "threadreplies.created_at DESC", "forumthreads.created_at DESC")
|
||||
threads = threads.order("sticky DESC", "threadreplies.id DESC", "forumthreads.id DESC")
|
||||
end
|
||||
threads
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user