Skip to content

Commit

Permalink
MDEV-25325 built-in documentation for performance_schema tables
Browse files Browse the repository at this point in the history
Improve documentation of performance_schema tables by appending COLUMN
comments to tables. Additionally improve test coverage and update corresponding
tests.
  • Loading branch information
haidong authored and cvicentiu committed Sep 7, 2021
1 parent edde990 commit 528abc7
Show file tree
Hide file tree
Showing 151 changed files with 3,867 additions and 2,377 deletions.
11 changes: 11 additions & 0 deletions mysql-test/suite/perfschema/r/dml_accounts.result
Expand Up @@ -23,3 +23,14 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.accounts WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'accounts'
UNLOCK TABLES;
#
# MDEV-25325 column_comment for performance_schema tables
#
select column_name, column_comment
from information_schema.columns
where table_schema='performance_schema' and table_name='accounts';
column_name column_comment
USER The connection's client user name for the connection, or NULL if an internal thread.
HOST The connection client's host name, or NULL if an internal thread.
CURRENT_CONNECTIONS Current connections for the account.
TOTAL_CONNECTIONS Total connections for the account.
9 changes: 9 additions & 0 deletions mysql-test/suite/perfschema/r/dml_cond_instances.result
Expand Up @@ -18,3 +18,12 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.cond_instances WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'cond_instances'
UNLOCK TABLES;
#
# MDEV-25325 column_comment for performance_schema tables
#
select column_name, column_comment
from information_schema.columns
where table_schema='performance_schema' and table_name='cond_instances';
column_name column_comment
NAME Client user name for the connection, or NULL if an internal thread.
OBJECT_INSTANCE_BEGIN Address in memory of the instrumented condition.
Expand Up @@ -24,3 +24,18 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_stages_summary_by_account_by_event_name WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_stages_summary_by_account_by_event_name'
UNLOCK TABLES;
#
# MDEV-25325 column_comment for performance_schema tables
#
select column_name, column_comment
from information_schema.columns
where table_schema='performance_schema' and table_name='events_stages_summary_by_account_by_event_name';
column_name column_comment
USER User. Used together with HOST and EVENT_NAME for grouping events.
HOST Host. Used together with USER and EVENT_NAME for grouping events.
EVENT_NAME Event name. Used together with USER and HOST for grouping events.
COUNT_STAR Number of summarized events, which includes all timed and untimed events.
SUM_TIMER_WAIT Total wait time of the timed summarized events.
MIN_TIMER_WAIT Minimum wait time of the timed summarized events.
AVG_TIMER_WAIT Average wait time of the timed summarized events.
MAX_TIMER_WAIT Maximum wait time of the timed summarized events.
Expand Up @@ -24,3 +24,17 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_stages_summary_by_host_by_event_name WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_stages_summary_by_host_by_event_name'
UNLOCK TABLES;
#
# MDEV-25325 column_comment for performance_schema tables
#
select column_name, column_comment
from information_schema.columns
where table_schema='performance_schema' and table_name='events_stages_summary_by_host_by_event_name';
column_name column_comment
HOST Host. Used together with EVENT_NAME for grouping events.
EVENT_NAME Event name. Used together with HOST for grouping events.
COUNT_STAR Number of summarized events, which includes all timed and untimed events.
SUM_TIMER_WAIT Total wait time of the timed summarized events.
MIN_TIMER_WAIT Minimum wait time of the timed summarized events.
AVG_TIMER_WAIT Average wait time of the timed summarized events.
MAX_TIMER_WAIT Maximum wait time of the timed summarized events.
Expand Up @@ -24,3 +24,17 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_stages_summary_by_thread_by_event_name WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_stages_summary_by_thread_by_event_name'
UNLOCK TABLES;
#
# MDEV-25325 column_comment for performance_schema tables
#
select column_name, column_comment
from information_schema.columns
where table_schema='performance_schema' and table_name='events_stages_summary_by_thread_by_event_name';
column_name column_comment
THREAD_ID Thread associated with the event. Together with EVENT_NAME uniquely identifies the row.
EVENT_NAME Event name. Used together with THREAD_ID for grouping events.
COUNT_STAR Number of summarized events, which includes all timed and untimed events.
SUM_TIMER_WAIT Total wait time of the timed summarized events.
MIN_TIMER_WAIT Minimum wait time of the timed summarized events.
AVG_TIMER_WAIT Average wait time of the timed summarized events.
MAX_TIMER_WAIT Maximum wait time of the timed summarized events.
Expand Up @@ -24,3 +24,17 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_stages_summary_by_user_by_event_name WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_stages_summary_by_user_by_event_name'
UNLOCK TABLES;
#
# MDEV-25325 column_comment for performance_schema tables
#
select column_name, column_comment
from information_schema.columns
where table_schema='performance_schema' and table_name='events_stages_summary_by_user_by_event_name';
column_name column_comment
USER User. Used together with EVENT_NAME for grouping events.
EVENT_NAME Event name. Used together with USER for grouping events.
COUNT_STAR Number of summarized events, which includes all timed and untimed events.
SUM_TIMER_WAIT Total wait time of the timed summarized events.
MIN_TIMER_WAIT Minimum wait time of the timed summarized events.
AVG_TIMER_WAIT Average wait time of the timed summarized events.
MAX_TIMER_WAIT Maximum wait time of the timed summarized events.
13 changes: 13 additions & 0 deletions mysql-test/suite/perfschema/r/dml_esgs_global_by_event_name.result
Expand Up @@ -23,3 +23,16 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_stages_summary_global_by_event_name WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_stages_summary_global_by_event_name'
UNLOCK TABLES;
#
# MDEV-25325 column_comment for performance_schema tables
#
select column_name, column_comment
from information_schema.columns
where table_schema='performance_schema' and table_name='events_stages_summary_global_by_event_name';
column_name column_comment
EVENT_NAME Event name.
COUNT_STAR Number of summarized events, which includes all timed and untimed events.
SUM_TIMER_WAIT Total wait time of the timed summarized events.
MIN_TIMER_WAIT Minimum wait time of the timed summarized events.
AVG_TIMER_WAIT Average wait time of the timed summarized events.
MAX_TIMER_WAIT Maximum wait time of the timed summarized events.
Expand Up @@ -24,3 +24,37 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_statements_summary_by_account_by_event_name WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_statements_summary_by_account_by_event_name'
UNLOCK TABLES;
#
# MDEV-25325 column_comment for performance_schema tables
#
select column_name, column_comment
from information_schema.columns
where table_schema='performance_schema' and table_name='events_statements_summary_by_account_by_event_name';
column_name column_comment
USER User. Used together with HOST and EVENT_NAME for grouping events.
HOST Host. Used together with USER and EVENT_NAME for grouping events.
EVENT_NAME Event name. Used together with USER and HOST for grouping events.
COUNT_STAR Number of summarized events
SUM_TIMER_WAIT Total wait time of the summarized events that are timed.
MIN_TIMER_WAIT Minimum wait time of the summarized events that are timed.
AVG_TIMER_WAIT Average wait time of the summarized events that are timed.
MAX_TIMER_WAIT Maximum wait time of the summarized events that are timed.
SUM_LOCK_TIME Sum of the LOCK_TIME column in the events_statements_current table.
SUM_ERRORS Sum of the ERRORS column in the events_statements_current table.
SUM_WARNINGS Sum of the WARNINGS column in the events_statements_current table.
SUM_ROWS_AFFECTED Sum of the ROWS_AFFECTED column in the events_statements_current table.
SUM_ROWS_SENT Sum of the ROWS_SENT column in the events_statements_current table.
SUM_ROWS_EXAMINED Sum of the ROWS_EXAMINED column in the events_statements_current table.
SUM_CREATED_TMP_DISK_TABLES Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table.
SUM_CREATED_TMP_TABLES Sum of the CREATED_TMP_TABLES column in the events_statements_current table.
SUM_SELECT_FULL_JOIN Sum of the SELECT_FULL_JOIN column in the events_statements_current table.
SUM_SELECT_FULL_RANGE_JOIN Sum of the SELECT_FULL_RANGE_JOIN column in the events_statements_current table.
SUM_SELECT_RANGE Sum of the SELECT_RANGE column in the events_statements_current table.
SUM_SELECT_RANGE_CHECK Sum of the SELECT_RANGE_CHECK column in the events_statements_current table.
SUM_SELECT_SCAN Sum of the SELECT_SCAN column in the events_statements_current table.
SUM_SORT_MERGE_PASSES Sum of the SORT_MERGE_PASSES column in the events_statements_current table.
SUM_SORT_RANGE Sum of the SORT_RANGE column in the events_statements_current table.
SUM_SORT_ROWS Sum of the SORT_ROWS column in the events_statements_current table.
SUM_SORT_SCAN Sum of the SORT_SCAN column in the events_statements_current table.
SUM_NO_INDEX_USED Sum of the NO_INDEX_USED column in the events_statements_current table.
SUM_NO_GOOD_INDEX_USED Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table.
36 changes: 36 additions & 0 deletions mysql-test/suite/perfschema/r/dml_esms_by_digest.result
Expand Up @@ -25,3 +25,39 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_statements_summary_by_digest WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_statements_summary_by_digest'
UNLOCK TABLES;
#
# MDEV-25325 column_comment for performance_schema tables
#
select column_name, column_comment
from information_schema.columns
where table_schema='performance_schema' and table_name='events_statements_summary_by_digest';
column_name column_comment
SCHEMA_NAME Database name. Records are summarised together with DIGEST.
DIGEST Performance Schema digest. Records are summarised together with SCHEMA NAME.
DIGEST_TEXT The unhashed form of the digest.
COUNT_STAR Number of summarized events
SUM_TIMER_WAIT Total wait time of the summarized events that are timed.
MIN_TIMER_WAIT Minimum wait time of the summarized events that are timed.
AVG_TIMER_WAIT Average wait time of the summarized events that are timed.
MAX_TIMER_WAIT Maximum wait time of the summarized events that are timed.
SUM_LOCK_TIME Sum of the LOCK_TIME column in the events_statements_current table.
SUM_ERRORS Sum of the ERRORS column in the events_statements_current table.
SUM_WARNINGS Sum of the WARNINGS column in the events_statements_current table.
SUM_ROWS_AFFECTED Sum of the ROWS_AFFECTED column in the events_statements_current table.
SUM_ROWS_SENT Sum of the ROWS_SENT column in the events_statements_current table.
SUM_ROWS_EXAMINED Sum of the ROWS_EXAMINED column in the events_statements_current table.
SUM_CREATED_TMP_DISK_TABLES Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table.
SUM_CREATED_TMP_TABLES Sum of the CREATED_TMP_TABLES column in the events_statements_current table.
SUM_SELECT_FULL_JOIN Sum of the SELECT_FULL_JOIN column in the events_statements_current table.
SUM_SELECT_FULL_RANGE_JOIN Sum of the SELECT_FULL_RANGE_JOIN column in the events_statements_current table.
SUM_SELECT_RANGE Sum of the SELECT_RANGE column in the events_statements_current table.
SUM_SELECT_RANGE_CHECK Sum of the SELECT_RANGE_CHECK column in the events_statements_current table.
SUM_SELECT_SCAN Sum of the SELECT_SCAN column in the events_statements_current table.
SUM_SORT_MERGE_PASSES Sum of the SORT_MERGE_PASSES column in the events_statements_current table.
SUM_SORT_RANGE Sum of the SORT_RANGE column in the events_statements_current table.
SUM_SORT_ROWS Sum of the SORT_ROWS column in the events_statements_current table.
SUM_SORT_SCAN Sum of the SORT_SCAN column in the events_statements_current table.
SUM_NO_INDEX_USED Sum of the NO_INDEX_USED column in the events_statements_current table.
SUM_NO_GOOD_INDEX_USED Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table.
FIRST_SEEN Time at which the digest was first seen.
LAST_SEEN Time at which the digest was most recently seen.
Expand Up @@ -24,3 +24,36 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_statements_summary_by_host_by_event_name WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_statements_summary_by_host_by_event_name'
UNLOCK TABLES;
#
# MDEV-25325 column_comment for performance_schema tables
#
select column_name, column_comment
from information_schema.columns
where table_schema='performance_schema' and table_name='events_statements_summary_by_host_by_event_name';
column_name column_comment
HOST Host. Used together with EVENT_NAME for grouping events.
EVENT_NAME Event name. Used together with HOST for grouping events.
COUNT_STAR Number of summarized events
SUM_TIMER_WAIT Total wait time of the summarized events that are timed.
MIN_TIMER_WAIT Minimum wait time of the summarized events that are timed.
AVG_TIMER_WAIT Average wait time of the summarized events that are timed.
MAX_TIMER_WAIT Maximum wait time of the summarized events that are timed.
SUM_LOCK_TIME Sum of the LOCK_TIME column in the events_statements_currentd table.
SUM_ERRORS Sum of the ERRORS column in the events_statements_current table.
SUM_WARNINGS Sum of the WARNINGS column in the events_statements_current table.
SUM_ROWS_AFFECTED Sum of the ROWS_AFFECTED column in the events_statements_current table.
SUM_ROWS_SENT Sum of the ROWS_SENT column in the events_statements_current table.
SUM_ROWS_EXAMINED Sum of the ROWS_EXAMINED column in the events_statements_current table.
SUM_CREATED_TMP_DISK_TABLES Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table.
SUM_CREATED_TMP_TABLES Sum of the CREATED_TMP_TABLES column in the events_statements_current table.
SUM_SELECT_FULL_JOIN Sum of the SELECT_FULL_JOIN column in the events_statements_current table.
SUM_SELECT_FULL_RANGE_JOIN Sum of the SELECT_FULL_RANGE_JOINW column in the events_statements_current table.
SUM_SELECT_RANGE Sum of the SELECT_RANGE column in the events_statements_current table.
SUM_SELECT_RANGE_CHECK Sum of the SELECT_RANGE_CHECK column in the events_statements_current table.
SUM_SELECT_SCAN Sum of the SELECT_SCAN column in the events_statements_current table.
SUM_SORT_MERGE_PASSES Sum of the SORT_MERGE_PASSES column in the events_statements_current table.
SUM_SORT_RANGE Sum of the SORT_RANGE column in the events_statements_current table.
SUM_SORT_ROWS Sum of the SORT_ROWS column in the events_statements_current table.
SUM_SORT_SCAN Sum of the SORT_SCAN column in the events_statements_current table.
SUM_NO_INDEX_USED Sum of the NO_INDEX_USED column in the events_statements_current table.
SUM_NO_GOOD_INDEX_USED Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table.
Expand Up @@ -24,3 +24,36 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_statements_summary_by_thread_by_event_name WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_statements_summary_by_thread_by_event_name'
UNLOCK TABLES;
#
# MDEV-25325 column_comment for performance_schema tables
#
select column_name, column_comment
from information_schema.columns
where table_schema='performance_schema' and table_name='events_statements_summary_by_thread_by_event_name';
column_name column_comment
THREAD_ID Thread associated with the event. Together with EVENT_NAME uniquely identifies the row.
EVENT_NAME Event name. Used together with THREAD_ID for grouping events.
COUNT_STAR Number of summarized events
SUM_TIMER_WAIT Total wait time of the summarized events that are timed.
MIN_TIMER_WAIT Minimum wait time of the summarized events that are timed.
AVG_TIMER_WAIT Average wait time of the summarized events that are timed.
MAX_TIMER_WAIT Maximum wait time of the summarized events that are timed.
SUM_LOCK_TIME Sum of the LOCK_TIME column in the events_statements_current table.
SUM_ERRORS Sum of the ERRORS column in the events_statements_current table.
SUM_WARNINGS Sum of the WARNINGS column in the events_statements_current table.
SUM_ROWS_AFFECTED Sum of the ROWS_AFFECTED column in the events_statements_current table.
SUM_ROWS_SENT Sum of the ROWS_SENT column in the events_statements_current table.
SUM_ROWS_EXAMINED Sum of the ROWS_EXAMINED column in the events_statements_current table.
SUM_CREATED_TMP_DISK_TABLES Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table.
SUM_CREATED_TMP_TABLES Sum of the CREATED_TMP_TABLES column in the events_statements_current table.
SUM_SELECT_FULL_JOIN Sum of the SELECT_FULL_JOIN column in the events_statements_current table.
SUM_SELECT_FULL_RANGE_JOIN Sum of the SELECT_FULL_RANGE_JOIN column in the events_statements_current table.
SUM_SELECT_RANGE Sum of the SELECT_RANGE column in the events_statements_current table.
SUM_SELECT_RANGE_CHECK Sum of the SELECT_RANGE_CHECK column in the events_statements_current table.
SUM_SELECT_SCAN Sum of the SELECT_SCAN column in the events_statements_current table.
SUM_SORT_MERGE_PASSES Sum of the SORT_MERGE_PASSES column in the events_statements_current table.
SUM_SORT_RANGE Sum of the SORT_RANGE column in the events_statements_current table.
SUM_SORT_ROWS Sum of the SORT_ROWS column in the events_statements_current table.
SUM_SORT_SCAN Sum of the SORT_SCAN column in the events_statements_current table.
SUM_NO_INDEX_USED Sum of the NO_INDEX_USED column in the events_statements_current table.
SUM_NO_GOOD_INDEX_USED Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table.
Expand Up @@ -24,3 +24,36 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.events_statements_summary_by_user_by_event_name WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'events_statements_summary_by_user_by_event_name'
UNLOCK TABLES;
#
# MDEV-25325 column_comment for performance_schema tables
#
select column_name, column_comment
from information_schema.columns
where table_schema='performance_schema' and table_name='events_statements_summary_by_user_by_event_name';
column_name column_comment
USER User. Used together with EVENT_NAME for grouping events.
EVENT_NAME Event name. Used together with USER for grouping events.
COUNT_STAR Number of summarized events
SUM_TIMER_WAIT Total wait time of the summarized events that are timed.
MIN_TIMER_WAIT Minimum wait time of the summarized events that are timed.
AVG_TIMER_WAIT Average wait time of the summarized events that are timed.
MAX_TIMER_WAIT Maximum wait time of the summarized events that are timed.
SUM_LOCK_TIME Sum of the LOCK_TIME column in the events_statements_current table.
SUM_ERRORS Sum of the ERRORS column in the events_statements_current table.
SUM_WARNINGS Sum of the WARNINGS column in the events_statements_current table.
SUM_ROWS_AFFECTED Sum of the ROWS_AFFECTED column in the events_statements_current table.
SUM_ROWS_SENT Sum of the ROWS_SENT column in the events_statements_current table.
SUM_ROWS_EXAMINED Sum of the ROWS_EXAMINED column in the events_statements_current table.
SUM_CREATED_TMP_DISK_TABLES Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table.
SUM_CREATED_TMP_TABLES Sum of the CREATED_TMP_TABLES column in the events_statements_current table.
SUM_SELECT_FULL_JOIN Sum of the SELECT_FULL_JOIN column in the events_statements_current table.
SUM_SELECT_FULL_RANGE_JOIN Sum of the SELECT_FULL_RANGE_JOIN column in the events_statements_current table.
SUM_SELECT_RANGE Sum of the SELECT_RANGE column in the events_statements_current table.
SUM_SELECT_RANGE_CHECK Sum of the SELECT_RANGE_CHECK column in the events_statements_current table.
SUM_SELECT_SCAN Sum of the SELECT_SCAN column in the events_statements_current table.
SUM_SORT_MERGE_PASSES Sum of the SORT_MERGE_PASSES column in the events_statements_current table.
SUM_SORT_RANGE Sum of the SORT_RANGE column in the events_statements_current table.
SUM_SORT_ROWS Sum of the SORT_ROWS column in the events_statements_current table.
SUM_SORT_SCAN Sum of the SORT_SCAN column in the events_statements_current table.
SUM_NO_INDEX_USED Sum of the NO_INDEX_USED column in the events_statements_current table.
SUM_NO_GOOD_INDEX_USED Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table.

0 comments on commit 528abc7

Please sign in to comment.