Eager loading an entire relation to display one field from the most recent row is a hydration of every row in that relation, per parent. The result is…
8.0 defaults to utf8mb4_0900_ai_ci and a table converted from 5.7 is almost certainly utf8mb4_general_ci — and joining two columns with different collations cannot use an index on either.…
EXPLAIN reports 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…
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…