Comparison test _php tutorial for two schemes of php+mysql paging mechanism

Source: Internet
Author: User
Hardware environment: PIII550,128M,15.2G
Software Environment: Win98+apache+php4+mysql
Programme one:
1. First query with select COUNT (1) from Tab where condition gets the number of records that satisfy the condition $rows
2. Number of records per page $RPP retrieving the recordset with the previous pages $page
SELECT * from tab where condition limit ($page-1) * $RPP, $RPP
3. Displays all records that return a recordset.
4. $rows is passed to the next page when the page is transferred.
Scenario Two:
1. Retrieve the recordset that meets the criteria
SELECT * from tab where condition
2. Move the pointer to ($page-1) * $RPP
3. Show $RPP Records
==============+======+==============================================+======+======+========
Number of records | Solutions | Count 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 | | Other pages 2, 2, 2, 3, 1, 1, 2, 2, 2, 2 | 1.9 | | 4.8125

http://www.bkjia.com/PHPjc/631068.html www.bkjia.com true http://www.bkjia.com/PHPjc/631068.html techarticle hardware environment: PIII550,128M,15.2G Software Environment: Win98+apache+php4+mysql Scenario One: 1. First query with select COUNT (1) from Tab where condition Get the number of records that meet the criteria ...

  • Contact Us

    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

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.