获取MySQL语句的准确执行时间 [英] Getting a precise execution time of a MySQL statement

查看:240
本文介绍了获取MySQL语句的准确执行时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在结果表明 设置中的X行(0.00秒).因此,我想知道是否有一种方法可以将时间显示在小数点后2位以上.

Right now the results indicate X rows in set (0.00 sec). So I am wondering if there's a way I can get the time in more than 2 decimal places.

推荐答案

在运行语句之前执行set profiling=1,然后使用show profiles查询获取计时.

Execute set profiling=1 before running your statement, then obtain timings with show profiles query .

有关更多详细信息,请参见 SHOW PROFILES语法,包括如何找出查询中正在使用时间的操作,例如检查权限,记录日志等.

See SHOW PROFILES syntax for more details, including how to find out what actions are using time inside your query, such as checking permissions , logging etc.

这篇关于获取MySQL语句的准确执行时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