MySQL Optimization note pagination

Source: Internet
Author: User

The New Year's egg pain, so look at MySQL optimization, read a lot on the internet on the optimization method of pagination, but, I personally try on a time, did not appear they said the phenomenon ... Is it my machine problem?

Take a look at my practice record, want to see join in Exchange O (∩_∩) o~

The following practices are advocated by regular paging and online advocates:

offset is less than the hour :

General Practice

It can be seen that when the limit offset is smaller, the execution time of the page with the conventional procedure is 0.01s.

When the limit offset is small, another special method is used, in which case it is indeed in line with the recommended practice of

Use limit x, y directly when limit offset is small

when offset is larger :

You can see that the conventional approach is time consuming 0.47s

When using the recommended optimization method, time consuming 0.79s, is not offset is not big enough??

MySQL Optimization note pagination

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.