Field Notes · 22 January 2026
Indexes After a Refactor: What to Rebuild and What to Drop
Post-migration index hygiene so you do not carry every historical covering index into the new schema shape.
Teams often clone every old index onto new tables “just in case.” Write amplification rises; vacuum and maintenance windows stretch; nobody remembers why idx_orders_legacy_5 exists.
After the cutover
- Capture the new top queries for two weeks
- Mark indexes with near-zero scans in your engine’s statistics
- Drop candidates only after a freeze period and a rollback script
Partial and expression indexes
If the refactor introduced status enums or JSON fields, revisit whether a partial index matches the new predicates. Blind copies of old indexes rarely fit new filters.
When refactoring and performance work overlap, we often combine a short Query Performance Review in the final week of a Database Refactoring engagement so the new model is not born already overweight.