search: fix order:note, order:comment_bumped to use indexes.

This commit is contained in:
evazion
2017-05-19 17:04:51 -05:00
parent d74eda2b96
commit fad4d48b1c
4 changed files with 17 additions and 4 deletions

View File

@@ -0,0 +1,11 @@
class FixLastNotedAtIndexOnPosts < ActiveRecord::Migration
def up
Post.without_timeout do
remove_index :posts, column: :last_comment_bumped_at
add_index :posts, :last_comment_bumped_at, order: "DESC NULLS LAST"
remove_index :posts, column: :last_noted_at
add_index :posts, :last_noted_at, order: "DESC NULLS LAST"
end
end
end