一般的sql
select * from zombie_log.role_res_log_2022_11_10 ORDER BY id ASC limit 9000,9000;
100w的表中耗时9s
如果表拥有自增id
则可以优化
select * from zombie_log.role_res_log_2022_11_10 where id>9000 ORDER BY id limit 9000;
100w的表耗时2s
一般的sql
select * from zombie_log.role_res_log_2022_11_10 ORDER BY id ASC limit 9000,9000;
100w的表中耗时9s
如果表拥有自增id
则可以优化
select * from zombie_log.role_res_log_2022_11_10 where id>9000 ORDER BY id limit 9000;
100w的表耗时2s
本文标题:mysql数据库查询优化
本文链接:https://www.haomeiwen.com/subject/nsnztdtx.html
网友评论