Window functions are computed after WHERE and GROUP BY, so a predicate on the result has nowhere to go in the same query block. Putting the restriction inside…
Indexing an expression is not possible directly, so a query filtering on YEAR(placed_at) or on a JSON path scans the table regardless of what indexes exist. The optimiser…
When two rows compare equal under the window’s ORDER BY, the numbering between them is arbitrary and MySQL is free to choose differently on the next execution. The…
Six applications with six database users means six sets of grants maintained by hand, and the reporting tool ends up with write access because copying an existing user…
Two workers selecting the next unprocessed row with FOR UPDATE serialise — the second waits for the first — so adding workers adds no throughput at all. SKIP…
Comparing a row with the previous one — time between orders, change since the last reading — was a self join on a correlated subquery finding the preceding…
A common table expression reads like a named intermediate result, and in MySQL 8.0 it may be merged into the outer query or materialised into a temporary table…