Bug #87645 Missing Com_xxx rows in performance_schema.global_status
Submitted: 1 Sep 2017 23:09 Modified: 26 Nov 2019 12:42
Reporter: Tomasz Kłoczko Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.7.19 OS:Any
Assigned to: CPU Architecture:Any

[1 Sep 2017 23:09] Tomasz Kłoczko
Description:
I'm tryig to organize new version of the MySQL engine monitoring and I need access to all Com_xxx.
Just found that in performance_schema.global_status table are missing almost all Com_xxx rows.
I'm using show_compatibility_56=OFF

How to repeat:

$ diff -u <(mysql -Nse "SHOW GLOBAL STATUS;" |awk '{print $1}') <(mysql -Nse "select * from performance_schema.global_status;" | awk '{print $1}')
--- /dev/fd/63	2017-09-01 23:55:21.885182271 +0100
+++ /dev/fd/62	2017-09-01 23:55:21.884182262 +0100
@@ -6,153 +6,6 @@
 Binlog_stmt_cache_use
 Bytes_received
 Bytes_sent
-Com_admin_commands
-Com_assign_to_keycache
-Com_alter_db
-Com_alter_db_upgrade
-Com_alter_event
-Com_alter_function
-Com_alter_instance
-Com_alter_procedure
-Com_alter_server
-Com_alter_table
-Com_alter_tablespace
-Com_alter_user
-Com_analyze
-Com_begin
-Com_binlog
-Com_call_procedure
-Com_change_db
-Com_change_master
-Com_change_repl_filter
-Com_check
-Com_checksum
-Com_commit
-Com_create_db
-Com_create_event
-Com_create_function
-Com_create_index
-Com_create_procedure
-Com_create_server
-Com_create_table
-Com_create_trigger
-Com_create_udf
-Com_create_user
-Com_create_view
-Com_dealloc_sql
-Com_delete
-Com_delete_multi
-Com_do
-Com_drop_db
-Com_drop_event
-Com_drop_function
-Com_drop_index
-Com_drop_procedure
-Com_drop_server
-Com_drop_table
-Com_drop_trigger
-Com_drop_user
-Com_drop_view
-Com_empty_query
-Com_execute_sql
-Com_explain_other
-Com_flush
-Com_get_diagnostics
-Com_grant
-Com_ha_close
-Com_ha_open
-Com_ha_read
-Com_help
-Com_insert
-Com_insert_select
-Com_install_plugin
-Com_kill
-Com_load
-Com_lock_tables
-Com_optimize
-Com_preload_keys
-Com_prepare_sql
-Com_purge
-Com_purge_before_date
-Com_release_savepoint
-Com_rename_table
-Com_rename_user
-Com_repair
-Com_replace
-Com_replace_select
-Com_reset
-Com_resignal
-Com_revoke
-Com_revoke_all
-Com_rollback
-Com_rollback_to_savepoint
-Com_savepoint
-Com_select
-Com_set_option
-Com_signal
-Com_show_binlog_events
-Com_show_binlogs
-Com_show_charsets
-Com_show_collations
-Com_show_create_db
-Com_show_create_event
-Com_show_create_func
-Com_show_create_proc
-Com_show_create_table
-Com_show_create_trigger
-Com_show_databases
-Com_show_engine_logs
-Com_show_engine_mutex
-Com_show_engine_status
-Com_show_events
-Com_show_errors
-Com_show_fields
-Com_show_function_code
-Com_show_function_status
-Com_show_grants
-Com_show_keys
-Com_show_master_status
-Com_show_open_tables
-Com_show_plugins
-Com_show_privileges
-Com_show_procedure_code
-Com_show_procedure_status
-Com_show_processlist
-Com_show_profile
-Com_show_profiles
-Com_show_relaylog_events
-Com_show_slave_hosts
-Com_show_slave_status
-Com_show_status
-Com_show_storage_engines
-Com_show_table_status
-Com_show_tables
-Com_show_triggers
-Com_show_variables
-Com_show_warnings
-Com_show_create_user
-Com_shutdown
-Com_slave_start
-Com_slave_stop
-Com_group_replication_start
-Com_group_replication_stop
-Com_stmt_execute
-Com_stmt_close
-Com_stmt_fetch
-Com_stmt_prepare
-Com_stmt_reset
-Com_stmt_send_long_data
-Com_truncate
-Com_uninstall_plugin
-Com_unlock_tables
-Com_update
-Com_update_multi
-Com_xa_commit
-Com_xa_end
-Com_xa_prepare
-Com_xa_recover
-Com_xa_rollback
-Com_xa_start
 Com_stmt_reprepare
 Connection_errors_accept
 Connection_errors_internal
[4 Sep 2017 11:05] Mark Leith
This is not a bug, but by design. From WL#6629:

"When show_compatibility_56 = OFF

This table lists the value of all status variables with a scope of SESSION or a combined scope of GLOBAL and SESSION for all connection threads.

Status variables with a purely GLOBAL scope are ignored.

Note that per thread status variables are always displayed,
regardless of column INSTRUMENTED in table performance_schema.threads.

Existing status counters named "COM_" are excluded from the performance schema status tables."

https://dev.mysql.com/worklog/task/?id=6629

This is due to there being equivalent (and better) statistics per statement type within the performance_schema.events_statements_summary_global_by_event_name table (which has these counters, essentially, but along with latency stats etc. as well):

https://marcalff.blogspot.co.uk/2011/12/performance-schema-or-com-status.html
[26 Nov 2019 7:38] MySQL Verification Team
Bug #97778 marked as duplicate of this one
[26 Nov 2019 12:42] Tomasz Kłoczko
Yes you are right.
Please close that ticket.