Home > Database > Mysql Tutorial > body text

How to check the running time of mysql statement

王林
Release: 2020-09-30 14:07:25
Original
4656 people have browsed it

How to check the running time of mysql statement: first execute the [set profiling = 1;] command to open the query profiler tool; then execute the [show profiles;] command to check the running time of the sql statement.

How to check the running time of mysql statement

Query Profiler is a query diagnostic analysis tool that comes with MYSQL. It can locate various resource consumption of a SQL statement execution, such as CPU, IO, etc., and the time it takes to execute the SQL, etc.

(Recommended tutorial: mysql tutorial)

First check whether the profile is turned on. The database is not turned on by default.

Check whether it is enabled:

show variables like "%pro%";
Copy after login

Set the enable method:

set profiling = 1;
Copy after login

How to check the running time of mysql statement

Then execute show profiles; you can view the total of all sql execution time.

How to check the running time of mysql statement

Related recommendations: php training

The above is the detailed content of How to check the running time of mysql statement. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template