SELECT SQL_NO_CACHE *FROM softdb_testWHERE id > (SELECT idFROM softdb_testORDER BY id DESCLIMIT 5000000 , 1 )LIMIT 10
softdb_test
表中有1200万的数据,普通limit 分页,30多秒,用这种方法,大概0.4秒,其中主键是id,有索引。
mysql快速翻页查询方法,布布扣,bubuko.com
mysql快速翻页查询方法
原文:http://www.cnblogs.com/lechie/p/3580684.html