Fix performances of profile directory (#26842)
This commit is contained in:
parent
858ad1f363
commit
81caafbe84
4 changed files with 26 additions and 7 deletions
|
@ -0,0 +1,9 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddIndexAccountStatsOnLastStatusAtAndAccountId < ActiveRecord::Migration[7.0]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def change
|
||||
add_index :account_stats, [:last_status_at, :account_id], order: { last_status_at: 'DESC NULLS LAST' }, algorithm: :concurrently
|
||||
end
|
||||
end
|
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[7.0].define(version: 2023_09_04_134623) do
|
||||
ActiveRecord::Schema[7.0].define(version: 2023_09_07_150100) do
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
||||
|
@ -99,6 +99,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_09_04_134623) do
|
|||
t.datetime "updated_at", precision: nil, null: false
|
||||
t.datetime "last_status_at", precision: nil
|
||||
t.index ["account_id"], name: "index_account_stats_on_account_id", unique: true
|
||||
t.index ["last_status_at", "account_id"], name: "index_account_stats_on_last_status_at_and_account_id", order: { last_status_at: "DESC NULLS LAST" }
|
||||
end
|
||||
|
||||
create_table "account_statuses_cleanup_policies", force: :cascade do |t|
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue