Bug #21979 Log reason in slow-log
Submitted: 1 Sep 2006 22:21 Modified: 28 Dec 2009 19:30
Reporter: Thomas Auge Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server Severity:S4 (Feature request)
Version:any OS:Any
Assigned to: CPU Architecture:Any
Tags: log, performance, slow
Triage: Needs Triage: D5 (Feature request)

[1 Sep 2006 22:21] Thomas Auge
Description:
Some information why a query was logged into the slow-log would be really helpful. There are already a lot of interesting things logged as server status variables and it would be nice to make the connection to the slow log.

For example sort_scan or select_scan indicate problems, but it's hard to make the connection to the slow log, especially if there are plenty of queries which show up in the slow log that cannot be optimized. (I.e. sorts on UNIONs).

Oh, and keep up the good work! ;-)

How to repeat:
Uh?

Suggested fix:
Just do it? ;-)
[28 Dec 2009 19:16] Kevin Benton
I would suggest going further - that when a slow log entry is created that we are given the ability to make mysqld give us the actual execution path along with the log entry.  This would give administrators all the details required to troubleshoot a slow query entry without asking them to start trying to recreate what was happening at the time the query was being run.  It would also be helpful to know other system parameters like # of active threads running at the time (not sleeping), total number of threads running in mysqld, some indication of load level and disk I/O, etc.
[28 Dec 2009 19:30] Miguel Solorzano
Thank you for the bug report.