mysql 查询执行时间 - 我能以毫秒为单位得到这个吗?

发布于 2024-09-01 17:57:21 字数 411 浏览 1 评论 0原文

可能的重复:
如何获取以毫秒或微秒为单位的加载时间mysql

我正在比较几种不同的方法来直接在控制台获取 mysql 中的一些数据,使用 SQL_NO_CACHE 选项来确保 mysql 每次都保持运行完整查询。 Mysql 给我的执行时间以秒为单位,精确到小数点后两位。我真的很想以毫秒为单位返回结果(最好是小数点后一位或两位),以便更好地了解改进(或缺乏)。我可以在 mysql 中设置一个选项来实现此目的吗?

谢谢,马克斯

Possible Duplicate:
how to get load time in milliseconds or microseconds in mysql

I'm comparing a few different approaches to getting some data in mysql, directly at the console, using the SQL_NO_CACHE option to make sure mysql keeps running the full query every time. Mysql gives me the execution time back in seconds, to two decimal places. I'd really like to get the result back in milliseconds (ideally to one or two decimal places), to get a better idea of improvements (or lack of). Is there an option i can set in mysql to achieve this?

thanks, max

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

℉服软 2024-09-08 17:57:21

答案是启用 mysql profiler 然后检查运行查询后。

mysql> set profiling=1;

The answer is to enable the mysql profiler and then check it after you run your queries.

mysql> set profiling=1;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文