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锁统计信息。
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统计信息集合是使用以下选项动态配置的:
To enable the collection of mutex statistics, run:要启用互斥统计信息的收集,请运行:
SET GLOBAL innodb_monitor_enable='latch';
To reset mutex statistics, run:要重置互斥统计信息,请运行:
SET GLOBAL innodb_monitor_reset='latch';
To disable the collection of mutex statistics, run:要禁用互斥统计信息的收集,请运行:
SET GLOBAL innodb_monitor_disable='latch';
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输出具有以下列:
Type
Always 始终是InnoDB.InnoDB。
Name
For mutexes, the 对于互斥体,Name field reports only the mutex name. Name字段只报告互斥体名称。For rwlocks, the 对于rwlock,Name field reports the source file where the rwlock is implemented, and the line number in the file where the rwlock is created. Name字段报告实现rwlock的源文件,以及创建rwlock的文件中的行号。The line number is specific to your version of MySQL.行号特定于您的MySQL版本。
Status
The mutex status. This field reports the number of spins, waits, and calls. Statistics for low-level operating system mutexes, which are implemented outside of 互斥对象状态。此字段报告旋转、等待和呼叫的次数。没有报告在InnoDB, are not reported.InnoDB之外实现的低级别操作系统互斥的统计信息。
spins indicates the number of spins.表示旋转次数。
waits indicates the number of mutex waits.指示互斥体等待的次数。
calls indicates how many times the mutex was requested.指示请求互斥对象的次数。
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值由两部分组成,分别命名内部缓冲区和缓冲区属性。按如下方式解释缓冲区名称:
An internal buffer that is not exposed as a table is named within parentheses. 未公开为表的内部缓冲区在括号内命名。Examples: 示例:(pfs_cond_class).size, (pfs_mutex_class).memory.(pfs_cond_class).size、(pfs_mutex_class).memory。
An internal buffer that is exposed as a table in the 在performance_schema数据库中公开为表的内部缓冲区以该表命名,不带括号。performance_schema database is named after the table, without parentheses. Examples: 示例:events_waits_history.size, mutex_instances.count.events_waits_historysize、mutex_instances.count。
A value that applies to the Performance Schema as a whole begins with 应用于整个性能模式的值以performance_schema. Example: performance_schema.memory.performance_Schema开头。示例:performance_schemamemory。
Buffer attributes have these meanings:缓冲区属性具有以下含义:
size is the size of the internal record used by the implementation, such as the size of a row in a table. 是实现所使用的内部记录的大小,例如表中一行的大小。size values cannot be changed.值不能更改。
count is the number of internal records, such as the number of rows in a table. 是内部记录的数量,例如表中的行数。count values can be changed using Performance Schema configuration options.可以使用性能架构配置选项更改值。
For a table, 对于表, is the product of tbl_name.memorysize and count. tbl_name.memory是大小和计数的乘积。For the Performance Schema as a whole, 对于整个性能模式,performance_schema.memory is the sum of all the memory used (the sum of all other memory values).performance_schema.memory是所使用的所有内存的总和(所有其他memory值的总和)。
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_size。In 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列包含下表中描述的名称/值对。
| Name | Value |
|---|---|
cluster_node_id | |
connected_host | |
connected_port | connected_host)connected_host) |
number_of_data_nodes | [ndbd] sections in the cluster config.ini file)config.ini文件中[ndbd]节的数量) |
number_of_ready_data_nodes | |
connect_count |
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群集复制相关的信息。下表介绍了它所包含的名称/值对。
| Name | Value |
|---|---|
latest_epoch | |
latest_trans_epoch | |
latest_received_binlog_epoch | |
latest_handled_binlog_epoch | |
latest_applied_binlog_epoch |
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输出中最有可能在监控集群中有用的其余行按名称列出:
NdbTransaction: The number and size of :已创建的NdbTransaction objects that have been created. NdbTransaction对象的数量和大小。An 每次对NDB表执行表架构操作(如NdbTransaction is created each time a table schema operation (such as CREATE TABLE or ALTER TABLE) is performed on an NDB table.CREATE TABLE或ALTER TABLE)时,都会创建NdbTransaction。
NdbOperation: The number and size of :已创建的NdbOperation objects that have been created.NdbOperation对象的数量和大小。
NdbIndexScanOperation: The number and size of :已创建的NdbIndexScanOperation objects that have been created.NdbIndexScanOperation对象的数量和大小。
NdbIndexOperation: The number and size of :已创建的NdbIndexOperation objects that have been created.NdbIndexOperation对象的数量和大小。
NdbRecAttr: The number and size of :已创建的NdbRecAttr objects that have been created. NdbRecAttr对象的数量和大小。In general, one of these is created each time a data manipulation statement is performed by an SQL node.通常,每次SQL节点执行数据操作语句时,都会创建其中一个。
NdbBlob: The number and size of :已创建的NdbBlob objects that have been created. An NdbBlob is created for each new operation involving a BLOB column in an NDB table.NdbBlob对象的数量和大小。对于涉及NDB表中BLOB列的每个新操作,都会创建一个NdbBlob。
NdbReceiver: The number and size of any :已创建的任何NdbReceiver object that have been created. NdbReceiver对象的数量和大小。The number in the created column is the same as the number of data nodes in the cluster to which the MySQL server has connected.created列中的数字与MySQL服务器连接到的集群中的数据节点数相同。
SHOW ENGINE NDB STATUS returns an empty result if no operations involving 如果MySQL客户端访问运行此语句的SQL节点,在当前会话期间未执行任何涉及NDB tables have been performed during the current session by the MySQL client accessing the SQL node on which this statement is run.NDB表的操作,则返回空结果。