A query that was fine at four hundred thousand rows, acceptable at four million, and unusable at twelve.
2023 0.4s 412k order_lines
2024 1.8s 4.1M
2025 11.4s 12.1M
2026 — moved to a projection
nothing about the query changed. no index was dropped,
no plan regressed. it is the same query meeting more
rows, and the growth was linear and visible for three
years.
what was missing: a graph of query duration over time,
which would have made this a scheduled piece of work
rather than an incident.
A query whose cost grows with the data is not a bug and becomes one at a threshold nobody predicts. Graphing the duration of the top twenty queries over months rather than minutes is the missing instrument — every monitoring system shows the last day and the interesting trend is the last year.