LAST_VALUE with an ORDER BY and no frame returns the current row rather than the last one, which is correct by the specification and is never what anybody…
Indexing an expression required adding a generated column and indexing that, which means a schema change and a column nobody wants in a SELECT *. The double parentheses…
A report asking for the top quartile of customers by spend was a subquery computing a count, a second computing a threshold, and arithmetic in PHP. NTILE divides…
The slow log ranks by individual duration, so a query taking two seconds once appears above one taking forty milliseconds two hundred thousand times. Ranking by total time…
The replica was up, accepting connections and serving data from an hour ago. Seconds_Behind_Master reported zero, honestly, and was measuring the wrong thing.
EXPLAIN shows the plan and the optimiser’s estimates, and the estimates are frequently wrong — a query planned for 40 rows that reads 400,000 looks entirely healthy. The…