Bug #69928 "statement/com" event meaning is unclear
Submitted: 5 Aug 2013 18:10 Modified: 11 Oct 2013 14:49
Reporter: Todd Farmer (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Performance Schema Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: Marc ALFF CPU Architecture:Any

[5 Aug 2013 18:10] Todd Farmer
Description:
It's unclear what the "statement/com" event is meant to track.  If it is meant to be a rollup of all the events which are found below that (e.g., "statement/com/Init DB"), it's not functioning correctly:

mysql> SELECT event_name, count_star, sum_errors
    -> FROM events_statements_summary_global_by_event_name
    -> WHERE event_name LIKE 'statement/com/%';
+--------------------------------+------------+------------+
| event_name                     | count_star | sum_errors |
+--------------------------------+------------+------------+
| statement/com/Sleep            |         19 |         19 |
| statement/com/Quit             |        609 |          0 |
| statement/com/Init DB          |          2 |          0 |
| statement/com/Query            |          0 |          0 |
| statement/com/Field List       |         13 |         13 |
| statement/com/Create DB        |          1 |          1 |
| statement/com/Drop DB          |          1 |          1 |
| statement/com/Refresh          |         13 |          0 |
| statement/com/Shutdown         |          0 |          0 |
| statement/com/Statistics       |         13 |          0 |
| statement/com/Processlist      |         16 |          0 |
| statement/com/Connect          |         13 |         13 |
| statement/com/Kill             |          1 |          0 |
| statement/com/Debug            |         14 |          0 |
| statement/com/Ping             |       1934 |          0 |
| statement/com/Time             |         13 |         13 |
| statement/com/Delayed insert   |         13 |         13 |
| statement/com/Change user      |         12 |         12 |
| statement/com/Binlog Dump      |         12 |         12 |
| statement/com/Table Dump       |         12 |         12 |
| statement/com/Connect Out      |         12 |         12 |
| statement/com/Register Slave   |         12 |         12 |
| statement/com/Prepare          |          0 |          0 |
| statement/com/Execute          |         11 |         11 |
| statement/com/Long Data        |          9 |          0 |
| statement/com/Close stmt       |          1 |          0 |
| statement/com/Reset stmt       |          2 |          2 |
| statement/com/Set option       |          2 |          0 |
| statement/com/Fetch            |          2 |          2 |
| statement/com/Daemon           |          3 |          3 |
| statement/com/Binlog Dump GTID |          2 |          2 |
| statement/com/Error            |        448 |        448 |
| statement/com/                 |          0 |          0 |
+--------------------------------+------------+------------+
33 rows in set (0.00 sec)

How to repeat:
SELECT event_name, count_star, sum_errors
FROM events_statements_summary_global_by_event_name
WHERE event_name LIKE 'statement/com/%';

Suggested fix:
Define expected values for "statement/com" event.  If it's not implemented, remove the event.
[11 Oct 2013 14:49] Paul DuBois
Noted in 5.6.15, 5.7.3 changelogs.

Several statement instruments in the setup_instruments table are used
by the Performance Schema during the early stages of statement 
classification before the exact statement type is known. These
instruments were renamed to more clearly reflect their "abstract"
nature: 

statement/abstract/new_packet (renamed from statement/com/)
statement/abstract/Query      (renamed from statement/com/Query)
statement/abstract/relay_log  (renamed from statement/rpl/relay_log)

In addition, statistics for abstract instruments are no longer
collected in the following tables, because no such instrument is ever
used as the final classification for a statement:

events_statements_summary_by_thread_by_event_name
events_statements_summary_by_account_by_event_name
events_statements_summary_by_user_by_event_name
events_statements_summary_by_host_by_event_name
events_statements_summary_global_by_event_name

Applications that refer to the old instrument names must be updated
with the new names. For more information about the use of abstract
instruments in statement classification, see
http://dev.mysql.com/doc/refman/5.7/en/performance-schema-statements-tables.html.