3. mysql Performance analysis

Source: Internet
Author: User
Tags mysql query

One, MySQL query optimizer

1. mysql has an optimizer module dedicated to optimizing the SELECT statement, the main function: through the calculation of statistical information collected in the analysis system, the client's Query to provide him with the best execution plan (he thinks the best way to retrieve data, but not necessarily the DBA is considered to be optimal, This part is the most time-consuming) 2. When the client wants MySQL to request a query, and the command parser module completes the classification, distinguishing between select and forwarding to MySQL query optimizer, MySQL query optimizer first optimizes the entire query and handles some constants expression, and then analyze the Hint information in Query (if any) to see whether the Hint information can fully determine the execution plan of the query. If no Hint or Hint information is sufficient to fully determine the execution plan, the statistics of the objects involved are read, the corresponding calculation analysis is written according to query, and then the final execution plan is obtained.

Second, MySQL common bottleneck

1. When saturated, the cpu:cpu typically occurs when data is loaded into memory or read from disk 2. IO: Disk I/O bottlenecks occur when loading data is much larger than memory capacity 3. Performance bottlenecks for server hardware: Top, free, iostat, and Vmstat to see the performance status of the system

Third, the use of explain analysis of SQL (later in detail ...). )

3. mysql Performance analysis

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.