How we dropped eleven indexes and made writes 30 percent faster. Databases are usually the last place teams look when an application slows down, and the first place the problem turns out to be. This post is a practical walk through how we find and fix those problems.

Look at the plan first
Every slow query investigation starts with EXPLAIN ANALYZE. It shows what the planner expected, what actually happened, and where the two diverged, which is almost always where the fix is.
- Read the query plan before adding an index.
- Backfill in batches, never in one transaction.
- Drop indexes nobody uses.
- Test migrations against a copy of production data.
The migration we ran
Schema changes on a busy table need care. We add the new column, backfill in batches, switch reads, switch writes, and only then drop the old column, with a deploy between each step.
Premature optimization is the root of all evil.
Donald Knuth, Structured Programming with go to Statements, 1974
Quick takeaway
The query plan is the source of truth.
Keeping it fast
Explain first
Read the plan before changing anything.
Expand and contract
Migrate in small, reversible steps.
Prune indexes
Remove the ones nobody reads.
Indexes are not free. Each one slows writes and takes memory, so we review unused indexes every quarter and drop the ones the statistics say nobody reads.
Wrapping up
We will revisit this in six months with fresh numbers. If the results change, we will update the post and note what changed at the end.
Great post. Did you measure the impact before and after, or is this mostly from experience?
I would push back a little on the second section. In our monorepo the trade-off went the other way.
Would love a follow-up on how you test this in CI.
It should work without shell access, you just lose the command-line shortcuts.
How does this hold up on older Safari versions? That is where we always get burned.
Our accessibility audit flagged exactly this last month. I wish I had read this first.
Glad it helped!
We run this in production at a fairly large scale and can confirm the caveats are real.