Mysql Limit paging query optimization details, mysqllimit
Select * from table LIMIT 5, 10; # return data in rows 6-15 select * from table LIMIT 5; # Return the first 5 rows select * from table LIMIT; # Return the first 5 rows
Let's write pages.
Physical Paging
Select * from table LIMIT (current page-1) * number of entries per page, number of entries per page;
MySQL Limit simple optimization. md
Is it the same as taking the first 90000 records, the traditional method or the transformation method?
The traditional method is to take the first 90001 records, take the largest ID value as the starting ID, and then use it to quickly locate the next 100 records.
The transformation method is to take only the last one of the 90000 records, and then take the ID value as the starting marker to locate the next 100 records.
Conventional execution result. 100 rows in set (0.23) sec
Transformation Method execution result. 100 rows in set (0.19) sec
-- Transformation Method-> abbreviated method SELECT * FROM table where id> = (select id from table order by id limit 90000,1) limit 100;
The above is a detailed description of Mysql Limit paging query optimization introduced by xiaobian. I hope it will be helpful to you. If you have any questions, please leave a message and I will reply to you in a timely manner. Thank you very much for your support for the help House website!