Bug #52492 Issue with output of SHOW PROFILE
Submitted: 31 Mar 2010 6:09 Modified: 7 Apr 2010 5:54
Reporter: Peter Laursen (Basic Quality Contributor) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: General Severity:S2 (Serious)
Version:5.0.37+, 5.1 OS:Any
Assigned to:
Tags: qc
Triage: Triaged: D4 (Minor)

[31 Mar 2010 6:09] Peter Laursen
Description:
There is an unresolved (and important) Forums discussion here:
http://forums.mysql.com/read.php?24,241461,252359#msg-252359

The topic is closed (automatically probably) and it is not possible to continue discussion there.

The documentation at 
http://dev.mysql.com/doc/refman/5.1/en/show-profiles.html
does not clarify properly how to interpret/understand the output of SHOW PROFILE.

There is no 'profiling' category here so I post in server main category.

How to repeat:
culprit form the discussion: 

"The "sending data" time is part of the execution time and has little relation with the real sending data time. .. I've heard #1 from the developers. A few of the Profile items are not quite what you would guess."

If this is correct the output of SHOW PROFILE is and always always misleading.  In any case documentation should explain how to interpret the output.

Suggested fix:
The *captions* returned by SHOW PROFILE (such as 'sending result') should be exact for what happened during the *time* described by the caption.  For instance if more than sending results is included in the 'sending results'-time the caption 'sending result' is wrong and misleading. 

If the quote above (from Forums) is incorrect it would be nice to have that stated clearly.
[31 Mar 2010 6:23] Peter Laursen
Also see:
http://bugs.mysql.com/bug.php?id=52487
[31 Mar 2010 6:36] Sveta Smirnova
Thank you for the report.

At http://dev.mysql.com/doc/refman/5.1/en/show-profiles.html there is a note "By default, SHOW PROFILE displays Status and Duration  columns. The Status values are like the State values displayed by SHOW PROCESSLIST, althought there might be some minor differences in interpretion for the two statements for some status values (see Section 7.5.6, “Examining Thread Information”)." Would be good to have explained what these differences are if any.
[6 Apr 2010 17:55] Paul Dubois
SHOW PROFILE is a community feature. As such, the manual includes such information as we have. However, we could include additional information if it is made available.
[6 Apr 2010 19:08] Paul Dubois
re: "community feature." I meant by that "a feature contributed from the community."
[7 Apr 2010 3:46] Peter Laursen
Is there still such things as 'community features'.  Where will I get a server without such feature (unless I compile it myself) ?
[7 Apr 2010 5:54] Peter Laursen
I am sorry .. I commented before I saw you last post.

But as documentation states: 

'The Status values are like the State values displayed by SHOW PROCESSLIST, althought there might be some minor differences in interpretion for the two statements for some status values (see Section 7.5.6,“Examining Thread Information”)."'

.. I understand that this is actually a bug with SHOW PROCESSLIST as well then. Am I correct?  

This http://dev.mysql.com/doc/refman/5.1/en/general-thread-states.html

.. only tells "Sending data: The thread is processing rows for a SELECT statement and also is sending data to the client.".  I do not find any explanation of the 'minor differences in interpretation .. ' in there are any.
[18 Sep 2012 18:45] James Day
Probably best handled as a duplicate of bug #57544. The states do cause confusion and some splitting into sub-states would be useful.