Bug #16367 SLEEP is considered Slow Query
Submitted: 11 Jan 2006 11:30 Modified: 11 Jan 2006 11:54
Reporter: Luis A S Junior Camargo Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Logging Severity:S4 (Feature request)
Version:5.0.18 OS:Windows (Win2000 SP4)
Assigned to: CPU Architecture:Any

[11 Jan 2006 11:30] Luis A S Junior Camargo
Description:
This is not a bug in certain mode.

I have enabled the log-slow-queries and the SLEEP commands are interpreted as Slow Querie and has logged at host-slow.txt

# Time: 060111  9:18:19
# User@Host: user[user] @ SERVERMYSQL [192.168.0.10]
# Query_time: 30  Lock_time: 0  Rows_sent: 1  Rows_examined: 0
select sleep(30);

How to repeat:
Enable the slow queries in my.ini with a line:
log-slow-queries

Execute SLEEP with time value more than long_query_time, for example:
sleep(30);

After process, check slow queries log file.

Suggested fix:
Ignore SLEEP in slow queries.
[11 Jan 2006 11:54] Valeriy Kravchuk
Thank you for a problem report. Yes, it will be useful to exclude SLEEP from execution time when logging slow queries, but I am not sure it is possible in many cases (more complicated than "select SLEEP(30)"). I'll mark this report as verified feature request.