Bug #64924 | Cacheing long SELECT statement does too many prunes | ||
---|---|---|---|
Submitted: | 10 Apr 2012 9:03 | Modified: | 11 May 2012 16:46 |
Reporter: | Cedric Knight | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | MySQL Server: Query Cache | Severity: | S3 (Non-critical) |
Version: | 5.1.61 | OS: | Linux (2.6.32-5-amd64 #1 SMP) |
Assigned to: | Assigned Account | CPU Architecture: | Any |
[10 Apr 2012 9:03]
Cedric Knight
[10 May 2012 23:58]
Sveta Smirnova
Not fully repeatable with 5.5 for me: query runs longer when query cache involved, but I am not sure it spends time freeing it. It also does not block any parallel query. SHOW PROFILE: Status Duration starting 0.000566 Waiting for query cache lock 0.000011 checking query cache for query 0.316990 checking permissions 0.000022 Opening tables 0.009666 System lock 0.000023 Waiting for query cache lock 0.025033 init 0.060156 optimizing 0.024038 statistics 216.468186 preparing 106.197258 executing 0.000007 Sending data 0.029568 end 0.000012 query end 0.000007 closing tables 0.000046 freeing items 0.002317 Waiting for query cache lock 0.000013 freeing items 0.000032 Waiting for query cache lock 0.000003 freeing items 0.000003 storing result in query cache 0.000007 logging slow query 0.000003 logging slow query 0.015857 cleaning up 0.000096 real 5m23.577s user 0m0.029s sys 0m0.009s
[11 May 2012 11:08]
Sveta Smirnova
Thank you for the report. I can not repeat what you described exactly: SELECT query does not block other queries and spends most of time in "Statistics" and "Preparing", although there is slow down if compare with not cached version. So I'd call this one as duplicate of bug #37844 for now. Please check this issue in your environment when bug #37844 and if that global fix does not fix this problem reopen the report.
[11 May 2012 16:46]
Cedric Knight
Thanks for attempting to reproduce the bug. It isn't straightforward to test. Did you manage to get a similar ratio of Qcache_free_blocks to Qcache_free_memory before testing the long SELECT? The characteristics of what I described as blocking other threads include that one CPU uses 100%, while others are unused (as shown by mpstat), and "show full processlist" shows a large number of active queries with the query concerned as in state "NULL", and subsequent SELECT statements as "Locked" and INSERTs as "update" until the first query completes. (These are 5.1 states; I think 5.5 gives a bit more information.) Is there actually progress on bug 37844? I wondered if looking at the insertion code in the above ways might mitigate the problem in a different way.