PgHero

Space

Database Size: 499 GB

75 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 :solid_queue_jobs, name: "index_solid_queue_jobs_for_alerting"
remove_index :decks, name: "index_decks_on_deck_import_id"
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_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 :solid_queue_jobs, name: "index_solid_queue_jobs_on_class_name"
remove_index :note_attachments, name: "index_note_attachments_on_deck_id"
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_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 :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.9 GB
library_cards 76.2 GB
library_note_fields 65.7 GB
decks 17.2 GB
notes v2 15.8 GB
solid_queue_jobs 10.4 GB
attachments v2 9.12 GB
library_note_fields_pkey 8.74 GB
users 8.72 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
tmp_notes 1.3 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.04 GB
index_users_on_analytics_id 1020 MB
index_devices_on_user_id_and_firebase_token 951 MB
card_progresses v2 924 MB
devices 884 MB
deck_settings_pkey 865 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
idx_user_id_on_card_progresses 780 MB
index_devices_on_firebase_token UNUSED 695 MB
events 671 MB
search_queries 667 MB
index_decks_on_ancestry UNUSED 623 MB
users_new_analytics_id_idx UNUSED 581 MB
ai_note_templates 555 MB
index_users_on_username 534 MB
index_users_on_id_and_timezone_offset 514 MB
idx_users_qon_id 494 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 412 MB
index_solid_queue_jobs_on_active_job_id 373 MB
index_solid_queue_jobs_for_filtering 368 MB
index_decks_on_anki_deck_id UNUSED 356 MB
index_devices_on_device_id 329 MB
users_new_username_idx 327 MB
index_decks_on_deleted_by_user_at_and_user_id 326 MB
index_decks_on_library_deck_id 308 MB
index_solid_queue_jobs_for_alerting UNUSED 306 MB
index_deck_settings_on_user_id UNUSED 298 MB
index_decks_on_user_id UNUSED 297 MB
index_users_on_uid_and_provider 287 MB
index_decks_on_deck_import_id UNUSED 267 MB
no_overlapping_streaks 267 MB
library_templates_pkey 255 MB
note_attachments_pkey v2 252 MB
index_users_on_email 208 MB
idx_lower_email 208 MB
text_to_speeches 208 MB
solid_queue_jobs_pkey 201 MB
streaks_pkey 200 MB
index_solid_queue_jobs_on_finished_at 198 MB
search_queries_pkey 193 MB
users_pkey 193 MB
index_v2_note_attachments_on_note_id_and_deck_id v2 UNUSED 191 MB
events_pkey 190 MB
users_new_id_timezone_offset_idx UNUSED 182 MB
index_events_on_user_id 181 MB
index_note_attachments_on_attachment_id v2 UNUSED 177 MB
devices_pkey 175 MB
card_attachments_pkey 164 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 131 MB
note_text_to_speeches 127 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
index_users_on_country_code 118 MB
index_search_queries_on_user_id 115 MB
users_new_email_idx UNUSED 115 MB
users_new_lower_idx UNUSED 109 MB
auth_providers 107 MB
index_notes_on_deck_id v2 103 MB
index_search_queries_on_library_deck_id UNUSED 88.2 MB
index_text_to_speeches_on_text_and_language 84.5 MB
idx_users_stripe_customer_id 81.2 MB
index_auth_providers_on_provider_and_uid 77.4 MB
library_decks_pkey 74.1 MB
index_streaks_on_user_id 70.4 MB
idx_tmp_notes_id 60.9 MB
index_card_attachments_on_deck_id 60 MB
index_solid_queue_jobs_on_class_name UNUSED 59.7 MB
streak_day_freezes 59.5 MB
index_ai_note_templates_on_user_id 58.6 MB
index_note_attachments_on_deck_id v2 UNUSED 56.5 MB
index_library_decks_on_user_id 55 MB
index_card_attachments_on_user_id 53.6 MB
index_auth_providers_on_user_id_and_provider 47.7 MB
index_card_progresses_on_deck_id_and_user_id_and_note_id v2 UNUSED 44.1 MB
note_text_to_speeches_pkey 42.3 MB
users_new_country_code_idx UNUSED 40.8 MB
subscriptions 38.5 MB
folders 38.2 MB
ai_note_templates_pkey 38.1 MB
index_note_text_to_speeches_on_note_id 35.9 MB
card_progresses_user_id_id_idx v2 UNUSED 35.8 MB
idx_card_progresses_deck_id_id v2 UNUSED 35.8 MB
index_streak_day_freezes_on_user_id_and_freeze_date 35.8 MB
card_progresses_pkey v2 35.7 MB
idx_v2_cp v2 UNUSED 34.6 MB
app_ratings 33 MB
index_streak_day_freezes_on_streak_id_and_freeze_date 31.8 MB
index_library_decks_on_deck_import_id UNUSED 30.5 MB
motor_audits 29.9 MB
deck_imports 29.7 MB
index_library_decks_on_category UNUSED 29.1 MB
deck_exports 26.9 MB
index_card_progresses_on_note_id v2 UNUSED 25 MB
index_streaks_on_user_id_and_active 24.5 MB
auth_providers_pkey 24.3 MB
text_to_speeches_pkey 22.1 MB
streak_day_freezes_pkey 21.7 MB
index_library_decks_on_category_id UNUSED 21.4 MB
subscriptions_pkey 18.3 MB
deck_collaborators v2 17.9 MB
index_solid_queue_claimed_executions_on_process_id_and_job_id 17.8 MB
library_models_pkey 15.7 MB
index_folders_on_user_id_and_position 14.8 MB
index_streak_day_freezes_on_streak_id 13.7 MB
deck_revisions v2 11.4 MB
index_streak_day_freezes_on_user_id 11.4 MB
index_subscriptions_on_user_id 11.3 MB
index_library_models_on_library_deck_id UNUSED 9.8 MB
index_deck_collaborators_on_user_id_and_deck_id v2 9.64 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
deck_collaborators_pkey v2 8.81 MB
index_app_ratings_on_user_id 8.58 MB
app_ratings_pkey 8.54 MB
folders_pkey 8.54 MB
index_v2_card_progresses_on_user_id_and_frozen v2 UNUSED 8.02 MB
index_solid_queue_poll_all 7.77 MB
motor_auditable_index 7.05 MB
tmp_mapping_decks 5.84 MB
deck_collaborators 5.32 MB
index_deck_collaborators_on_deck_id v2 5.2 MB
deck_imports_pkey 3.84 MB
deck_exports_pkey 3.69 MB
idx_users_reset_password_token_not_null 3.63 MB
index_deck_exports_on_deck_id UNUSED 3.39 MB
index_subscriptions_on_product_id 3.3 MB
index_motor_audits_on_created_at UNUSED 2.94 MB
motor_audits_pkey 2.94 MB
index_deck_exports_on_user_id UNUSED 2.72 MB
index_deck_imports_on_user_id 2.22 MB
index_motor_audits_on_request_uuid UNUSED 1.9 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 1.01 MB
index_solid_queue_processes_on_supervisor_id 632 KB
index_solid_queue_processes_on_name_and_supervisor_id 328 KB
solid_queue_failed_executions 328 KB
solid_queue_processes_pkey 328 KB
taggings 312 KB
deck_revisions_pkey v2 296 KB
index_solid_queue_blocked_executions_for_maintenance 248 KB
index_solid_queue_semaphores_on_key_and_value 216 KB
index_solid_queue_blocked_executions_for_release 208 KB
taggings_idx 200 KB
index_deck_revisions_on_user_id v2 176 KB
taggings_idy 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
solid_queue_processes 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
user_social_links 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
card_presets 56 KB
admin_users 48 KB
ar_internal_metadata 48 KB
ar_internal_metadata v2 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_scheduled_executions 48 KB
tags 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_blocked_executions 32 KB
solid_queue_ready_executions 32 KB
solid_queue_semaphores 32 KB
solid_queue_pauses 24 KB
admin_users_pkey 16 KB
ar_internal_metadata_pkey 16 KB
ar_internal_metadata_pkey v2 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 16 KB
index_user_social_links_on_user_id_and_social_provider_id 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