The Query That Killed My Database: A Postmortem
A single SQL query took down production for twelve minutes. Here is the postmortem on how a correlated subquery with 200k posts became a database killer — and the exact fix that brought execution time from 4 minutes to 3 milliseconds.