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: