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 |
|---|---|---|
| 24,896 min 4% | 416 ms | 3,589,323 ankipro |
|
||
| 7,686 min 1% | 22 ms | 21,003,983 ankipro |
|
||
| 4,782 min 0.8% | 30 ms | 9,565,946 ankipro |
|
||
| 4,679 min 0.8% | 25 ms | 11,038,138 ankipro |
|
||
| 4,541 min 0.7% | 34 ms | 8,110,861 ankipro |
|
||
| 4,143 min 0.7% | 37 ms | 6,670,643 ankipro |
|
||
| 3,733 min 0.6% | 40 ms | 5,566,559 ankipro |
|
||
| 3,291 min 0.5% | 42 ms | 4,668,738 ankipro |
|
||
| 2,943 min 0.5% | 45 ms | 3,918,540 ankipro |
|
||
| 2,682 min 0.4% | 47 ms | 3,454,522 ankipro |
|
||
| 2,527 min 0.4% | 24 ms | 6,354,026 ankipro |
|
||
| 2,442 min 0.4% | 49 ms | 2,991,920 ankipro |
|
||
| 2,311 min 0.4% | 23 ms | 6,033,967 ankipro |
|
||
| 2,145 min 0.3% | 50 ms | 2,562,657 ankipro |
|
||
| 1,888 min 0.3% | 52 ms | 2,176,864 ankipro |
|
||
| 1,714 min 0.3% | 54 ms | 1,903,510 ankipro |
|
||
| 1,647 min 0.3% | 57 ms | 1,739,695 ankipro |
|
||
| 1,644 min 0.3% | 23 ms | 4,380,012 ankipro |
|
||
| 1,332 min 0.2% | 57 ms | 1,404,870 ankipro |
|
||
| 1,296 min 0.2% | 61 ms | 1,273,884 ankipro |
|
||
| 1,181 min 0.2% | 61 ms | 1,160,184 ankipro |
|
||
| 1,097 min 0.2% | 66 ms | 998,547 ankipro |
|
||
| 1,086 min 0.2% | 23 ms | 2,795,635 ankipro |
|
||
| 1,018 min 0.2% | 66 ms | 923,867 ankipro |
|
||
| 983 min 0.2% | 62 ms | 958,862 ankipro |
|
||
| 910 min 0.1% | 54 ms | 1,004,551 ankipro |
|
||
| 879 min 0.1% | 63 ms | 837,200 ankipro |
|
||
| 821 min 0.1% | 66 ms | 746,469 ankipro |
|
||
| 749 min 0.1% | 79 ms | 572,308 ankipro |
|
||
| 734 min 0.1% | 31 ms | 1,431,235 ankipro |
|
||
| 726 min 0.1% | 65 ms | 668,744 ankipro |
|
||