13.7.7.15 SHOW ENGINE Statement语句

SHOW ENGINE engine_name {STATUS | MUTEX}

SHOW ENGINE displays operational information about a storage engine. SHOW ENGINE显示有关存储引擎的操作信息。It requires the PROCESS privilege. 它需要PROCESS权限。The statement has these variants:该声明有以下变体:

SHOW ENGINE INNODB STATUS
SHOW ENGINE INNODB MUTEX
SHOW ENGINE PERFORMANCE_SCHEMA STATUS

SHOW ENGINE INNODB STATUS displays extensive information from the standard InnoDB Monitor about the state of the InnoDB storage engine. SHOW ENGINE InnoDB STATUS显示来自标准InnoDB Monitor的关于InnoDB存储引擎状态的大量信息。For information about the standard monitor and other InnoDB Monitors that provide information about InnoDB processing, see Section 15.17, “InnoDB Monitors”.有关标准监视器和其他提供InnoDB处理信息的InnoDB监视器的信息,请参阅第15.17节,“InnoDB监视器”

SHOW ENGINE INNODB MUTEX displays InnoDB mutex and rw-lock statistics.SHOW ENGINE InnoDB MUTEX显示InnoDB互斥rw锁统计信息。

Note注意

InnoDB mutexes and rwlocks can also be monitored using Performance Schema tables. InnoDB互斥和rwlock也可以使用性能模式表进行监控。See Section 15.16.2, “Monitoring InnoDB Mutex Waits Using Performance Schema”.请参阅第15.16.2节,“使用性能模式监视InnoDB互斥等待”

Mutex statistics collection is configured dynamically using the following options:Mutex统计信息集合是使用以下选项动态配置的:

Collection of mutex statistics for SHOW ENGINE INNODB MUTEX can also be enabled by setting innodb_monitor_enable='all', or disabled by setting innodb_monitor_disable='all'.SHOW ENGINE INNODB MUTEX的互斥统计信息的收集也可以通过设置innodb_monitor_enable='all'来启用,或者通过设置innodb_monitor_disable='all'禁用。

SHOW ENGINE INNODB MUTEX output has these columns:SHOW ENGINE InnoDB MUTEX输出具有以下列:

SHOW ENGINE INNODB MUTEX does not list mutexes and rw-locks for each buffer pool block, as the amount of output would be overwhelming on systems with a large buffer pool. 没有列出每个缓冲池块的互斥锁和rw锁,因为在具有大缓冲池的系统上,输出量将是巨大的。SHOW ENGINE INNODB MUTEX does, however, print aggregate BUF_BLOCK_MUTEX spin, wait, and call values for buffer pool block mutexes and rw-locks. 但是,SHOW ENGINE InnoDB MUTEX确实打印缓冲池块互斥和rw锁的聚合BUF_BLOCK_MUTEX旋转、等待和调用值。SHOW ENGINE INNODB MUTEX also does not list any mutexes or rw-locks that have never been waited on (os_waits=0). SHOW ENGINE InnoDB MUTEX也不列出任何从未等待过的互斥锁或rw锁(os_waits=0)。Thus, SHOW ENGINE INNODB MUTEX only displays information about mutexes and rw-locks outside of the buffer pool that have caused at least one OS-level wait.因此,SHOW ENGINE InnoDB MUTEX仅显示有关缓冲池外的互斥和rw锁的信息,这些互斥和rw-锁已导致至少一个操作系统级别的等待

Use SHOW ENGINE PERFORMANCE_SCHEMA STATUS to inspect the internal operation of the Performance Schema code:使用SHOW ENGINE PERFORMANCE_SCHEMA STATUS检查性能模式代码的内部操作:

mysql> SHOW ENGINE PERFORMANCE_SCHEMA STATUS\G
...
*************************** 3. row ***************************
  Type: performance_schema
  Name: events_waits_history.size
Status: 76
*************************** 4. row ***************************
  Type: performance_schema
  Name: events_waits_history.count
Status: 10000
*************************** 5. row ***************************
  Type: performance_schema
  Name: events_waits_history.memory
Status: 760000
...
*************************** 57. row ***************************
  Type: performance_schema
  Name: performance_schema.memory
Status: 26459600
...

This statement is intended to help the DBA understand the effects that different Performance Schema options have on memory requirements.此语句旨在帮助DBA了解不同的性能模式选项对内存需求的影响。

Name values consist of two parts, which name an internal buffer and a buffer attribute, respectively. Interpret buffer names as follows:Name值由两部分组成,分别命名内部缓冲区和缓冲区属性。按如下方式解释缓冲区名称:

Buffer attributes have these meanings:缓冲区属性具有以下含义:

In some cases, there is a direct relationship between a Performance Schema configuration parameter and a SHOW ENGINE value. 在某些情况下,性能模式配置参数和SHOW ENGINE值之间存在直接关系。For example, events_waits_history_long.count corresponds to performance_schema_events_waits_history_long_size. 例如,events_waits_history_long.count对应于performance_schema_events_waits_history_long_sizeIn other cases, the relationship is more complex. 在其他情况下,这种关系更为复杂。For example, events_waits_history.count corresponds to performance_schema_events_waits_history_size (the number of rows per thread) multiplied by performance_schema_max_thread_instances ( the number of threads).例如,events_waits_history.count对应于performance_schema_events_waits_history_size(每个线程的行数)乘以performance_sschema\umax_thread_instances(线程数)。

