From 5694e24bbf9afccbbf1b44d3a405a4e2bc0ff08d Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sun, 27 Aug 2023 22:37:35 +0200 Subject: [PATCH] Fix unnecessary condition causing seqscan when indexing (#26689) --- app/models/concerns/account_statuses_search.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/concerns/account_statuses_search.rb b/app/models/concerns/account_statuses_search.rb index 563a871051..626bf38900 100644 --- a/app/models/concerns/account_statuses_search.rb +++ b/app/models/concerns/account_statuses_search.rb @@ -31,7 +31,7 @@ module AccountStatusesSearch def add_to_public_statuses_index! return unless Chewy.enabled? - statuses.indexable.find_in_batches do |batch| + statuses.without_reblogs.where(visibility: :public).find_in_batches do |batch| PublicStatusesIndex.import(query: batch) end end