When the optimizer picks the wrong index: statistics, histograms, and hints
September 21, 2026 · QueryKings
The index exists, EXPLAIN ignores it, and the query takes four seconds. Here is how InnoDB's cardinality estimates go stale, what histograms fix and what they do not, and the order to try ANALYZE TABLE, optimizer hints, and FORCE INDEX before you rewrite the query.
Read more