Skip to content

Commit 4460c33

Browse files
Add PgAnalyze indexes
1 parent cfbffa6 commit 4460c33

2 files changed

Lines changed: 37 additions & 1 deletion

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
class AddRecommendedQueryIndexes < ActiveRecord::Migration[8.1]
2+
disable_ddl_transaction!
3+
4+
def change
5+
add_index :dashboard_rollups, :bucket_value,
6+
name: :index_dashboard_rollups_on_bucket_value,
7+
algorithm: :concurrently,
8+
if_not_exists: true
9+
10+
add_index :users, :hca_id,
11+
name: :index_users_on_hca_id,
12+
algorithm: :concurrently,
13+
if_not_exists: true
14+
15+
add_index :leaderboards, :start_date,
16+
name: :index_leaderboards_on_start_date_all,
17+
algorithm: :concurrently,
18+
if_not_exists: true
19+
20+
add_index :good_jobs, :scheduled_at,
21+
name: :index_good_jobs_on_scheduled_at_all,
22+
algorithm: :concurrently,
23+
if_not_exists: true
24+
25+
add_index :good_jobs, :scheduled_at,
26+
name: :index_good_jobs_on_scheduled_at_unfinished_unperformed,
27+
where: "finished_at IS NULL AND performed_at IS NULL",
28+
algorithm: :concurrently,
29+
if_not_exists: true
30+
end
31+
end

db/schema.rb

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)