An expression in a WHERE clause cannot use an index, and a generated column moves the expression somewhere indexable. The automatic substitution is the good part and requires…
A correlated derived table can reference columns from the row it is joined against, which expresses top-N-per-group directly. A window function with ROW_NUMBER reads more clearly and computes…
Storing events as the source of truth gives a perfect audit log and makes every subsequent decision harder, including the ones that seemed unrelated. The GDPR deletion problem…
ROWS counts physical rows and RANGE counts values, so they are identical until two rows share an ordering value. RANGE is the default when a frame is not…
Adding ORDER BY to a window changes what the aggregate means, because it changes the default frame from the whole partition to everything up to the current row.…
SKIP LOCKED lets several workers claim different rows from one table without blocking each other, which is what makes a database usable as a queue. This is genuinely…
MySQL 8.0 changed the default collation, so a table created before an upgrade and one created after cannot be joined on a string column without a conversion. The…