mysql数据库查询优化
2022-11-11 本文已影响0人
顶尖少爷
一般的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