Remove 2007 Remove 2022 Remove Open Source Remove Strategy
article thumbnail

Revamp MySQL Query Optimization and Overcome Slowness of ORDER BY with LIMIT Queries

Percona

However, for 16 years since 2007, the MySQL query optimizer has had a “bug” that not only makes LIMIT 1 slower than LIMIT 10 but can also make the former a table scan, which tends to cause problems. You must understand how to use indexes to make sorting cheaper. Looking at this, can you say which is faster: LIMIT 1 or LIMIT 10 ?