Bug #14275 spitting out the wrong slow logs
Submitted: 24 Oct 2005 21:41 Modified: 24 Oct 2005 23:53
Reporter: yong huang Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.0.25 OS:Linux (Fedora Core 4 64bit)
Assigned to: CPU Architecture:Any

[24 Oct 2005 21:41] yong huang
Description:
I have the long_query_time = 2, and in my slow logs it shows queries like: 

# Time: 051024 21:33:27
# User@Host: user[user] @  [X.X.X.X]
# Query_time: 0  Lock_time: 0  Rows_sent: 1  Rows_examined: 7
select * from TableA where type='2' and ts > CURRENT_TIMESTAMP + INTERVAL -5 SECOND and id<>'4';

We have thousands of queries like this showing up in the slow logs, even though the Query_time is 0.  The table only has 7 rows in it.  On the application side, we see the query results returned in a range from 0.017s to 0.4 s.  It seems that the queries are mistikenly labelled as slow log. 

We saw the similiar problem on other table as well.  Very small table (<20 rows), query_time =0, Lock_time =0, but slow logs log them. 

 

How to repeat:
uname -a: 
Linux my.host 2.6.11-1.1369_FC4smp #1 SMP Thu Jun 2 23:16:33 EDT 2005 x86_64 x86_64 x86_64 GNU/Linux

mysql  Ver 12.22 Distrib 4.0.25, for unknown-linux-gnu (x86_64)

Dell PE 2850.
[24 Oct 2005 21:47] yong huang
The server is being heavily used. 800 - 1000 db connections, 200 - 400 inserts+deletes+updates/second, 400 -1000 selects/second.
[24 Oct 2005 23:41] Hartmut Holzgraefe
i assume you have --log-long-format enabled 
so that queries that don't use any index are also logged

see http://dev.mysql.com/doc/refman/4.1/en/slow-query-log.html
[24 Oct 2005 23:53] yong huang
Hartmut got it. Thanks!