MySQL profiling performance analysis tool, mysqlprofiling

Source: Internet
Author: User

MySQL profiling performance analysis tool, mysqlprofiling

Brief description:

MySQL Query Profiler is a very convenient Query diagnostic and analysis tool that can be used to obtain the consumption of multiple resources in a Query throughout the execution process, such as CPU, IO, IPC, SWAP, page faults, context switche, and so on. The location of the functions called by MySQL in the source file during Query execution can also be obtained.

PassSlow log queryYou can know which SQL statements are less efficient to execute.ExplainWe can know the specific execution of SQL statements, index usage, and so on.ShowCommand to view the execution status. If you think that the explain information is not detailed enough, you can use the profiling command to obtain more accurate information about system resources consumed by SQL Execution.

Profiling is disabled by default.

1. show variables like '% profiling %'; (view profiling information)

 

2. set profiling = 1; (enable profiling)

3. Execute SQL query

Example: select goods_name from ecs_goods where goods_id <5000;

Show profiles;

4. show profile for query 4;

The show profile format is as follows:

 

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.