Mysql在分页查询的时候,一般我们都是这么查
select * from test limit start,limit;
随着数据量的增大,熟读会越来越慢
我们可以这么优化
SELECT * FROM product WHERE ID > =(select id from product limit 100000, 1) limit 20
或者
SELECT * FROM product a JOIN (select id from product limit 100000, 20) b ON a.id = b.id.id