diff options
author | Claire <claire.github-309c@sitedethib.com> | 2023-09-07 18:55:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-07 18:55:25 +0200 |
commit | 81caafbe84240bfb730f5001b33add97ebcbe9dc (patch) | |
tree | bad3d3a0dca4b3fac85da4516c64c592b80f57a5 /db/migrate/20230907150100_add_index_account_stats_on_last_status_at_and_account_id.rb | |
parent | 858ad1f363c621cffa6033756d18ddd89a17d336 (diff) |
Fix performances of profile directory (#26842)
Diffstat (limited to 'db/migrate/20230907150100_add_index_account_stats_on_last_status_at_and_account_id.rb')
-rw-r--r-- | db/migrate/20230907150100_add_index_account_stats_on_last_status_at_and_account_id.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/db/migrate/20230907150100_add_index_account_stats_on_last_status_at_and_account_id.rb b/db/migrate/20230907150100_add_index_account_stats_on_last_status_at_and_account_id.rb new file mode 100644 index 00000000000..17ac65547c5 --- /dev/null +++ b/db/migrate/20230907150100_add_index_account_stats_on_last_status_at_and_account_id.rb @@ -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 |