The CloudWatch alarm rds-cur8-cpu-utilization-high (eu-west-2) tripped four times in 24 hours — peaking at 99.2% CPU on a db.t3.large. Not a one-off; a pattern.
LiquidationsTable SELECTs at 0.81 of total DB load. Everything else was below 0.005./admin/liquidations/v2/search taking ~32 seconds.The admin liquidations search eager-loads fees, investments, withdrawals, and documents per row, and orders by requestedAt — and none of those foreign-key columns nor requestedAt are indexed. So every search runs five sequential scans on tables that grow with every payment, investment, and withdrawal. The 32-second responses then produced an impatient retry / clear / re-apply pattern that compounded into 88 requests.
Two earlier hypotheses were ruled out against the request samples: it wasn't a missing debounce (an Apply-Filters button gates refetch), and it wasn't a detail page hitting the search endpoint (every sampled request used seller filters, never an id).
CREATE INDEX CONCURRENTLY, so there's no write lock.The load source was pinned to a single query signature with hard evidence, then indexed away. Follow-ups noted: slim the list-view payload, route admin reads to the idle replica, and retune the alarm threshold (30% → 70%) that was paging on routine admin work.