PgHero

Space

Database Size: 491 GB

80 unused indices. Remove them for faster writes.

rails generate migration remove_unused_indexes

And paste

remove_index :devices, name: "index_devices_on_firebase_token"
remove_index :users_new, name: "users_new_analytics_id_idx"
remove_index :attachments, name: "index_attachments_on_deck_id"
remove_index :decks, name: "index_decks_on_anki_deck_id"
remove_index :decks, name: "index_decks_on_deck_import_id"
remove_index :solid_queue_jobs, name: "index_solid_queue_jobs_for_alerting"
remove_index :note_attachments, name: "index_v2_note_attachments_on_note_id_and_deck_id"
remove_index :users_new, name: "users_new_id_timezone_offset_idx"
remove_index :note_attachments, name: "index_note_attachments_on_attachment_id"
remove_index :library_templates, name: "index_library_templates_on_library_deck_id"
remove_index :library_decks, name: "index_library_decks_on_name"
remove_index :library_templates, name: "index_library_templates_on_original_anki_id"
remove_index :users_new, name: "users_new_email_idx"
remove_index :users_new, name: "users_new_lower_idx"
remove_index :search_queries, name: "index_search_queries_on_library_deck_id"
remove_index :card_attachments, name: "index_card_attachments_on_deck_id"
remove_index :note_attachments, name: "index_note_attachments_on_deck_id"
remove_index :solid_queue_jobs, name: "index_solid_queue_jobs_on_class_name"
remove_index :card_progresses, name: "index_card_progresses_on_deck_id_and_user_id_and_note_id"
remove_index :users_new, name: "users_new_country_code_idx"
remove_index :card_progresses, name: "card_progresses_user_id_id_idx"
remove_index :card_progresses, name: "idx_card_progresses_deck_id_id"
remove_index :card_progresses, name: "idx_v2_cp"
remove_index :library_decks, name: "index_library_decks_on_deck_import_id"
remove_index :library_decks, name: "index_library_decks_on_category"
remove_index :card_progresses, name: "index_card_progresses_on_note_id"
remove_index :library_decks, name: "index_library_decks_on_category_id"
remove_index :library_models, name: "index_library_models_on_library_deck_id"
remove_index :card_progresses, name: "index_v2_card_progresses_on_user_id_and_frozen"
remove_index :deck_exports, name: "index_deck_exports_on_deck_id"
remove_index :motor_audits, name: "index_motor_audits_on_created_at"
remove_index :deck_exports, name: "index_deck_exports_on_user_id"
remove_index :motor_audits, name: "index_motor_audits_on_request_uuid"
remove_index :users_new, name: "users_new_reset_password_token_idx"
remove_index :motor_audits, name: "motor_auditable_user_index"
remove_index :taggings, name: "taggings_idy"
remove_index :taggings, name: "taggings_taggable_context_idx"
remove_index :taggings, name: "index_taggings_on_taggable_id"
remove_index :taggings, name: "index_taggings_on_context"
remove_index :taggings, name: "index_taggings_on_tag_id"
remove_index :taggings, name: "index_taggings_on_taggable_type"
remove_index :taggings, name: "index_taggings_on_tagger_id"
remove_index :taggings, name: "index_taggings_on_tagger_id_and_tagger_type"
remove_index :taggings, name: "index_taggings_on_tagger_type_and_tagger_id"
remove_index :taggings, name: "index_taggings_on_tenant"
remove_index :card_presets, name: "index_card_presets_on_user_id"
remove_index :motor_dashboards, name: "index_motor_dashboards_on_updated_at"
remove_index :motor_queries, name: "index_motor_queries_on_updated_at"
remove_index :motor_taggable_tags, name: "index_motor_taggable_tags_on_tag_id"
remove_index :reviews, name: "index_reviews_on_library_deck_id"
remove_index :user_social_links, name: "index_user_social_links_on_user_id"
remove_index :user_social_links, name: "index_user_social_links_on_user_id_and_social_provider_id"
remove_index :notes, name: "trgm_idx_notes_back_side"
remove_index :notes, name: "trgm_idx_notes_front_side"
remove_index :decks, name: "idx_v2_decks_ancestry_pattern"
remove_index :deck_counters, name: "index_deck_counters_on_user_id"
remove_index :deck_settings, name: "index_deck_settings_on_folder_id"
remove_index :deck_settings, name: "index_deck_settings_on_user_id"
remove_index :decks, name: "index_decks_on_ancestry"
remove_index :decks, name: "index_decks_on_category_id"
remove_index :decks, name: "index_decks_on_cloned_from_id"
remove_index :decks, name: "index_decks_on_state"
remove_index :decks, name: "index_decks_on_user_id"
remove_index :motor_alert_locks, name: "index_motor_alert_locks_on_alert_id"
remove_index :motor_alerts, name: "index_motor_alerts_on_query_id"
remove_index :motor_alerts, name: "index_motor_alerts_on_updated_at"
remove_index :motor_note_tag_tags, name: "index_motor_note_tag_tags_on_tag_id"
remove_index :motor_reminders, name: "index_motor_reminders_on_scheduled_at"
remove_index :reviews, name: "index_reviews_on_deck_id"
remove_index :reviews, name: "index_reviews_on_user_id"
remove_index :solid_queue_recurring_tasks, name: "index_solid_queue_recurring_tasks_on_static"
remove_index :decks, name: "index_v2_decks_on_public_state_and_visibility"
remove_index :motor_notes, name: "motor_notes_author_id_author_type_index"
remove_index :motor_notes, name: "motor_notes_record_id_record_type_index"
remove_index :motor_notifications, name: "motor_notifications_recipient_id_recipient_type_index"
remove_index :motor_notifications, name: "motor_notifications_record_id_record_type_index"
remove_index :motor_reminders, name: "motor_reminders_author_id_author_type_index"
remove_index :motor_reminders, name: "motor_reminders_recipient_id_recipient_type_index"
remove_index :motor_reminders, name: "motor_reminders_record_id_record_type_index"
remove_index :decks, name: "v2_test_decks_index"
Relation Size
library_notes 104 GB
card_progresses 88.8 GB
library_cards 76.2 GB
library_note_fields 65.7 GB
decks 17.2 GB
notes v2 15.8 GB
attachments v2 9.12 GB
library_note_fields_pkey 8.74 GB
users 7.54 GB
solid_queue_jobs 6.5 GB
idx_library_note_id_on_library_note_fields 6.01 GB
users_new 5.73 GB
deck_counters 5.45 GB
deck_settings 5.05 GB
library_notes_pkey 4.58 GB
library_cards_pkey 4.37 GB
library_cards_library_note_id_idx 4.18 GB
card_attachments 2.44 GB
card_progresses_pkey 2.36 GB
library_templates 2.23 GB
attachments_pkey v2 1.97 GB
idx_library_card_id_on_card_progresses 1.95 GB
idx_library_note_id_on_card_progresses 1.9 GB
library_decks 1.63 GB
idx_library_deck_id_on_library_cards 1.4 GB
library_models 1.29 GB
idx_library_deck_id_on_library_notes 1.21 GB
idx_deck_id_on_library_notes 1.2 GB
idx_parent_id_on_library_notes 1.17 GB
index_decks_on_sharing_token 1.11 GB
deck_counters_pkey 1.04 GB
index_deck_counters_on_deck_id 1.03 GB
card_progresses v2 924 MB
index_devices_on_user_id_and_firebase_token 885 MB
deck_settings_pkey 864 MB
index_deck_settings_on_deck_id 862 MB
decks_pkey 860 MB
idx_deck_id_on_card_progresses 842 MB
note_attachments v2 808 MB
devices 792 MB
idx_user_id_on_card_progresses 780 MB
events 669 MB
search_queries 667 MB
index_devices_on_firebase_token UNUSED 664 MB
index_decks_on_ancestry UNUSED 623 MB
idx_users_analytics_id 592 MB
index_users_on_analytics_id 592 MB
users_new_analytics_id_idx UNUSED 581 MB
ai_note_templates 503 MB
index_notes_on_id_asc_and_deck_id v2 461 MB
notes_pkey v2 461 MB
index_attachments_on_deck_id v2 UNUSED 459 MB
index_deck_counters_on_user_id UNUSED 427 MB
streaks 364 MB
index_decks_on_anki_deck_id UNUSED 355 MB
index_users_on_username 343 MB
users_new_username_idx 327 MB
index_decks_on_deleted_by_user_at_and_user_id 326 MB
idx_users_qon_id 310 MB
index_decks_on_library_deck_id 308 MB
index_deck_settings_on_user_id UNUSED 298 MB
index_decks_on_user_id UNUSED 296 MB
index_solid_queue_jobs_on_active_job_id 282 MB
index_users_on_id_and_timezone_offset 277 MB
index_solid_queue_jobs_for_filtering 274 MB
index_decks_on_deck_import_id UNUSED 267 MB
index_devices_on_device_id 262 MB
library_templates_pkey 255 MB
note_attachments_pkey v2 252 MB
index_users_on_uid_and_provider 251 MB
index_solid_queue_jobs_for_alerting UNUSED 230 MB
no_overlapping_streaks 228 MB
index_v2_note_attachments_on_note_id_and_deck_id v2 UNUSED 191 MB
search_queries_pkey 186 MB
users_new_id_timezone_offset_idx UNUSED 182 MB
index_note_attachments_on_attachment_id v2 UNUSED 177 MB
events_pkey 172 MB
index_events_on_user_id 169 MB
streaks_pkey 169 MB
card_attachments_pkey 164 MB
devices_pkey 163 MB
users_pkey 163 MB
index_users_on_email 158 MB
idx_lower_email 157 MB
text_to_speeches 154 MB
solid_queue_jobs_pkey 151 MB
index_solid_queue_jobs_on_finished_at 150 MB
index_card_attachments_on_library_note_field_id 150 MB
index_solid_queue_processes_on_last_heartbeat_at 132 MB
users_new_pkey 131 MB
index_library_templates_on_library_deck_id UNUSED 131 MB
index_library_decks_on_name UNUSED 126 MB
index_library_templates_on_original_anki_id UNUSED 122 MB
users_new_uid_provider_idx 120 MB
users_new_email_idx UNUSED 115 MB
index_search_queries_on_user_id 111 MB
users_new_lower_idx UNUSED 109 MB
note_text_to_speeches 104 MB
index_notes_on_deck_id v2 103 MB
auth_providers 95.5 MB
index_search_queries_on_library_deck_id UNUSED 85.4 MB
index_users_on_country_code 75.6 MB
library_decks_pkey 74.1 MB
index_auth_providers_on_provider_and_uid 69.2 MB
idx_users_stripe_customer_id 63.2 MB
index_streaks_on_user_id 62.1 MB
index_card_attachments_on_deck_id UNUSED 60 MB
streak_day_freezes 58.6 MB
index_note_attachments_on_deck_id v2 UNUSED 56.5 MB
index_text_to_speeches_on_text_and_language 55.8 MB
index_library_decks_on_user_id 55 MB
index_card_attachments_on_user_id 53.6 MB
index_ai_note_templates_on_user_id 49.2 MB
index_solid_queue_jobs_on_class_name UNUSED 44.7 MB
index_card_progresses_on_deck_id_and_user_id_and_note_id v2 UNUSED 44.1 MB
index_auth_providers_on_user_id_and_provider 41.9 MB
users_new_country_code_idx UNUSED 40.8 MB
subscriptions 38.5 MB
card_progresses_user_id_id_idx v2 UNUSED 35.8 MB
idx_card_progresses_deck_id_id v2 UNUSED 35.8 MB
card_progresses_pkey v2 35.7 MB
index_streak_day_freezes_on_user_id_and_freeze_date 34.9 MB
idx_v2_cp v2 UNUSED 34.6 MB
folders 32.2 MB
ai_note_templates_pkey 31.8 MB
index_library_decks_on_deck_import_id UNUSED 30.5 MB
index_streak_day_freezes_on_streak_id_and_freeze_date 29.7 MB
motor_audits 29.7 MB
deck_imports 29.7 MB
app_ratings 29.2 MB
index_library_decks_on_category UNUSED 29.1 MB
note_text_to_speeches_pkey 26.2 MB
deck_exports 25.4 MB
index_card_progresses_on_note_id v2 UNUSED 25 MB
index_note_text_to_speeches_on_note_id 22.8 MB
index_streaks_on_user_id_and_active 22.7 MB
auth_providers_pkey 22 MB
index_library_decks_on_category_id UNUSED 21.4 MB
streak_day_freezes_pkey 20 MB
index_solid_queue_claimed_executions_on_process_id_and_job_id 17.8 MB
subscriptions_pkey 16.5 MB
deck_collaborators v2 16.3 MB
library_models_pkey 15.7 MB
text_to_speeches_pkey 14.8 MB
index_streak_day_freezes_on_streak_id 12.5 MB
index_subscriptions_on_user_id 10.8 MB
index_streak_day_freezes_on_user_id 10.8 MB
deck_revisions v2 10.2 MB
index_library_models_on_library_deck_id UNUSED 9.8 MB
solid_queue_claimed_executions_pkey 9.56 MB
solid_queue_ready_executions_pkey 9.55 MB
index_solid_queue_claimed_executions_on_job_id 9.55 MB
index_solid_queue_ready_executions_on_job_id 9.53 MB
index_folders_on_user_id_and_position 8.74 MB
index_v2_card_progresses_on_user_id_and_frozen v2 UNUSED 8.02 MB
index_deck_collaborators_on_user_id_and_deck_id v2 7.91 MB
index_solid_queue_poll_all 7.77 MB
deck_collaborators_pkey v2 7.08 MB
motor_auditable_index 7.02 MB
index_app_ratings_on_user_id 6.68 MB
app_ratings_pkey 6.55 MB
tmp_mapping_decks 5.84 MB
deck_collaborators 5.32 MB
folders_pkey 5.09 MB
index_deck_collaborators_on_deck_id v2 4.28 MB
deck_imports_pkey 3.84 MB
index_deck_exports_on_deck_id UNUSED 3.23 MB
index_subscriptions_on_product_id 3.02 MB
deck_exports_pkey 2.98 MB
index_motor_audits_on_created_at UNUSED 2.92 MB
motor_audits_pkey 2.92 MB
index_deck_imports_on_user_id 2.22 MB
index_deck_exports_on_user_id UNUSED 2.13 MB
idx_users_reset_password_token_not_null 2.02 MB
index_motor_audits_on_request_uuid UNUSED 1.88 MB
deck_collaborators_pkey 1.74 MB
index_deck_collaborators_on_deck_id 1.33 MB
tmp_mismatched_notes 1.3 MB
index_deck_collaborators_on_collaborator_id 1.23 MB
users_new_reset_password_token_idx UNUSED 1.2 MB
index_solid_queue_poll_by_queue 1.15 MB
motor_auditable_user_index UNUSED 1.05 MB
motor_auditable_associated_index 1020 KB
index_solid_queue_processes_on_supervisor_id 632 KB
solid_queue_processes 624 KB
index_solid_queue_processes_on_name_and_supervisor_id 328 KB
solid_queue_processes_pkey 328 KB
taggings 312 KB
deck_revisions_pkey v2 264 KB
index_solid_queue_blocked_executions_for_maintenance 248 KB
solid_queue_failed_executions 232 KB
index_solid_queue_semaphores_on_key_and_value 216 KB
index_solid_queue_blocked_executions_for_release 208 KB
solid_queue_blocked_executions 208 KB
taggings_idx 200 KB
index_deck_revisions_on_user_id v2 160 KB
taggings_idy UNUSED 160 KB
taggings_taggable_context_idx UNUSED 144 KB
categories 136 KB
index_solid_queue_semaphores_on_key 112 KB
index_taggings_on_taggable_type_and_taggable_id 112 KB
all_settings 96 KB
index_solid_queue_blocked_executions_on_job_id 80 KB
index_solid_queue_failed_executions_on_job_id 80 KB
solid_queue_blocked_executions_pkey 80 KB
solid_queue_failed_executions_pkey 80 KB
taggings_pkey 80 KB
index_taggings_on_taggable_id UNUSED 72 KB
index_solid_queue_semaphores_on_expires_at 64 KB
motor_resources 64 KB
reviews 64 KB
schema_migrations 64 KB
solid_queue_semaphores_pkey 64 KB
admin_users 48 KB
ar_internal_metadata 48 KB
ar_internal_metadata v2 48 KB
card_presets 48 KB
guides 48 KB
motor_api_configs 48 KB
motor_configs 48 KB
motor_dashboards 48 KB
motor_forms 48 KB
motor_queries 48 KB
motor_taggable_tags 48 KB
motor_tags 48 KB
pg_dist_cleanup_backup 48 KB
pg_dist_node 48 KB
pg_dist_node_metadata 48 KB
pg_dist_object 48 KB
pg_dist_rebalance_strategy 48 KB
social_providers 48 KB
solid_queue_semaphores 48 KB
tags 48 KB
user_social_links 48 KB
index_taggings_on_context UNUSED 40 KB
index_taggings_on_tag_id UNUSED 40 KB
index_taggings_on_taggable_type UNUSED 40 KB
index_taggings_on_tagger_id UNUSED 40 KB
index_taggings_on_tagger_id_and_tagger_type UNUSED 40 KB
index_taggings_on_tagger_type_and_tagger_id UNUSED 40 KB
index_taggings_on_tenant UNUSED 40 KB
pg_dist_clock_logical_seq 40 KB
pg_dist_local_group 40 KB
solid_queue_claimed_executions 40 KB
solid_queue_ready_executions 32 KB
solid_queue_scheduled_executions 32 KB
solid_queue_pauses 24 KB
admin_users_pkey 16 KB
ar_internal_metadata_pkey v2 16 KB
ar_internal_metadata_pkey 16 KB
card_presets_pkey 16 KB
categories_pkey 16 KB
guides_pkey 16 KB
index_card_presets_on_user_id UNUSED 16 KB
index_categories_on_ancestry 16 KB
index_categories_on_key 16 KB
index_motor_configs_on_key 16 KB
index_motor_configs_on_updated_at 16 KB
index_motor_dashboards_on_updated_at UNUSED 16 KB
index_motor_forms_on_updated_at 16 KB
index_motor_queries_on_updated_at UNUSED 16 KB
index_motor_resources_on_name 16 KB
index_motor_resources_on_updated_at 16 KB
index_motor_taggable_tags_on_tag_id UNUSED 16 KB
index_reviews_on_library_deck_id UNUSED 16 KB
index_reviews_on_user_id UNUSED 16 KB
index_social_providers_on_provider 16 KB
index_solid_queue_dispatch_all 16 KB
index_solid_queue_pauses_on_queue_name 16 KB
index_solid_queue_scheduled_executions_on_job_id 16 KB
index_tags_on_name 16 KB
index_user_social_links_on_social_provider_id 16 KB
index_user_social_links_on_user_id UNUSED 16 KB
index_user_social_links_on_user_id_and_social_provider_id UNUSED 16 KB
motor_api_configs_name_unique_index 16 KB
motor_api_configs_pkey 16 KB
motor_configs_pkey 16 KB
motor_dashboards_pkey 16 KB
motor_dashboards_title_unique_index 16 KB
motor_forms_name_unique_index 16 KB
motor_forms_pkey 16 KB
motor_polymorphic_association_tag_index 16 KB
motor_queries_name_unique_index 16 KB
motor_queries_pkey 16 KB
motor_resources_pkey 16 KB
motor_taggable_tags_pkey 16 KB
motor_tags_name_unique_index 16 KB
motor_tags_pkey 16 KB
reviews_pkey 16 KB
schema_migrations_pkey 16 KB
social_providers_pkey 16 KB
solid_queue_pauses_pkey 16 KB
solid_queue_scheduled_executions_pkey 16 KB
tags_pkey 16 KB
trgm_idx_notes_back_side v2 UNUSED 16 KB
trgm_idx_notes_front_side v2 UNUSED 16 KB
user_social_links_pkey 16 KB
cards 8 KB
cards_pkey 8 KB
chunk columnar_internal 8 KB
chunk_group_pkey columnar_internal 8 KB
chunk_pkey columnar_internal 8 KB
deck_counters_pkey v2 8 KB
deck_settings v2 8 KB
deck_settings_pkey v2 8 KB
decks v2 8 KB
decks_pkey v2 8 KB
idx_v2_decks_ancestry_pattern v2 UNUSED 8 KB
index_deck_counters_on_deck_id_and_user_id v2 8 KB
index_deck_counters_on_user_id v2 UNUSED 8 KB
index_deck_settings_on_deck_id v2 8 KB
index_deck_settings_on_folder_id v2 UNUSED 8 KB
index_deck_settings_on_user_id v2 UNUSED 8 KB
index_decks_on_ancestry v2 UNUSED 8 KB
index_decks_on_category_id v2 UNUSED 8 KB
index_decks_on_cloned_from_id v2 UNUSED 8 KB
index_decks_on_state v2 UNUSED 8 KB
index_decks_on_user_id v2 UNUSED 8 KB
index_motor_alert_locks_on_alert_id UNUSED 8 KB
index_motor_alert_locks_on_alert_id_and_lock_timestamp 8 KB
index_motor_alerts_on_query_id UNUSED 8 KB
index_motor_alerts_on_updated_at UNUSED 8 KB
index_motor_note_tag_tags_on_tag_id UNUSED 8 KB
index_motor_reminders_on_scheduled_at UNUSED 8 KB
index_reviews_on_deck_id v2 UNUSED 8 KB
index_reviews_on_user_id v2 UNUSED 8 KB
index_solid_queue_recurring_executions_on_job_id 8 KB
index_solid_queue_recurring_executions_on_task_key_and_run_at 8 KB
index_solid_queue_recurring_tasks_on_key 8 KB
index_solid_queue_recurring_tasks_on_static UNUSED 8 KB
index_v2_decks_on_public_state_and_visibility v2 UNUSED 8 KB
motor_alert_locks 8 KB
motor_alert_locks_pkey 8 KB
motor_alerts 8 KB
motor_alerts_name_unique_index 8 KB
motor_alerts_pkey 8 KB
motor_note_tag_tags_pkey 8 KB
motor_note_tags 8 KB
motor_note_tags_name_unique_index 8 KB
motor_note_tags_note_id_tag_id_index 8 KB
motor_note_tags_pkey 8 KB
motor_notes 8 KB
motor_notes_author_id_author_type_index UNUSED 8 KB
motor_notes_pkey 8 KB
motor_notes_record_id_record_type_index UNUSED 8 KB
motor_notifications 8 KB
motor_notifications_pkey 8 KB
motor_notifications_recipient_id_recipient_type_index UNUSED 8 KB
motor_notifications_record_id_record_type_index UNUSED 8 KB
motor_reminders 8 KB
motor_reminders_author_id_author_type_index UNUSED 8 KB
motor_reminders_pkey 8 KB
motor_reminders_recipient_id_recipient_type_index UNUSED 8 KB
motor_reminders_record_id_record_type_index UNUSED 8 KB
options_pkey columnar_internal 8 KB
pg_dist_authinfo 8 KB
pg_dist_cleanup 8 KB
pg_dist_partition 8 KB
pg_dist_poolinfo 8 KB
pg_dist_schema 8 KB
pg_dist_shard 8 KB
pg_dist_transaction 8 KB
reviews v2 8 KB
reviews_pkey v2 8 KB
schema_migrations v2 8 KB
schema_migrations_pkey v2 8 KB
solid_queue_recurring_executions 8 KB
solid_queue_recurring_executions_pkey 8 KB
solid_queue_recurring_tasks 8 KB
solid_queue_recurring_tasks_pkey 8 KB
stripe_first_row_number_idx columnar_internal 8 KB
stripe_pkey columnar_internal 8 KB
v2_test_decks_index v2 UNUSED 8 KB
chunk_group columnar_internal 0 Bytes
deck_counters v2 0 Bytes
motor_note_tag_tags 0 Bytes
options columnar_internal 0 Bytes
pg_dist_colocation 0 Bytes
pg_dist_placement 0 Bytes
stripe columnar_internal 0 Bytes