logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

20170610000000_add_statuses_index_on_account_id_id.rb (588B)


  1. class AddStatusesIndexOnAccountIdId < ActiveRecord::Migration[5.1]
  2. disable_ddl_transaction!
  3. def change
  4. # Statuses queried by account_id are often sorted by id. Querying statuses
  5. # of an account to show them in his status page is one of the most
  6. # significant examples.
  7. # Add this index to improve the performance in such cases.
  8. add_index 'statuses', ['account_id', 'id'], algorithm: :concurrently, name: 'index_statuses_on_account_id_id'
  9. remove_index 'statuses', algorithm: :concurrently, column: 'account_id', name: 'index_statuses_on_account_id'
  10. end
  11. end