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.

This is part of the patch covering newer columns and tables in 10.5.
  • Loading branch information
haidong authored and cvicentiu committed Sep 10, 2021
1 parent 7c33ecb commit cc71dc0
Show file tree
Hide file tree
Showing 23 changed files with 383 additions and 219 deletions.
10 changes: 10 additions & 0 deletions mysql-test/suite/perfschema/r/dml_file_instances.result
Expand Up @@ -87,3 +87,13 @@ DROP TABLE t_db_26152751;
SELECT FILE_NAME FROM performance_schema.file_instances WHERE FILE_NAME LIKE "%t_db_26152751%";
FILE_NAME
DROP DATABASE db_26152751;
#
# MDEV-25325 column_comment for performance_shcema tables
#
select column_name, column_comment
from information_schema.columns
where table_schema='performance_schema' and table_name='file_instances';
column_name column_comment
FILE_NAME File name.
EVENT_NAME Instrument name associated with the file.
OPEN_COUNT Open handles on the file. A value of greater than zero means that the file is currently open.
Expand Up @@ -24,3 +24,23 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.memory_summary_by_account_by_event_name WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'memory_summary_by_account_by_event_name'
UNLOCK TABLES;
#
# MDEV-25325 column_comment for performance_shcema tables
#
select column_name, column_comment
from information_schema.columns
where table_schema='performance_schema' and table_name='memory_summary_by_account_by_event_name';
column_name column_comment
USER User portion of the account.
HOST Host portion of the account.
EVENT_NAME Event name.
COUNT_ALLOC Total number of allocations to memory.
COUNT_FREE Total number of attempts to free the allocated memory.
SUM_NUMBER_OF_BYTES_ALLOC Total number of bytes allocated.
SUM_NUMBER_OF_BYTES_FREE Total number of bytes freed
LOW_COUNT_USED Lowest number of allocated blocks (lowest value of CURRENT_COUNT_USED).
CURRENT_COUNT_USED Currently allocated blocks that have not been freed (COUNT_ALLOC minus COUNT_FREE).
HIGH_COUNT_USED Highest number of allocated blocks (highest value of CURRENT_COUNT_USED).
LOW_NUMBER_OF_BYTES_USED Lowest number of bytes used.
CURRENT_NUMBER_OF_BYTES_USED Current number of bytes used (total allocated minus total freed).
HIGH_NUMBER_OF_BYTES_USED Highest number of bytes used.
Expand Up @@ -24,3 +24,22 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.memory_summary_by_host_by_event_name WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'memory_summary_by_host_by_event_name'
UNLOCK TABLES;
#
# MDEV-25325 column_comment for performance_shcema tables
#
select column_name, column_comment
from information_schema.columns
where table_schema='performance_schema' and table_name='memory_summary_by_host_by_event_name';
column_name column_comment
HOST Host portion of the account.
EVENT_NAME Event name.
COUNT_ALLOC Total number of allocations to memory.
COUNT_FREE Total number of attempts to free the allocated memory.
SUM_NUMBER_OF_BYTES_ALLOC Total number of bytes allocated.
SUM_NUMBER_OF_BYTES_FREE Total number of bytes freed
LOW_COUNT_USED Lowest number of allocated blocks (lowest value of CURRENT_COUNT_USED).
CURRENT_COUNT_USED Currently allocated blocks that have not been freed (COUNT_ALLOC minus COUNT_FREE).
HIGH_COUNT_USED Highest number of allocated blocks (highest value of CURRENT_COUNT_USED).
LOW_NUMBER_OF_BYTES_USED Lowest number of bytes used.
CURRENT_NUMBER_OF_BYTES_USED Current number of bytes used (total allocated minus total freed).
HIGH_NUMBER_OF_BYTES_USED Highest number of bytes used.
Expand Up @@ -24,3 +24,22 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.memory_summary_by_user_by_event_name WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'memory_summary_by_user_by_event_name'
UNLOCK TABLES;
#
# MDEV-25325 column_comment for performance_shcema tables
#
select column_name, column_comment
from information_schema.columns
where table_schema='performance_schema' and table_name='memory_summary_by_user_by_event_name';
column_name column_comment
USER User portion of the account.
EVENT_NAME Event name.
COUNT_ALLOC Total number of allocations to memory.
COUNT_FREE Total number of attempts to free the allocated memory.
SUM_NUMBER_OF_BYTES_ALLOC Total number of bytes allocated.
SUM_NUMBER_OF_BYTES_FREE Total number of bytes freed
LOW_COUNT_USED Lowest number of allocated blocks (lowest value of CURRENT_COUNT_USED).
CURRENT_COUNT_USED Currently allocated blocks that have not been freed (COUNT_ALLOC minus COUNT_FREE).
HIGH_COUNT_USED Highest number of allocated blocks (highest value of CURRENT_COUNT_USED).
LOW_NUMBER_OF_BYTES_USED Lowest number of bytes used.
CURRENT_NUMBER_OF_BYTES_USED Current number of bytes used (total allocated minus total freed).
HIGH_NUMBER_OF_BYTES_USED Highest number of bytes used.
18 changes: 18 additions & 0 deletions mysql-test/suite/perfschema/r/dml_mems_global_by_event_name.result
Expand Up @@ -24,3 +24,21 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.memory_summary_global_by_event_name WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'memory_summary_global_by_event_name'
UNLOCK TABLES;
#
# MDEV-25325 column_comment for performance_shcema tables
#
select column_name, column_comment
from information_schema.columns
where table_schema='performance_schema' and table_name='memory_summary_global_by_event_name';
column_name column_comment
EVENT_NAME Event name.
COUNT_ALLOC Total number of allocations to memory.
COUNT_FREE Total number of attempts to free the allocated memory.
SUM_NUMBER_OF_BYTES_ALLOC Total number of bytes allocated.
SUM_NUMBER_OF_BYTES_FREE Total number of bytes freed
LOW_COUNT_USED Lowest number of allocated blocks (lowest value of CURRENT_COUNT_USED).
CURRENT_COUNT_USED Currently allocated blocks that have not been freed (COUNT_ALLOC minus COUNT_FREE).
HIGH_COUNT_USED Highest number of allocated blocks (highest value of CURRENT_COUNT_USED).
LOW_NUMBER_OF_BYTES_USED Lowest number of bytes used.
CURRENT_NUMBER_OF_BYTES_USED Current number of bytes used (total allocated minus total freed).
HIGH_NUMBER_OF_BYTES_USED Highest number of bytes used.
17 changes: 17 additions & 0 deletions mysql-test/suite/perfschema/r/dml_metadata_locks.result
Expand Up @@ -19,3 +19,20 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.metadata_locks WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'metadata_locks'
UNLOCK TABLES;
#
# MDEV-25325 column_comment for performance_shcema tables
#
select column_name, column_comment
from information_schema.columns
where table_schema='performance_schema' and table_name='metadata_locks';
column_name column_comment
OBJECT_TYPE Object type. One of BACKUP, COMMIT, EVENT, FUNCTION, GLOBAL, LOCKING SERVICE, PROCEDURE, SCHEMA, TABLE, TABLESPACE, TRIGGER (unused) or USER LEVEL LOCK.
OBJECT_SCHEMA Object schema.
OBJECT_NAME Object name.
OBJECT_INSTANCE_BEGIN Address in memory of the instrumented object.
LOCK_TYPE Lock type. One of BACKUP_FTWRL1, BACKUP_START, BACKUP_TRANS_DML, EXCLUSIVE, INTENTION_EXCLUSIVE, SHARED, SHARED_HIGH_PRIO, SHARED_NO_READ_WRITE, SHARED_NO_WRITE, SHARED_READ, SHARED_UPGRADABLE or SHARED_WRITE.
LOCK_DURATION Lock duration. One of EXPLICIT (locks released by explicit action, for example a global lock acquired with FLUSH TABLES WITH READ LOCK) , STATEMENT (locks implicitly released at statement end) or TRANSACTION (locks implicitly released at transaction end).
LOCK_STATUS Lock status. One of GRANTED, KILLED, PENDING, POST_RELEASE_NOTIFY, PRE_ACQUIRE_NOTIFY, TIMEOUT or VICTIM.
SOURCE Source file containing the instrumented code that produced the event, as well as the line number where the instrumentation occurred. This allows one to examine the source code involved.
OWNER_THREAD_ID Thread that requested the lock.
OWNER_EVENT_ID Event that requested the lock.
Expand Up @@ -23,3 +23,19 @@ UNLOCK TABLES;
LOCK TABLES performance_schema.replication_applier_status_by_worker WRITE;
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'replication_applier_status_by_worker'
UNLOCK TABLES;
#
# MDEV-25325 column_comment for performance_shcema tables
#
select column_name, column_comment
from information_schema.columns
where table_schema='performance_schema' and table_name='replication_applier_status_by_worker';
column_name column_comment
CHANNEL_NAME Name of replication channel through which the transaction is received.
THREAD_ID Thread_Id as displayed in the performance_schema.threads table for thread with name 'thread/sql/rpl_parallel_thread'. THREAD_ID will be NULL when worker threads are stopped due to error/force stop.
SERVICE_STATE Whether or not the thread is running.
LAST_SEEN_TRANSACTION Last GTID executed by worker
LAST_ERROR_NUMBER Last Error that occurred on a particular worker.
LAST_ERROR_MESSAGE Last error specific message.
LAST_ERROR_TIMESTAMP Time stamp of last error.
WORKER_IDLE_TIME Total idle time in seconds that the worker thread has spent waiting for work from SQL thread.
LAST_TRANS_RETRY_COUNT Total number of retries attempted by last transaction.

0 comments on commit cc71dc0

Please sign in to comment.