Bug #5019 Duration of the query measured by MySQL
Submitted: 12 Aug 2004 13:59 Modified: 29 Dec 2005 15:49
Reporter: Ondra Zizka Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Logging Severity:S4 (Feature request)
Version: OS:Any
Assigned to: CPU Architecture:Any

[12 Aug 2004 13:59] Ondra Zizka
Description:
Hello, I think that MySQL should be able to tell how long certain query took. This might be just one integer in the result structure (talking about C), that would contain the the duration of the query in miliseconds. It could be measured very simply - by substracting end and start time. Actually I wonder why such simple and usable thing is not implemented since the ancient versions of MySQL.

Some people tend to say that the same can be done around mysql_query(), but why? This adds another two lines to the code and messes it. And, when used in high level languages like PHP, such way of measuring takes much much more time and affects the speed of the script.

There's a forum thread by me:
http://forums.mysql.com/read.php?60,33,83#83

How to repeat:
There's a forum thread by me:
http://forums.mysql.com/read.php?60,33,83#83
[29 Dec 2005 15:49] Valeriy Kravchuk
Thank you for a useful feature request. Some way to register query execution time (and other statistics) and to present this information for every query for the developer is surely needed. I believe, some solution for this is already under development.