This documentation is for an older version. If you're using the most current version, select the documentation for that version with the version switch in the upper right corner of the online documentation, or by downloading a newer PDF or EPUB file.
The MySQL server maintains many status variables that provide
information about its operation. You can view these variables and
their values by using the SHOW [GLOBAL | SESSION]
STATUS
statement (see Section 13.7.5.32, “SHOW STATUS Syntax”).
The optional GLOBAL
keyword aggregates the
values over all connections, and SESSION
shows
the values for the current connection.
mysql> SHOW GLOBAL STATUS;
+-----------------------------------+------------+
| Variable_name | Value |
+-----------------------------------+------------+
| Aborted_clients | 0 |
| Aborted_connects | 0 |
| Bytes_received | 155372598 |
| Bytes_sent | 1176560426 |
...
| Connections | 30023 |
| Created_tmp_disk_tables | 0 |
| Created_tmp_files | 3 |
| Created_tmp_tables | 2 |
...
| Threads_created | 217 |
| Threads_running | 88 |
| Uptime | 1389872 |
+-----------------------------------+------------+
Before MySQL 5.0.2, SHOW STATUS
returned global status values. Because the default as of 5.0.2
is to return session values, this is incompatible with previous
versions. To issue a SHOW STATUS
statement that will retrieve global status values for all
versions of MySQL, write it like this:
SHOW /*!50002 GLOBAL */ STATUS;
Several status variables provide statement counts. To determine the number of statements executed, use these relationships:
SUM(Com_xxx) + Qcache_hits = Questions + statements executed within stored programs = Queries
Many status variables are reset to 0 by the
FLUSH STATUS
statement.
The following table lists all available server status variables:
Table 5.4 Status Variable Summary
Variable Name | Variable Type | Variable Scope |
---|---|---|
Aborted_clients | integer | GLOBAL |
Aborted_connects | integer | GLOBAL |
Binlog_cache_disk_use | integer | GLOBAL |
Binlog_cache_use | integer | GLOBAL |
Bytes_received | integer | GLOBAL | SESSION |
Bytes_sent | integer | GLOBAL | SESSION |
Com_admin_commands | integer | GLOBAL | SESSION |
Com_alter_db | integer | GLOBAL | SESSION |
Com_alter_event | integer | GLOBAL | SESSION |
Com_alter_table | integer | GLOBAL | SESSION |
Com_analyze | integer | GLOBAL | SESSION |
Com_backup_table | integer | GLOBAL | SESSION |
Com_begin | integer | GLOBAL | SESSION |
Com_call_procedure | integer | GLOBAL | SESSION |
Com_change_db | integer | GLOBAL | SESSION |
Com_change_master | integer | GLOBAL | SESSION |
Com_check | integer | GLOBAL | SESSION |
Com_checksum | integer | GLOBAL | SESSION |
Com_commit | integer | GLOBAL | SESSION |
Com_create_db | integer | GLOBAL | SESSION |
Com_create_event | integer | GLOBAL | SESSION |
Com_create_function | integer | GLOBAL | SESSION |
Com_create_index | integer | GLOBAL | SESSION |
Com_create_table | integer | GLOBAL | SESSION |
Com_create_user | integer | GLOBAL | SESSION |
Com_dealloc_sql | integer | GLOBAL | SESSION |
Com_delete | integer | GLOBAL | SESSION |
Com_delete_multi | integer | GLOBAL | SESSION |
Com_do | integer | GLOBAL | SESSION |
Com_drop_db | integer | GLOBAL | SESSION |
Com_drop_event | integer | GLOBAL | SESSION |
Com_drop_function | integer | GLOBAL | SESSION |
Com_drop_index | integer | GLOBAL | SESSION |
Com_drop_table | integer | GLOBAL | SESSION |
Com_drop_user | integer | GLOBAL | SESSION |
Com_execute_sql | integer | GLOBAL | SESSION |
Com_flush | integer | GLOBAL | SESSION |
Com_grant | integer | GLOBAL | SESSION |
Com_ha_close | integer | GLOBAL | SESSION |
Com_ha_open | integer | GLOBAL | SESSION |
Com_ha_read | integer | GLOBAL | SESSION |
Com_help | integer | GLOBAL | SESSION |
Com_insert | integer | GLOBAL | SESSION |
Com_insert_select | integer | GLOBAL | SESSION |
Com_kill | integer | GLOBAL | SESSION |
Com_load | integer | GLOBAL | SESSION |
Com_lock_tables | integer | GLOBAL | SESSION |
Com_optimize | integer | GLOBAL | SESSION |
Com_preload_keys | integer | GLOBAL | SESSION |
Com_prepare_sql | integer | GLOBAL | SESSION |
Com_purge | integer | GLOBAL | SESSION |
Com_purge_before_date | integer | GLOBAL | SESSION |
Com_rename_table | integer | GLOBAL | SESSION |
Com_repair | integer | GLOBAL | SESSION |
Com_replace | integer | GLOBAL | SESSION |
Com_replace_select | integer | GLOBAL | SESSION |
Com_reset | integer | GLOBAL | SESSION |
Com_restore_table | integer | GLOBAL | SESSION |
Com_revoke | integer | GLOBAL | SESSION |
Com_revoke_all | integer | GLOBAL | SESSION |
Com_rollback | integer | GLOBAL | SESSION |
Com_savepoint | integer | GLOBAL | SESSION |
Com_select | integer | GLOBAL | SESSION |
Com_set_option | integer | GLOBAL | SESSION |
Com_show_binlog_events | integer | GLOBAL | SESSION |
Com_show_binlogs | integer | GLOBAL | SESSION |
Com_show_charsets | integer | GLOBAL | SESSION |
Com_show_collations | integer | GLOBAL | SESSION |
Com_show_column_types | integer | GLOBAL | SESSION |
Com_show_create_db | integer | GLOBAL | SESSION |
Com_show_create_event | integer | GLOBAL | SESSION |
Com_show_create_table | integer | GLOBAL | SESSION |
Com_show_databases | integer | GLOBAL | SESSION |
Com_show_engine_logs | integer | GLOBAL | SESSION |
Com_show_engine_mutex | integer | GLOBAL | SESSION |
Com_show_engine_status | integer | GLOBAL | SESSION |
Com_show_errors | integer | GLOBAL | SESSION |
Com_show_events | integer | GLOBAL | SESSION |
Com_show_fields | integer | GLOBAL | SESSION |
Com_show_grants | integer | GLOBAL | SESSION |
Com_show_innodb_status | integer | GLOBAL | SESSION |
Com_show_keys | integer | GLOBAL | SESSION |
Com_show_logs | integer | GLOBAL | SESSION |
Com_show_master_status | integer | GLOBAL | SESSION |
Com_show_ndb_status | integer | GLOBAL | SESSION |
Com_show_new_master | integer | GLOBAL | SESSION |
Com_show_open_tables | integer | GLOBAL | SESSION |
Com_show_plugins | integer | GLOBAL | SESSION |
Com_show_privileges | integer | GLOBAL | SESSION |
Com_show_processlist | integer | GLOBAL | SESSION |
Com_show_slave_hosts | integer | GLOBAL | SESSION |
Com_show_slave_status | integer | GLOBAL | SESSION |
Com_show_status | integer | GLOBAL | SESSION |
Com_show_storage_engines | integer | GLOBAL | SESSION |
Com_show_tables | integer | GLOBAL | SESSION |
Com_show_triggers | integer | GLOBAL | SESSION |
Com_show_variables | integer | GLOBAL | SESSION |
Com_show_warnings | integer | GLOBAL | SESSION |
Com_slave_start | integer | GLOBAL | SESSION |
Com_slave_stop | integer | GLOBAL | SESSION |
Com_stmt_close | integer | GLOBAL | SESSION |
Com_stmt_execute | integer | GLOBAL | SESSION |
Com_stmt_fetch | integer | GLOBAL | SESSION |
Com_stmt_prepare | integer | GLOBAL | SESSION |
Com_stmt_reset | integer | GLOBAL | SESSION |
Com_stmt_send_long_data | integer | GLOBAL | SESSION |
Com_truncate | integer | GLOBAL | SESSION |
Com_unlock_tables | integer | GLOBAL | SESSION |
Com_update | integer | GLOBAL | SESSION |
Com_update_multi | integer | GLOBAL | SESSION |
Com_xa_commit | integer | GLOBAL | SESSION |
Com_xa_end | integer | GLOBAL | SESSION |
Com_xa_prepare | integer | GLOBAL | SESSION |
Com_xa_recover | integer | GLOBAL | SESSION |
Com_xa_rollback | integer | GLOBAL | SESSION |
Com_xa_start | integer | GLOBAL | SESSION |
Compression | integer | SESSION |
Connections | integer | GLOBAL |
Created_tmp_disk_tables | integer | GLOBAL | SESSION |
Created_tmp_files | integer | GLOBAL |
Created_tmp_tables | integer | GLOBAL | SESSION |
Delayed_errors | integer | GLOBAL |
Delayed_insert_threads | integer | GLOBAL |
Delayed_writes | integer | GLOBAL |
Flush_commands | integer | GLOBAL |
Handler_commit | integer | GLOBAL | SESSION |
Handler_delete | integer | GLOBAL | SESSION |
Handler_discover | integer | GLOBAL | SESSION |
Handler_prepare | integer | GLOBAL | SESSION |
Handler_read_first | integer | GLOBAL | SESSION |
Handler_read_key | integer | GLOBAL | SESSION |
Handler_read_next | integer | GLOBAL | SESSION |
Handler_read_prev | integer | GLOBAL | SESSION |
Handler_read_rnd | integer | GLOBAL | SESSION |
Handler_read_rnd_next | integer | GLOBAL | SESSION |
Handler_rollback | integer | GLOBAL | SESSION |
Handler_savepoint | integer | GLOBAL | SESSION |
Handler_savepoint_rollback | integer | GLOBAL | SESSION |
Handler_update | integer | GLOBAL | SESSION |
Handler_write | integer | GLOBAL | SESSION |
Innodb_buffer_pool_pages_data | integer | GLOBAL |
Innodb_buffer_pool_pages_dirty | integer | GLOBAL |
Innodb_buffer_pool_pages_flushed | integer | GLOBAL |
Innodb_buffer_pool_pages_free | integer | GLOBAL |
Innodb_buffer_pool_pages_latched | integer | GLOBAL |
Innodb_buffer_pool_pages_misc | integer | GLOBAL |
Innodb_buffer_pool_pages_total | integer | GLOBAL |
Innodb_buffer_pool_read_ahead_rnd | integer | GLOBAL |
Innodb_buffer_pool_read_ahead_seq | integer | GLOBAL |
Innodb_buffer_pool_read_requests | integer | GLOBAL |
Innodb_buffer_pool_reads | integer | GLOBAL |
Innodb_buffer_pool_wait_free | integer | GLOBAL |
Innodb_buffer_pool_write_requests | integer | GLOBAL |
Innodb_data_fsyncs | integer | GLOBAL |
Innodb_data_pending_fsyncs | integer | GLOBAL |
Innodb_data_pending_reads | integer | GLOBAL |
Innodb_data_pending_writes | integer | GLOBAL |
Innodb_data_read | integer | GLOBAL |
Innodb_data_reads | integer | GLOBAL |
Innodb_data_writes | integer | GLOBAL |
Innodb_data_written | integer | GLOBAL |
Innodb_dblwr_pages_written | integer | GLOBAL |
Innodb_dblwr_writes | integer | GLOBAL |
Innodb_log_waits | integer | GLOBAL |
Innodb_log_write_requests | integer | GLOBAL |
Innodb_log_writes | integer | GLOBAL |
Innodb_os_log_fsyncs | integer | GLOBAL |
Innodb_os_log_pending_fsyncs | integer | GLOBAL |
Innodb_os_log_pending_writes | integer | GLOBAL |
Innodb_os_log_written | integer | GLOBAL |
Innodb_page_size | integer | GLOBAL |
Innodb_pages_created | integer | GLOBAL |
Innodb_pages_read | integer | GLOBAL |
Innodb_pages_written | integer | GLOBAL |
Innodb_row_lock_current_waits | integer | GLOBAL |
Innodb_row_lock_time | integer | GLOBAL |
Innodb_row_lock_time_avg | integer | GLOBAL |
Innodb_row_lock_time_max | integer | GLOBAL |
Innodb_row_lock_waits | integer | GLOBAL |
Innodb_rows_deleted | integer | GLOBAL |
Innodb_rows_inserted | integer | GLOBAL |
Innodb_rows_read | integer | GLOBAL |
Innodb_rows_updated | integer | GLOBAL |
Key_blocks_not_flushed | integer | GLOBAL |
Key_blocks_unused | integer | GLOBAL |
Key_blocks_used | integer | GLOBAL |
Key_read_requests | integer | GLOBAL |
Key_reads | integer | GLOBAL |
Key_write_requests | integer | GLOBAL |
Key_writes | integer | GLOBAL |
Last_query_cost | numeric | SESSION |
Max_used_connections | integer | GLOBAL |
Ndb_cluster_node_id | integer | GLOBAL | SESSION |
Ndb_config_from_host | integer | GLOBAL | SESSION |
Ndb_config_from_port | integer | GLOBAL | SESSION |
Ndb_cluster_node_id | integer | GLOBAL |
Not_flushed_delayed_rows | integer | GLOBAL |
Open_files | integer | GLOBAL |
Open_streams | integer | GLOBAL |
Open_tables | integer | GLOBAL | SESSION |
Opened_tables | integer | GLOBAL | SESSION |
Prepared_stmt_count | integer | GLOBAL |
Qcache_free_blocks | integer | GLOBAL |
Qcache_free_memory | integer | GLOBAL |
Qcache_hits | integer | GLOBAL |
Qcache_inserts | integer | GLOBAL |
Qcache_lowmem_prunes | integer | GLOBAL |
Qcache_not_cached | integer | GLOBAL |
Qcache_queries_in_cache | integer | GLOBAL |
Qcache_total_blocks | integer | GLOBAL |
Queries | integer | GLOBAL | SESSION |
Questions | integer | GLOBAL | SESSION |
Rpl_status | string | GLOBAL |
Select_full_join | integer | GLOBAL | SESSION |
Select_full_range_join | integer | GLOBAL | SESSION |
Select_range | integer | GLOBAL | SESSION |
Select_range_check | integer | GLOBAL | SESSION |
Select_scan | integer | GLOBAL | SESSION |
Slave_open_temp_tables | integer | GLOBAL |
Slave_retried_transactions | integer | GLOBAL |
Slave_running | boolean | GLOBAL |
Slow_launch_threads | integer | GLOBAL | SESSION |
Slow_queries | integer | GLOBAL | SESSION |
Sort_merge_passes | integer | GLOBAL | SESSION |
Sort_range | integer | GLOBAL | SESSION |
Sort_rows | integer | GLOBAL | SESSION |
Sort_scan | integer | GLOBAL | SESSION |
Ssl_accept_renegotiates | integer | GLOBAL |
Ssl_accepts | integer | GLOBAL |
Ssl_callback_cache_hits | integer | GLOBAL |
Ssl_cipher | string | GLOBAL | SESSION |
Ssl_cipher_list | string | GLOBAL | SESSION |
Ssl_client_connects | integer | GLOBAL |
Ssl_connect_renegotiates | integer | GLOBAL |
Ssl_ctx_verify_depth | integer | GLOBAL |
Ssl_ctx_verify_mode | integer | GLOBAL |
Ssl_default_timeout | integer | GLOBAL | SESSION |
Ssl_finished_accepts | integer | GLOBAL |
Ssl_finished_connects | integer | GLOBAL |
Ssl_session_cache_hits | integer | GLOBAL |
Ssl_session_cache_misses | integer | GLOBAL |
Ssl_session_cache_mode | string | GLOBAL |
Ssl_session_cache_overflows | integer | GLOBAL |
Ssl_session_cache_size | integer | GLOBAL |
Ssl_session_cache_timeouts | integer | GLOBAL |
Ssl_sessions_reused | integer | GLOBAL | SESSION |
Ssl_used_session_cache_entries | integer | GLOBAL |
Ssl_verify_depth | integer | GLOBAL | SESSION |
Ssl_verify_mode | integer | GLOBAL | SESSION |
Ssl_version | string | GLOBAL | SESSION |
Table_locks_immediate | integer | GLOBAL |
Table_locks_waited | integer | GLOBAL |
Tc_log_max_pages_used | integer | GLOBAL |
Tc_log_page_size | integer | GLOBAL |
Tc_log_page_waits | integer | GLOBAL |
Threads_cached | integer | GLOBAL |
Threads_connected | integer | GLOBAL |
Threads_created | integer | GLOBAL |
Threads_running | integer | GLOBAL |
Uptime | integer | GLOBAL |
Uptime_since_flush_status | integer | GLOBAL |
The status variables have the following meanings. For meanings of status variables specific to MySQL Cluster, see Section 17.3.3.7.3, “MySQL Cluster Status Variables”.
The number of connections that were aborted because the client died without closing the connection properly. See Section B.5.2.11, “Communication Errors and Aborted Connections”.
The number of failed attempts to connect to the MySQL server. See Section B.5.2.11, “Communication Errors and Aborted Connections”.
The number of transactions that used the temporary binary log
cache but that exceeded the value of
binlog_cache_size
and used a
temporary file to store statements from the transaction.
The number of transactions that used the temporary binary log cache.
The number of bytes received from all clients.
The number of bytes sent to all clients.
The Com_
statement counter variables indicate the number of times each
xxx
xxx
statement has been executed.
There is one status variable for each type of statement. For
example, Com_delete
and
Com_update
count
DELETE
and
UPDATE
statements,
respectively. Com_delete_multi
and
Com_update_multi
are similar but apply to
DELETE
and
UPDATE
statements that use
multiple-table syntax.
If a query result is returned from query cache, the server
increments the Qcache_hits
status variable, not Com_select
. See
Section 8.10.3.4, “Query Cache Status and Maintenance”.
The discussion at the beginning of this section indicates how to relate these statement-counting status variables to other such variables.
All of the
Com_stmt_
variables are increased even if a prepared statement argument
is unknown or an error occurred during execution. In other
words, their values correspond to the number of requests
issued, not to the number of requests successfully completed.
xxx
The Com_stmt_
status variables were added in 5.0.8:
xxx
Com_stmt_prepare
Com_stmt_execute
Com_stmt_fetch
Com_stmt_send_long_data
Com_stmt_reset
Com_stmt_close
Those variables stand for prepared statement commands. Their
names refer to the
COM_
command
set used in the network layer. In other words, their values
increase whenever prepared statement API calls such as
mysql_stmt_prepare(),
mysql_stmt_execute(), and so forth are
executed. However, xxx
Com_stmt_prepare
,
Com_stmt_execute
and
Com_stmt_close
also increase for
PREPARE
,
EXECUTE
, or
DEALLOCATE PREPARE
,
respectively. Additionally, the values of the older statement
counter variables Com_prepare_sql
,
Com_execute_sql
, and
Com_dealloc_sql
increase for the
PREPARE
,
EXECUTE
, and
DEALLOCATE PREPARE
statements.
Com_stmt_fetch
stands for the total number
of network round-trips issued when fetching from cursors.
Whether the client connection uses compression in the client/server protocol. Added in MySQL 5.0.16.
The number of connection attempts (successful or not) to the MySQL server.
The number of internal on-disk temporary tables created by the server while executing statements.
If an internal temporary table is created initially as an
in-memory table but becomes too large, MySQL automatically
converts it to an on-disk table. The maximum size for
in-memory temporary tables is the minimum of the
tmp_table_size
and
max_heap_table_size
values.
If Created_tmp_disk_tables
is large, you may want to increase the
tmp_table_size
or
max_heap_table_size
value to
lessen the likelihood that internal temporary tables in memory
will be converted to on-disk tables.
You can compare the number of internal on-disk temporary
tables created to the total number of internal temporary
tables created by comparing the values of the
Created_tmp_disk_tables
and
Created_tmp_tables
variables.
See also Section 8.4.4, “Internal Temporary Table Use in MySQL”.
How many temporary files mysqld has created.
The number of internal temporary tables created by the server while executing statements.
You can compare the number of internal on-disk temporary
tables created to the total number of internal temporary
tables created by comparing the values of the
Created_tmp_disk_tables
and
Created_tmp_tables
variables.
See also Section 8.4.4, “Internal Temporary Table Use in MySQL”.
The number of rows written with INSERT
DELAYED
for which some error occurred (probably
duplicate key
).
The number of INSERT DELAYED
handler threads in use.
The number of INSERT DELAYED
rows written.
The number of times the server flushes tables, whether because
a user executed a FLUSH
TABLES
statement or due to internal server
operation. It is also incremented by receipt of a
COM_REFRESH
packet. This is in contrast to
Com_flush
,
which indicates how many FLUSH
statements
have been executed, whether
FLUSH TABLES
,
FLUSH LOGS
,
and so forth.
The number of internal COMMIT
statements.
The number of times that rows have been deleted from tables.
A counter for the prepare phase of two-phase commit operations. Added in MySQL 5.0.3.
The number of times the first entry in an index was read. If
this value is high, it suggests that the server is doing a lot
of full index scans; for example, SELECT col1 FROM
foo
, assuming that col1
is
indexed.
The number of requests to read a row based on a key. If this value is high, it is a good indication that your tables are properly indexed for your queries.
The number of requests to read the next row in key order. This value is incremented if you are querying an index column with a range constraint or if you are doing an index scan.
The number of requests to read the previous row in key order.
This read method is mainly used to optimize ORDER BY
... DESC
.
The number of requests to read a row based on a fixed position. This value is high if you are doing a lot of queries that require sorting of the result. You probably have a lot of queries that require MySQL to scan entire tables or you have joins that do not use keys properly.
The number of requests to read the next row in the data file. This value is high if you are doing a lot of table scans. Generally this suggests that your tables are not properly indexed or that your queries are not written to take advantage of the indexes you have.
The number of requests for a storage engine to perform a rollback operation.
The number of requests for a storage engine to place a savepoint. Added in MySQL 5.0.3.
The number of requests for a storage engine to roll back to a savepoint. Added in MySQL 5.0.3.
The number of requests to update a row in a table.
The number of requests to insert a row in a table.
The number of pages containing data (dirty or clean). Added in MySQL 5.0.2.
Innodb_buffer_pool_pages_dirty
The number of pages currently dirty. Added in MySQL 5.0.2.
Innodb_buffer_pool_pages_flushed
The number of buffer pool page-flush requests. Added in MySQL 5.0.2.
The number of free pages. Added in MySQL 5.0.2.
Innodb_buffer_pool_pages_latched
The number of latched pages in InnoDB
buffer pool. These are pages currently being read or written
or that cannot be flushed or removed for some other reason.
Added in MySQL 5.0.2. Calculation of this variable is
expensive, so as of MySQL 5.0.68, it is available only when
the UNIV_DEBUG
system is defined at server
build time.
The number of pages that are busy because they have been
allocated for administrative overhead such as row locks or the
adaptive hash index. This value can also be calculated as
Innodb_buffer_pool_pages_total
−
Innodb_buffer_pool_pages_free
−
Innodb_buffer_pool_pages_data
.
Added in MySQL 5.0.2.
Innodb_buffer_pool_pages_total
The total size of buffer pool, in pages. Added in MySQL 5.0.2.
Innodb_buffer_pool_read_ahead_rnd
The number of “random” read-aheads initiated by
InnoDB
. This happens when a query scans a
large portion of a table but in random order. Added in MySQL
5.0.2.
Innodb_buffer_pool_read_ahead_seq
The number of sequential read-aheads initiated by
InnoDB
. This happens when
InnoDB
does a sequential full table scan.
Added in MySQL 5.0.2.
Innodb_buffer_pool_read_requests
The number of logical read requests. Added in MySQL 5.0.2.
The number of logical reads that InnoDB
could not satisfy from the buffer pool, and had to read
directly from the disk.
Normally, writes to the InnoDB
buffer pool
happen in the background. However, if it is necessary to read
or create a page and no clean pages are available, it is also
necessary to wait for pages to be flushed first. This counter
counts instances of these waits. If the buffer pool size has
been set properly, this value should be small. Added in MySQL
5.0.2.
Innodb_buffer_pool_write_requests
The number writes done to the InnoDB
buffer
pool. Added in MySQL 5.0.2.
The number of fsync()
operations so far.
Added in MySQL 5.0.2.
The current number of pending fsync()
operations. Added in MySQL 5.0.2.
The current number of pending reads. Added in MySQL 5.0.2.
The current number of pending writes. Added in MySQL 5.0.2.
The amount of data read since the server was started. Added in MySQL 5.0.2.
The total number of data reads. Added in MySQL 5.0.2.
The total number of data writes. Added in MySQL 5.0.2.
The amount of data written so far, in bytes. Added in MySQL 5.0.2.
The number of pages that have been written for doublewrite operations. Added in MySQL 5.0.2. See Section 14.2.11.1, “InnoDB Disk I/O”.
The number of doublewrite operations that have been performed. Added in MySQL 5.0.2. See Section 14.2.11.1, “InnoDB Disk I/O”.
The number of times that the log buffer was too small and a wait was required for it to be flushed before continuing. Added in MySQL 5.0.2.
The number of log write requests. Added in MySQL 5.0.2.
The number of physical writes to the log file. Added in MySQL 5.0.2.
The number of fsync()
writes done to the
log file. Added in MySQL 5.0.2.
The number of pending log file fsync()
operations. Added in MySQL 5.0.2.
The number of pending log file writes. Added in MySQL 5.0.2.
The number of bytes written to the log file. Added in MySQL 5.0.2.
The compiled-in InnoDB
page size (default
16KB). Many values are counted in pages; the page size permits
them to be easily converted to bytes. Added in MySQL 5.0.2.
The number of pages created. Added in MySQL 5.0.2.
The number of pages read. Added in MySQL 5.0.2.
The number of pages written. Added in MySQL 5.0.2.
The number of row locks currently being waited for. Added in MySQL 5.0.3.
The total time spent in acquiring row locks, in milliseconds. Added in MySQL 5.0.3.
The average time to acquire a row lock, in milliseconds. Added in MySQL 5.0.3.
The maximum time to acquire a row lock, in milliseconds. Added in MySQL 5.0.3.
The number of times a row lock had to be waited for. Added in MySQL 5.0.3.
The number of rows deleted from InnoDB
tables. Added in MySQL 5.0.2.
The number of rows inserted into InnoDB
tables. Added in MySQL 5.0.2.
The number of rows read from InnoDB
tables.
Added in MySQL 5.0.2.
The number of rows updated in InnoDB
tables. Added in MySQL 5.0.2.
The number of key blocks in the key cache that have changed but have not yet been flushed to disk.
The number of unused blocks in the key cache. You can use this
value to determine how much of the key cache is in use; see
the discussion of
key_buffer_size
in
Section 5.1.4, “Server System Variables”.
The number of used blocks in the key cache. This value is a high-water mark that indicates the maximum number of blocks that have ever been in use at one time.
The number of requests to read a key block from the cache.
The number of physical reads of a key block from disk. If
Key_reads
is large, then
your key_buffer_size
value is
probably too small. The cache miss rate can be calculated as
Key_reads
/Key_read_requests
.
The number of requests to write a key block to the cache.
The number of physical writes of a key block to disk.
The total cost of the last compiled query as computed by the
query optimizer. This is useful for comparing the cost of
different query plans for the same query. The default value of
0 means that no query has been compiled yet. This variable was
added in MySQL 5.0.1, with a default value of -1. In MySQL
5.0.7, the default was changed to 0; also in version 5.0.7,
the scope of Last_query_cost
was changed to session rather than global.
The Last_query_cost
value
can be computed accurately only for simple “flat”
queries, not complex queries such as those with subqueries or
UNION
. For the latter, the
value is set to 0.
Prior to MySQL 5.0.16, this variable was not updated for queries served from the query cache.
The maximum number of connections that have been in use simultaneously since the server started.
The number of rows waiting to be written in
INSERT DELAYED
queues.
The number of files that are open. This count includes regular files opened by the server. It does not include other types of files such as sockets or pipes. Also, the count does not include files that storage engines open using their own internal functions rather than asking the server level to do so.
The number of streams that are open (used mainly for logging).
The number of tables that are open.
The number of tables that have been opened. If
Opened_tables
is big, your
table_cache
value is probably
too small.
The current number of prepared statements. (The maximum number
of statements is given by the
max_prepared_stmt_count
system variable.) This variable was added in MySQL 5.0.32.
The number of free memory blocks in the query cache.
The amount of free memory for the query cache.
The number of query cache hits.
The discussion at the beginning of this section indicates how to relate this statement-counting status variable to other such variables.
The number of queries added to the query cache.
The number of queries that were deleted from the query cache because of low memory.
The number of noncached queries (not cacheable, or not cached
due to the query_cache_type
setting).
The number of queries registered in the query cache.
The total number of blocks in the query cache.
The number of statements executed by the server. This variable
includes statements executed within stored programs, unlike
the Questions
variable. It
does not count COM_PING
or
COM_STATISTICS
commands. This variable was
added in MySQL 5.0.76.
The discussion at the beginning of this section indicates how to relate this statement-counting status variable to other such variables.
The number of statements executed by the server. As of MySQL
5.0.72, this includes only statements sent to the server by
clients and no longer includes statements executed within
stored programs, unlike the
Queries
variable. This
variable does not count COM_PING
,
COM_STATISTICS
,
COM_STMT_PREPARE
,
COM_STMT_CLOSE
, or
COM_STMT_RESET
commands.
The discussion at the beginning of this section indicates how to relate this statement-counting status variable to other such variables.
The status of fail-safe replication (not implemented). This variable is unused and is removed in MySQL 5.6.
The number of joins that perform table scans because they do not use indexes. If this value is not 0, you should carefully check the indexes of your tables.
The number of joins that used a range search on a reference table.
The number of joins that used ranges on the first table. This is normally not a critical issue even if the value is quite large.
The number of joins without keys that check for key usage after each row. If this is not 0, you should carefully check the indexes of your tables.
The number of joins that did a full scan of the first table.
The number of temporary tables that the slave SQL thread currently has open. If the value is greater than zero, it is not safe to shut down the slave; see Section 16.4.1.16, “Replication and Temporary Tables”.
The total number of times since startup that the replication slave SQL thread has retried transactions. This variable was added in version 5.0.4.
This is ON
if this server is a replication
slave that is connected to a replication master, and both the
I/O and SQL threads are running; otherwise, it is
OFF
.
The number of threads that have taken more than
slow_launch_time
seconds to
create.
The number of queries that have taken more than
long_query_time
seconds. This
counter increments regardless of whether the slow query log is
enabled. For information about that log, see
Section 5.4.4, “The Slow Query Log”.
The number of merge passes that the sort algorithm has had to
do. If this value is large, you should consider increasing the
value of the sort_buffer_size
system variable.
The number of sorts that were done using ranges.
The number of sorted rows.
The number of sorts that were done by scanning the table.
The number of negotiates needed to establish the connection.
The number of accepted SSL connections.
The number of callback cache hits.
The current encryption cipher (empty for unencrypted connections).
The list of possible SSL ciphers (empty for non-SSL connections).
The number of SSL connection attempts to an SSL-enabled master.
The number of negotiates needed to establish the connection to an SSL-enabled master.
The SSL context verification depth (how many certificates in the chain are tested).
The SSL context verification mode.
The default SSL timeout.
The number of successful SSL connections to the server.
The number of successful slave connections to an SSL-enabled master.
The number of SSL session cache hits.
The number of SSL session cache misses.
The SSL session cache mode.
The number of SSL session cache overflows.
The SSL session cache size.
The number of SSL session cache timeouts.
How many SSL connections were reused from the cache.
Ssl_used_session_cache_entries
How many SSL session cache entries were used.
The verification depth for replication SSL connections.
The verification mode for replication SSL connections.
The SSL protocol version of the connection; for example, TLSv1. If the connection is not encrypted, the value is empty.
The number of times that a request for a table lock could be granted immediately.
The number of times that a request for a table lock could not be granted immediately and a wait was needed. If this is high and you have performance problems, you should first optimize your queries, and then either split your table or tables or use replication.
For the memory-mapped implementation of the log that is used
by mysqld when it acts as the transaction
coordinator for recovery of internal XA transactions, this
variable indicates the largest number of pages used for the
log since the server started. If the product of
Tc_log_max_pages_used
and
Tc_log_page_size
is always
significantly less than the log size, the size is larger than
necessary and can be reduced. (The size is set by the
--log-tc-size
option. This
variable is unused: It is unneeded for binary log-based
recovery, and the memory-mapped recovery log method is not
used unless the number of storage engines that are capable of
two-phase commit and that support XA transactions is greater
than one. (InnoDB
is the only applicable
engine.) Added in MySQL 5.0.3.
The page size used for the memory-mapped implementation of the
XA recovery log. The default value is determined using
getpagesize()
. This variable is unused for
the same reasons as described for
Tc_log_max_pages_used
. Added
in MySQL 5.0.3.
For the memory-mapped implementation of the recovery log, this
variable increments each time the server was not able to
commit a transaction and had to wait for a free page in the
log. If this value is large, you might want to increase the
log size (with the
--log-tc-size
option). For
binary log-based recovery, this variable increments each time
the binary log cannot be closed because there are two-phase
commits in progress. (The close operation waits until all such
transactions are finished.) Added in MySQL 5.0.3.
The number of threads in the thread cache.
The number of currently open connections.
The number of threads created to handle connections. If
Threads_created
is big, you
may want to increase the
thread_cache_size
value. The
cache miss rate can be calculated as
Threads_created
/Connections
.
The number of threads that are not sleeping.
The number of seconds that the server has been up.
The number of seconds since the most recent FLUSH
STATUS
statement. This variable was added in 5.0.35.
(MySQL Community only)