Some methods for paging mysql big data ., Mysql DATA Paging
Select * from user limit; this most common method is okay when the data volume is small
When the data volume is greater than, select * from user limit, 10.
First, we need to scan the first records and then retrieve 10 records. Therefore, when the data volume increases, the speed slows down.
Solution:
1. From the business perspective, the limit can only be obtained from the first 70 pages or the first thirty pages. Such as Baidu and Google search ..
2. select * from user where id> 1000000 limit 10;
In this case, the index is used, so it is faster. If the index is insufficient, the data integrity must be ensured, that is, the previous data cannot
Deleted.
If you want to delete the previous data and want to use this method, you can only delete the data logically, for example, adding an is_del Field
3. select id from user limit 1000000, 10;
First, the id is queried and the index is used. Then, the corresponding data is obtained from the id.
Select id, name from user inner join (select id from user limit 1000000, 10;) as tem on tmp. id = user. id;