LIMIT 50 OFFSET 45000 reads forty-five thousand rows and discards them, which is fine until somebody paginates to the end. The row-value comparison is the part that trips…
An index containing every column the query touches means the table is never read, and the plan says Using index. The column order is the design: equality predicates…
The optimiser chose a plan based on an estimate of 200 rows where the real answer was 8,000, and only the actual execution shows the difference. The gap…
InnoDB full-text ignores words shorter than three characters and words appearing in more than half the rows, and both are configurable only at the server level. Changing innodb_ft_min_token_size…
Forcing an index makes one query faster today and freezes a decision that the optimiser would otherwise revisit as the data changes. A hint is appropriate as a…
The optimiser assumes an even distribution for a non-indexed column, which is wrong for a status column where one value is ninety per cent of the rows. The…