mysql百万数据分页查询速度

百万数据测试

[SQL] SELECT * FROM evaluate_info LIMIT 0,50;
受影响的行: 0
时间: 0.080ms

[SQL] SELECT * FROM evaluate_info LIMIT 500000,50;
受影响的行: 0
时间: 0.291ms

[SQL] SELECT * FROM evaluate_info LIMIT 1000000,50;
受影响的行: 0
时间: 0.557ms

[SQL] SELECT * FROM evaluate_info LIMIT 1500000,50;
受影响的行: 0
时间: 0.821ms

[SQL] SELECT * FROM evaluate_info LIMIT 2000000,50;
受影响的行: 0
时间: 1.130ms

SELECT SQL_CALC_FOUND_ROWS id,otherid,type,uid,pid,logid,agreementid,content,score,isauto,addtime,pjtime,status,scoretag,node,orderid FROM evaluate_info  WHERE  `status` = '1'  AND  `type` in (1,2,7,15)  AND  `isdel` = '0'  ORDER BY id desc LIMIT 24000,1000
耗时:5835ms

优化方案:
select * from table where id > 上一条记录的id limit 199999010

 

 

 

posted @ 2018-05-17 15:00  幸福的波波肠  阅读(252)  评论(0编辑  收藏  举报