mysql 分页查询的优化

select * from yrd_banks where id > (select id from yrd_banks limit 50000,1) GROUP BY id LIMIT 20; 用时 0.012s
select * from yrd_banks GROUP BY id limit 50000,20; 用时 0.030s

同样的查询,时间差距非常大,值得借鉴,而且是数据量不是很大的情况下

原文地址:https://www.cnblogs.com/czb529514/p/7880494.html