Programme I:
1. For the first query, use the Select COUNT (1) from tab where condition to obtain the number of records that meet the criteria $rows
2. Through the front page $page, each page records the number $RPP retrieve the record set
SELECT * from tab where condition limit ($page-1) * $RPP, $RPP
3. Displays all records that return the recordset.
4. Transfer $rows to a later page when the page is transferred.
Programme II:
1. Retrieve the recordset that satisfies the condition
SELECT * from tab where condition
2. Move the pointer to ($page-1) * $RPP
3. Display $RPP Record
==============+======+==============================================+======+======+========
Number of records | Program | Times 1 2 3 4 5 6 7 8 9 0 | Average | Average | Efficiency ratio
==============+======+==============================================+======+======+========
| | first page 2, 1, 1, 2, 1, 1, 2, 2, 1, 2 | 1.3 | |
| One +----------------------------------------------+------+ 1.6 |
10,000 Records when | | Other pages 2, 2, 2, 3, 1, 1, 2, 2, 2, 2 | 1.9 | | 4.8125
+------+----------------------------------------------+------+------+
| Two | Each page 7, 7, 7, 8, 8, 8, 8, 8, 8, 8 | 7.7 | 7.7 |
==============+======+==============================================+======+======+========
| | first page 25, 2, 3, 2, 21, 16, 9, 20, 9, 9 | 1.6 | |
| One +----------------------------------------------+------+ 7.5 |
20,000 Records when | | Other pages 6, 6, 2, 2, 4, 4, 4, 1, 2, 2 | 3.3 | | 6.6533
+------+----------------------------------------------+------+------+
| Two | Each page 54, 50, 37, 46, 49, 47, 52, 50, 55, 59 | 49.9 | 49.9 |
==============+======+==============================================+======+======+========
| | First page 34, 35, 24, 21, 21, 21, 22, 22, 21, 21 | 25.2 | |
| One +----------------------------------------------+------+ 25.95|
30,000 Records when | | Other pages 14, 27, 40, 39, 37, 33, 22, 30, 14, 11 | 26.7 | | 3.3372
+------+----------------------------------------------+------+------+
| Two | Each page 92, 90, 83, 78, 93, 83, 91, 79, 89, 88 | 86.6 | 86.6 |
==============+======+==============================================+======+======+========
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service