MySQL profiling Performance Analysis Tool

Source: Internet
Author: User

MySQL profiling Performance Analysis Tool

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.

Through slow log query, we can know which SQL statements are inefficient in execution. Through the explain command, we can know the specific execution status and index usage of the SQL statements. We can also view the execution status using the show command. 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:

# The ideal of life is for ideal life! #

This article permanently updates the link address:

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.