Fix: アカウント一覧、カスタム絵文字一覧画面を高速化 (#585)

* Change: アカウント一覧、カスタム絵文字一覧でCOUNTを発行しないように

* Add index

* Fix test
This commit is contained in:
KMY(雪あすか) 2024-02-18 07:45:42 +09:00 committed by GitHub
parent 0f680a21b4
commit 0a6e68255f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 24 additions and 9 deletions

View file

@ -0,0 +1,11 @@
# frozen_string_literal: true
class ImproveRemotePendingAccountsIndex < ActiveRecord::Migration[7.1]
disable_ddl_transaction!
def change
remove_index :accounts, :remote_pending, unique: false, algorithm: :concurrently
add_index :accounts, :id, name: 'index_remote_pending_users', unique: false, algorithm: :concurrently, where: 'domain IS NOT NULL AND remote_pending AND suspended_at IS NOT NULL'
end
end