Inactive Replication Slots
Inactive replication slots can cause a lot of disk space to be consumed.
For each, run:
SELECT pg_drop_replication_slot('slot_name');
| Name |
|---|
| sub_coord_local |
Inactive replication slots can cause a lot of disk space to be consumed.
For each, run:
SELECT pg_drop_replication_slot('slot_name');
| Name |
|---|
| sub_coord_local |
These indexes exist, but can’t be used. You should recreate them.
| Name |
|---|
| idx_card_progresses_deck_id_id v2 |
|
| card_progresses_user_id_id_idx v2 |
|
| trgm_idx_notes_back_side v2 |
|
| trgm_idx_notes_front_side v2 |
|
These indexes exist, but aren’t needed. Remove them for faster writes.
rails generate migration remove_unneeded_indexes
And paste
remove_index :motor_alert_locks, name: "index_motor_alert_locks_on_alert_id", column: :alert_id remove_index :notes, name: "index_notes_on_id_asc_and_deck_id", column: [:id, :deck_id] remove_index :streak_day_freezes, name: "index_streak_day_freezes_on_streak_id", column: :streak_id remove_index :streak_day_freezes, name: "index_streak_day_freezes_on_user_id", column: :user_id remove_index :taggings, name: "index_taggings_on_tag_id", column: :tag_id remove_index :taggings, name: "index_taggings_on_taggable_id", column: :taggable_id remove_index :taggings, name: "index_taggings_on_taggable_type", column: :taggable_type remove_index :taggings, name: "index_taggings_on_tagger_id", column: :tagger_id remove_index :user_social_links, name: "index_user_social_links_on_user_id", column: :user_id
| Details |
|---|
On motor_alert_locks
index_motor_alert_locks_on_alert_id (alert_id)is covered by index_motor_alert_locks_on_alert_id_and_lock_timestamp (alert_id, lock_timestamp) |
On notes
index_notes_on_id_asc_and_deck_id (id, deck_id)is covered by notes_pkey (id, deck_id) |
On streak_day_freezes
index_streak_day_freezes_on_streak_id (streak_id)is covered by index_streak_day_freezes_on_streak_id_and_freeze_date (streak_id, freeze_date) |
On streak_day_freezes
index_streak_day_freezes_on_user_id (user_id)is covered by index_streak_day_freezes_on_user_id_and_freeze_date (user_id, freeze_date) |
On taggings
index_taggings_on_tag_id (tag_id)is covered by taggings_idx (tag_id, taggable_id, taggable_type, context, tagger_id, tagger_type) |
On taggings
index_taggings_on_taggable_id (taggable_id)is covered by taggings_idy (taggable_id, taggable_type, tagger_id, context) |
On taggings
index_taggings_on_taggable_type (taggable_type)is covered by index_taggings_on_taggable_type_and_taggable_id (taggable_type, taggable_id) |
On taggings
index_taggings_on_tagger_id (tagger_id)is covered by index_taggings_on_tagger_id_and_tagger_type (tagger_id, tagger_type) |
On user_social_links
index_user_social_links_on_user_id (user_id)is covered by index_user_social_links_on_user_id_and_social_provider_id (user_id, social_provider_id) |
Slow queries take 20 ms or more on average and have been called at least 100 times.
Explain queries to see where to add indexes.
| Total Time | Average Time | Calls |
|---|---|---|
| 25,130 min 4% | 417 ms | 3,620,107 ankipro |
|
||
| 7,740 min 1% | 22 ms | 21,145,349 ankipro |
|
||
| 4,815 min 0.8% | 30 ms | 9,625,211 ankipro |
|
||
| 4,708 min 0.8% | 25 ms | 11,101,375 ankipro |
|
||
| 4,571 min 0.7% | 34 ms | 8,161,234 ankipro |
|
||
| 4,170 min 0.7% | 37 ms | 6,712,235 ankipro |
|
||
| 3,758 min 0.6% | 40 ms | 5,600,892 ankipro |
|
||
| 3,314 min 0.5% | 42 ms | 4,698,760 ankipro |
|
||
| 2,964 min 0.5% | 45 ms | 3,944,822 ankipro |
|
||
| 2,701 min 0.4% | 47 ms | 3,477,000 ankipro |
|
||
| 2,544 min 0.4% | 24 ms | 6,394,670 ankipro |
|
||
| 2,461 min 0.4% | 49 ms | 3,012,492 ankipro |
|
||
| 2,327 min 0.4% | 23 ms | 6,073,944 ankipro |
|
||
| 2,160 min 0.3% | 50 ms | 2,578,918 ankipro |
|
||
| 1,901 min 0.3% | 52 ms | 2,191,615 ankipro |
|
||
| 1,727 min 0.3% | 54 ms | 1,916,034 ankipro |
|
||
| 1,660 min 0.3% | 57 ms | 1,752,152 ankipro |
|
||
| 1,656 min 0.3% | 23 ms | 4,411,299 ankipro |
|
||
| 1,342 min 0.2% | 57 ms | 1,414,008 ankipro |
|
||
| 1,305 min 0.2% | 61 ms | 1,282,909 ankipro |
|
||
| 1,189 min 0.2% | 61 ms | 1,168,532 ankipro |
|
||
| 1,105 min 0.2% | 66 ms | 1,005,276 ankipro |
|
||
| 1,094 min 0.2% | 23 ms | 2,814,107 ankipro |
|
||
| 1,027 min 0.2% | 66 ms | 930,610 ankipro |
|
||
| 990 min 0.2% | 62 ms | 965,318 ankipro |
|
||
| 914 min 0.1% | 54 ms | 1,013,797 ankipro |
|
||
| 886 min 0.1% | 63 ms | 842,498 ankipro |
|
||
| 828 min 0.1% | 66 ms | 751,884 ankipro |
|
||
| 758 min 0.1% | 79 ms | 575,787 ankipro |
|
||
| 738 min 0.1% | 31 ms | 1,438,860 ankipro |
|
||
| 731 min 0.1% | 65 ms | 673,151 ankipro |
|
||