Home > Database > Mysql Tutorial > How to check mysql statement running time

How to check mysql statement running time

coldplay.xixi
Release: 2020-10-10 17:01:48
Original
3599 people have browsed it

How to check the running time of mysql statement: use timestampdiff to check the execution time, the code is [select * from comment;select timestampdiff(second,@d,now());].

How to check mysql statement running time

How to check the running time of mysql statement:

Use timestampdiff to check the execution time.

One thing to note about this method is that the three sql statements must be executed together as much as possible, otherwise the error will be too large and it will not be accurate at all

set @d=now();
select * from comment;
select timestampdiff(second,@d,now());
Copy after login

If it is executed using the command line, there is one point It should be noted that after select timestampdiff(second,@d,now());, you must copy an extra blank line, otherwise the last sql will require you to press Enter to execute it yourself, which will be inaccurate.

Related free learning recommendations: mysql database (video)

The above is the detailed content of How to check mysql statement running time. 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