#66 検索速度改善

This commit is contained in:
KMY 2023-10-07 21:45:46 +09:00
parent 30edfda9e4
commit f6b583aca7
2 changed files with 17 additions and 1 deletions

View file

@ -0,0 +1,15 @@
# frozen_string_literal: true
require Rails.root.join('lib', 'mastodon', 'migration_helpers')
class ImproveSearchForAccountStatuses < ActiveRecord::Migration[7.0]
include Mastodon::MigrationHelpers
disable_ddl_transaction!
def change
safety_assured do
add_index :statuses, [:account_id, :reblog_of_id, :deleted_at, :searchability], name: 'index_statuses_for_get_following_accounts_to_search', where: 'deleted_at IS NULL AND reblog_of_id IS NULL AND searchability IN (0, 10, 1)'
end
end
end