时间:2021-07-01 10:21:17 帮助过:2人阅读
LIMIT语句优化
原语句:SELECT * FROM table ORDER BY id DESC LIMIT 190000,10000
优化后:SELECT * FROM table WHERE id < (SELECT MIN(alias.id) FROM (SELECT id FROM table ORDER BY id DESC LIMIT 190000) alias) ORDER BY id DESC LIMIT 10000
SQL优化
标签: