Bug #103274 "show profile from query 1" wrong result
Submitted: 11 Apr 2021 9:05 Modified: 11 Apr 2021 13:09
Reporter: haochen he Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Information schema Severity:S2 (Serious)
Version:8.0.22 OS:Linux
Assigned to: CPU Architecture:Any

[11 Apr 2021 9:05] haochen he
Description:
"show profile" only shows 100 lines.

See the result below, apparently, something is outside the 100 lines.

How to repeat:
set profiling = 1;

select s_name, count(*) as numwait from SUPPLIER, LINEITEM l1, ORDERS, NATION where s_suppkey = l1.l_suppkey and o_orderkey =
l1.l_orderkey and o_orderstatus = 'F' and l1.l_receiptdate > l1.l_commitdate and exists ( select * from LINEITEM l2 where l2.l_orderkey = l1.l_orderkey and l2.l_suppkey <> l1.l_suppkey) and not exists (select * from LINEITEM l3 where l3.l_orderkey = l1.l_orderkey and l3.l_suppkey <> l1.l_suppkey and l3.l_receiptdate > l3.l_commitdate) and s_nationkey = n_nationkey and n_name = 'EGYPT' group by s_name order by numwait desc, s_name limit 100;\

100 row in set (17.48 sec)

SHOW PROFILE FOR QUERY 1 LIMIT 1000;

+----------------------------+----------+
| Status                     | Duration |
+----------------------------+----------+
| executing                  | 0.000002 |
| executing                  | 0.000006 |
| executing                  | 0.000003 |
| executing                  | 0.000012 |
| executing                  | 0.000003 |
| executing                  | 0.000004 |
| executing                  | 0.000003 |
| executing                  | 0.000003 |
| executing                  | 0.000002 |
| executing                  | 0.000006 |
| executing                  | 0.000002 |
| executing                  | 0.000003 |
| executing                  | 0.000003 |
| executing                  | 0.000003 |
| executing                  | 0.000003 |
| executing                  | 0.000003 |
| executing                  | 0.000003 |
| executing                  | 0.000003 |
| executing                  | 0.000002 |
| executing                  | 0.000004 |
| executing                  | 0.000002 |
| executing                  | 0.000005 |
| executing                  | 0.000003 |
| executing                  | 0.000003 |
| executing                  | 0.000003 |
| executing                  | 0.000005 |
| executing                  | 0.000003 |
| executing                  | 0.000003 |
| executing                  | 0.000002 |
| executing                  | 0.000003 |
| executing                  | 0.000003 |
| executing                  | 0.000004 |
| executing                  | 0.000002 |
| executing                  | 0.000005 |
| executing                  | 0.000003 |
| executing                  | 0.000003 |
| executing                  | 0.000003 |
| executing                  | 0.000003 |
| executing                  | 0.000002 |
| executing                  | 0.000003 |
| executing                  | 0.000003 |
| executing                  | 0.000003 |
| executing                  | 0.000003 |
| executing                  | 0.000005 |
| executing                  | 0.000003 |
| executing                  | 0.000003 |
| executing                  | 0.000002 |
| executing                  | 0.000006 |
| executing                  | 0.000003 |
| executing                  | 0.000003 |
| executing                  | 0.000002 |
| executing                  | 0.000006 |
| executing                  | 0.000003 |
| executing                  | 0.000004 |
| executing                  | 0.000003 |
| executing                  | 0.000003 |
| executing                  | 0.000002 |
| executing                  | 0.000003 |
| executing                  | 0.000003 |
| executing                  | 0.000003 |
| executing                  | 0.000003 |
| executing                  | 0.000007 |
| executing                  | 0.000004 |
| executing                  | 0.000008 |
| executing                  | 0.000004 |
| executing                  | 0.000013 |
| executing                  | 0.000004 |
| executing                  | 0.000004 |
| executing                  | 0.000003 |
| executing                  | 0.000005 |
| executing                  | 0.000003 |
| executing                  | 0.000006 |
| executing                  | 0.000005 |
| executing                  | 0.000003 |
| executing                  | 0.000008 |
| executing                  | 0.000009 |
| executing                  | 0.000003 |
| executing                  | 0.000003 |
| executing                  | 0.000003 |
| executing                  | 0.000003 |
| executing                  | 0.000003 |
| executing                  | 0.000004 |
| executing                  | 0.000003 |
| executing                  | 0.000008 |
| executing                  | 0.000003 |
| executing                  | 0.000008 |
| executing                  | 0.000003 |
| executing                  | 0.000003 |
| executing                  | 0.000003 |
| executing                  | 0.000003 |
| executing                  | 0.000003 |
| executing                  | 0.041465 |
| end                        | 0.000008 |
| query end                  | 0.000004 |
| waiting for handler commit | 0.002714 |
| removing tmp table         | 0.000009 |
| waiting for handler commit | 0.000005 |
| closing tables             | 0.000011 |
| freeing items              | 0.000029 |
| cleaning up                | 0.000032 |
+----------------------------+----------+
100 rows in set, 1 warning (0.00 sec)

Suggested fix:
unknown
[11 Apr 2021 13:09] MySQL Verification Team
Thank you for the bug report. Expected and documented behavior:

https://dev.mysql.com/doc/refman/8.0/en/show-profile.html

Note

The SHOW PROFILE and SHOW PROFILES statements are deprecated; expect them to be removed in a future MySQL release. Use the Performance Schema instead; see Section 27.19.1, “Query Profiling Using Performance Schema”.

<CUT>

SHOW PROFILES displays a list of the most recent statements sent to the server. The size of the list is controlled by the profiling_history_size session variable, which has a default value of 15. The maximum value is 100. Setting the value to 0 has the practical effect of disabling profiling.