首页 > 代码库 > mysql limit性能问题

mysql limit性能问题

offset大的时候的比较

 

SELECT * FROM persons LIMIT 200000,10;

耗时0.078s

 

SELECT *
FROM persons WHERE id>=(
SELECT id FROM persons ORDER BY id LIMIT 200000,1
) LIMIT 10

耗时0.109s

 

why?