SHOW ENGINE NDB STATUS.  If the server has the NDB storage engine enabled, SHOW ENGINE NDB STATUS displays cluster status information such as the number of connected data nodes, the cluster connectstring, and cluster binary log epochs, as well as counts of various Cluster API objects created by the MySQL Server when connected to the cluster. Sample output from this statement is shown here:如果服务器启用了NDB存储引擎,SHOW ENGINE NDB STATUS将显示集群状态信息,如连接的数据节点数、集群连接字符串、集群二进制日志时期,以及MySQL server连接到集群时创建的各种集群API对象的计数。此语句的输出示例如下所示:

mysql> SHOW ENGINE NDB STATUS;
+------------+-----------------------+--------------------------------------------------+
| Type       | Name                  | Status                                           |
+------------+-----------------------+--------------------------------------------------+
| ndbcluster | connection            | cluster_node_id=7,
  connected_host=198.51.100.103, connected_port=1186, number_of_data_nodes=4,
  number_of_ready_data_nodes=3, connect_count=0                                         |
| ndbcluster | NdbTransaction        | created=6, free=0, sizeof=212                    |
| ndbcluster | NdbOperation          | created=8, free=8, sizeof=660                    |
| ndbcluster | NdbIndexScanOperation | created=1, free=1, sizeof=744                    |
| ndbcluster | NdbIndexOperation     | created=0, free=0, sizeof=664                    |
| ndbcluster | NdbRecAttr            | created=1285, free=1285, sizeof=60               |
| ndbcluster | NdbApiSignal          | created=16, free=16, sizeof=136                  |
| ndbcluster | NdbLabel              | created=0, free=0, sizeof=196                    |
| ndbcluster | NdbBranch             | created=0, free=0, sizeof=24                     |
| ndbcluster | NdbSubroutine         | created=0, free=0, sizeof=68                     |
| ndbcluster | NdbCall               | created=0, free=0, sizeof=16                     |
| ndbcluster | NdbBlob               | created=1, free=1, sizeof=264                    |
| ndbcluster | NdbReceiver           | created=4, free=0, sizeof=68                     |
| ndbcluster | binlog                | latest_epoch=155467, latest_trans_epoch=148126,
  latest_received_binlog_epoch=0, latest_handled_binlog_epoch=0,
  latest_applied_binlog_epoch=0                                                         |
+------------+-----------------------+--------------------------------------------------+

The Status column in each of these rows provides information about the MySQL server's connection to the cluster and about the cluster binary log's status, respectively. 每一行中的Status列分别提供有关MySQL服务器与集群的连接和集群二进制日志状态的信息。The Status information is in the form of comma-delimited set of name/value pairs.Status信息采用逗号分隔的一组名称/值对的形式。

The connection row's Status column contains the name/value pairs described in the following table.connection行的Status列包含下表中描述的名称/值对。

NameValue
cluster_node_idThe node ID of the MySQL server in the cluster集群中MySQL服务器的节点ID
connected_hostThe host name or IP address of the cluster management server to which the MySQL server is connectedMySQL服务器所连接的集群管理服务器的主机名或IP地址
connected_portThe port used by the MySQL server to connect to the management server (connected_host)MySQL服务器用于连接到管理服务器的端口(connected_host
number_of_data_nodesThe number of data nodes configured for the cluster (that is, the number of [ndbd] sections in the cluster config.ini file)为集群配置的数据节点数(即集群config.ini文件中[ndbd]节的数量)
number_of_ready_data_nodesThe number of data nodes in the cluster that are actually running群集中实际正在运行的数据节点数
connect_countThe number of times this mysqld has connected or reconnected to cluster data nodesmysqld已连接或重新连接到群集数据节点的次数

The binlog row's Status column contains information relating to NDB Cluster Replication. The name/value pairs it contains are described in the following table.binlog行的Status列包含与NDB群集复制相关的信息。下表介绍了它所包含的名称/值对。

NameValue
latest_epochThe most recent epoch most recently run on this MySQL server (that is, the sequence number of the most recent transaction run on the server)此MySQL服务器上最近运行的最近epoch(即服务器上运行的最近事务的序列号)
latest_trans_epochThe most recent epoch processed by the cluster's data nodes集群的数据节点处理的最近历元
latest_received_binlog_epochThe most recent epoch received by the binary log thread二进制日志线程接收的最新epoch
latest_handled_binlog_epochThe most recent epoch processed by the binary log thread (for writing to the binary log)二进制日志线程处理的最近epoch(用于写入二进制日志)
latest_applied_binlog_epochThe most recent epoch actually written to the binary log实际写入二进制日志的最近历元

See Section 23.6, “NDB Cluster Replication”, for more information.有关更多信息,请参阅第23.6节,“NDB群集复制”

The remaining rows from the output of SHOW ENGINE NDB STATUS which are most likely to prove useful in monitoring the cluster are listed here by Name:SHOW ENGINE NDB STATUS输出中最有可能在监控集群中有用的其余行按名称列出:

Note注意

SHOW ENGINE NDB STATUS returns an empty result if no operations involving NDB tables have been performed during the current session by the MySQL client accessing the SQL node on which this statement is run.如果MySQL客户端访问运行此语句的SQL节点,在当前会话期间未执行任何涉及NDB表的操作,则返回空结果。