Skip to content

Drop unused database indexes - #664

Open
tdroxler wants to merge 1 commit into
masterfrom
optimize-db-size
Open

Drop unused database indexes#664
tdroxler wants to merge 1 commit into
masterfrom
optimize-db-size

Conversation

@tdroxler

@tdroxler tdroxler commented Jun 19, 2026

Copy link
Copy Markdown
Member

Remove all unused indexes from our prod database.

You can find the usage of all our indexes for our:

  1. WriteOnly instance
  2. ReadOnly
  3. Fallback

unused_indexes_report-fallback.txt
unused_indexes_report-replica.txt
unused_indexes_report.txt

main + replica have the same unused indexes, fallback differ a bit, which makes sense since fallback instance is used for a limited amount of endpoints.

I heavily tested it with the EB, everything is smooth, but I made this revert PR if anything goes terribly wrong.

Migration 12 drops 21 unused indexes, from the report, it can reclaim ~20 Go per DB instance and ~60 Go across main, replica, and fallback.

resolves #631

@tdroxler
tdroxler requested a review from h0ngcha0 June 19, 2026 13:09
@tdroxler tdroxler mentioned this pull request Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Check for unused index

1 participant