MySQL Monitoring database statement creating sort index time too long problem

Source: Internet
Author: User

When a data query on a single table 5000W data is passed two single-column index criteria, when a composite index query, if the last order by ID sort, and remove the sort, the performance gap is close to two orders of magnitude

Conclusion: When using the default ordering of columns, you should not order by the column

By the way, record the other SQL performance issues encountered:

1, limit A, or a value is too large, can also lead to severe performance degradation, the solution is to obtain a batch of data to get the maximum ID, and then add in the query criteria > that ID only need to limit the number of one to get

2, when the condition is updated, if the amount of data is too large, first use the condition to query the column primary key to be modified, and then update the condition with the primary key to improve performance

MySQL Monitoring database statement creating sort index time too long problem

Related Article

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.