MySQL查询执行时间-我可以在毫秒内得到这个吗? [英] mysql query execution time - can i get this in milliseconds?

查看:289
本文介绍了MySQL查询执行时间-我可以在毫秒内得到这个吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

我正在使用SQL_NO_CACHE选项比较直接在控制台上获取mysql中数据的几种不同方法,以确保mysql每次都始终运行完整的查询. Mysql给我执行时间以秒为单位,返回两位小数.我真的很想将结果以毫秒为单位(理想情况下返回到小数点后一位或二位),以便更好地了解改进(或缺乏改进)的想法.我可以在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?

谢谢,最大

推荐答案

答案是启用

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

mysql> set profiling=1;

这篇关于MySQL查询执行时间-我可以在毫秒内得到这个吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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