Eliminate redundant and duplicate indexes
An index on (courier_id) is redundant when an index on (courier_id, booked_at) already exists, the composite serves both. Find the overlaps in the catalog and drop the dead weight off every write.
Problem
What you're actually looking at
The symptom as it shows up on a real server.
Redundant indexes are pure cost: every INSERT/UPDATE/DELETE maintains all of them, they take cache and disk, and they slow VACUUM. A single-column index is often already covered by a composite index that leads with the same column.
Meridian's waybill_lines has both idx_wl_courier on (courier_id) and idx_wl_courier_booked on (courier_id, booked_at). The single-column index is redundant, the composite can serve any query the narrow one can.
Simple terms
Every index has to be kept up to date on each INSERT, UPDATE and DELETE, so an index nobody needs is pure cost. A single-column index on (courier_id) is usually redundant once an index on (courier_id, booked_at) exists, because the wider one is sorted by courier_id first and can already do everything the narrow one could. Find those overlaps in the catalog and drop the dead weight off every write.
Full runbook for this incident
- The full identify checklist, the exact signals that tell you it's this incident
- Every diagnostic query; lab output is attached only to the steps we actually captured
- The resolution path and the pitfalls that make it worse
- Mitigation steps to stop it recurring, plus a verify-you're-done query
Card required. Cancel before day 7 and you are not charged.
More in this category
Other Indexing runbooks
Neighbouring incidents that share the same diagnostic surface.
Connected
How this connects to the rest of the library
A live view of this page's real cross-references, what explains it, what fixes it, what to tune, and where to go next. Every link is an authored relationship, not a guess.
Fixes these errors
Need the full procedure?
Pro runbooks finish the incident path
Free runbooks teach the shape. Pro opens the full step transcript, edge cases, and prevention depth.