select * from table where order by id limit 500000,500;
优化为
select * from table where id >=(select id from table order by id limit 500000,1) order by id limit 500;