mysql---Server Status Variables
2013-04-12 13:12
316 查看
http://dev.mysql.com/doc/refman/5.1/en/server-status-variables.html
The server maintains many status variables that provide information about its operation. You can view these variables and their values by using the
“
aggregates the values over all connections, and
the values for the current connection.
+-----------------------------------+------------+
| 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 |
+-----------------------------------+------------+
[/code]
Many status variables are reset to 0 by the
The following table lists all available server status variables:
Table 5.4. Status Variable Summary
“MySQL Cluster Status Variables”.
The number of connections that were aborted because the client died without closing the connection properly. SeeSection C.5.2.11,
“Communication Errors and Aborted Connections”.
The number of failed attempts to connect to the MySQL server. See Section C.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
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
counter variables indicate the number of times each
has been executed. There is one status variable for each type of statement. For example,
respectively.
similar but apply to
that use multiple-table syntax.
If a query result is returned from query cache, the server increments the
variable, not
“Query Cache Status and Maintenance”.
All of the
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.
The
variables are as follows:
Those variables stand for prepared statement commands. Their names refer to the
set used in the network layer. In other words, their values increase whenever prepared statement API calls such asmysql_stmt_prepare(), mysql_stmt_execute(),
and so forth are executed. However,
increase for
or
and
and
the total number of network round-trips issued when fetching from cursors.
were automatically reprepared by the server after metadata changes to tables or views referred to by the statement. This variable was added in MySQL 5.1.25. A reprepare operation increments
and also
Whether the client connection uses compression in the client/server protocol. Added in MySQL 5.1.2.
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
If
large, you may want to increase the
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
See also Section 8.8.5,
“How MySQL Uses Internal Temporary Tables”.
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
See also Section 8.8.5,
“How MySQL Uses Internal Temporary Tables”.
Each invocation of the
The number of rows written with
The number of
The number of
The number of times the server flushes tables, whether because a user executed a
This is in contrast to
which indicates how many
whether
The number of internal
The number of times that rows have been deleted from tables.
A counter for the prepare phase of two-phase commit operations.
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,
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
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.
The number of requests for a storage engine to roll back to a savepoint.
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).
The number of pages currently dirty.
The number of buffer pool page-flush requests.
The number of free pages.
The number of latched pages in
are pages currently being read or written or that cannot be flushed or removed for some other reason. Calculation of this variable is expensive, so as of MySQL 5.1.28, it is available only when the
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
The total size of the buffer pool, in pages.
(
pool by the read-ahead background thread.
This variable was added in MySQL 5.1.41.
(
pool by the read-ahead background thread that were subsequently evicted without having been accessed by queries.
This variable was added in MySQL 5.1.41.
The number of “random” read-aheads
initiated by
portion of a table but in random order.
For
The number of sequential read-aheads initiated by
This happens when
For
The number of logical read requests
The number of logical reads that
from the buffer pool, and had to read directly from the disk.
Normally, writes to 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.
The number writes done to the
The number of
The current number of pending
The current number of pending reads.
The current number of pending writes.
The amount of data read since the server was started.
The total number of data reads.
The total number of data writes.
The amount of data written so far, in bytes.
The number of pages that have been written for doublewrite operations. See Section 14.6.10.1,
“
The number of doublewrite operations that have been performed. See Section 14.6.10.1,
“
(
with atomic instructions. This variable was added in in MySQL 5.1.38.
The number of times that the log buffer was too small and a wait was required for it to be flushed before continuing.
The number of log write requests.
The number of physical writes to the log file.
The number of
The number of pending log file
The number of pending log file writes.
The number of bytes written to the log file.
The compiled-in
are counted in pages; the page size enables them to be easily converted to bytes.
The number of pages created.
The number of pages read.
The number of pages written.
The number of row locks currently being waited for.
The total time spent in acquiring row locks, in milliseconds.
The average time to acquire a row lock, in milliseconds.
The maximum time to acquire a row lock, in milliseconds.
The number of times a row lock had to be waited for.
The number of rows deleted from
The number of rows inserted into
The number of rows read from
The number of rows updated in
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
“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
large, then your
is probably too small. The cache miss rate can be calculated as
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. The default value is 0.
session scope.
The
can be computed accurately only for simple “flat” queries,
not complex queries such as those with subqueries or
For the latter, the value is set to 0.
The maximum number of connections that have been in use simultaneously since the server started.
The number of rows waiting to be written in
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 cached
in MySQL 5.1.3.
The number of tables that are open.
The number of files that have been opened with
function). Parts of the server that open files without using this function do not increment the count. This variable was added in MySQL 5.1.21.
The number of
was added in MySQL 5.1.24.
The number of tables that have been opened. If
big, your
is probably too small.
The current number of prepared statements. (The maximum number of statements is given by the
variable.) This variable was added in MySQL 5.1.14.
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 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
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
It does not count
This variable was added in MySQL 5.1.31.
The number of statements executed by the server. As of MySQL 5.1.31, this includes only statements sent to the server by clients and no longer includes statements executed within stored programs, unlike the
This variable does not count
or
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.21,
“Replication and Temporary Tables”.
The total number of times since startup that the replication slave SQL thread has retried transactions.
This is
connected to a replication master, and both the I/O and SQL threads are running; otherwise, it is
The number of threads that have taken more than
to create.
The number of queries that have taken more than
This counter increments regardless of whether the slow query log is enabled. For information about that log, see Section 5.2.5,
“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
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 SSL cipher (empty for non-SSL connections).
The list of possible SSL ciphers.
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.
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.
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
always significantly less than the log size, the size is larger than necessary and can be reduced. (The size is set by the
Currently, 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 capable of two-phase commit is greater than one. (
the only applicable engine.)
The page size used for the memory-mapped implementation of the XA recovery log. The default value is determined using
Currently, this variable is unused for the same reasons as described for
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
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.)
The number of threads in the thread cache.
The number of currently open connections.
The number of threads created to handle connections. If
big, you may want to increase the
The cache miss rate can be calculated as
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
This variable was added in 5.1.24.
Copyright © 1997, 2013, Oracle and/or its affiliates. All rights reserved. Legal
Notices
Previous / Next / Up / Table
of Contents
Reading the explanation for Handler read rnd next , I question it! I list some number from a test db that does almost all accesses by locating a record with a key (GE or xxx%) and then using next to access related record; yet the Handler read rnd next is relatively
large.
Handler read key 42053
Handler read next 453703
Handler read rnd 696
Handler read rnd next 104378
On MySQL 5.0 the com_* variables of 'show status' are counted for the current connection only. The new undocumented command 'show global status' shows server-wide counters. (http://bugs.mysql.com/bug.php?id=19422)
In version 4.0.17, the explanation to Handler_ is different:
Example:
Handler_delete:
The number of times a row was deleted from a table.
Handler_update
The number of requests to update a row in a table.
Handler_write
The number of requests to insert a row in a table.
Could this be a typo for Handler_delete? Because requests and rows updated/deleted/inserted are different concept.
Sheila
There's a bug in 5.0.36 (and likely surrounding versions) for Handler_write: it increases by one every time a row from SHOW STATUS is displayed:
------
mysql> FLUSH STATUS;
Query OK, 0 rows affected (0.00 sec)
mysql> SHOW GLOBAL STATUS; SHOW SESSION STATUS;
[...] 224 rows in set (0.01 sec)
[...] 224 rows in set (0.01 sec)
mysql> SHOW SESSION STATUS LIKE 'Handler_write';
1 row in set (0.00 sec)
------
Given the bug for Handler_write it is not possible to find out how many rows were inserted in this version, unless you use a workaround:
Rows_inserted= Handler_write - (number of times SHOW STATUS was run * number of rows SHOW STATUS displayed)
This could be programmed further using the Com_show_status variable:
--------
mysql> SHOW SESSION STATUS LIKE 'Com_show_status';
1 row in set (0.00 sec)
--------
So, on a system/version that had 224 rows in SHOW STATUS (please check), the workaround formula would be:
Rows_inserted=Handler_write-(Com_show_status * 224)
Note though that this workaround does not work when using partial SHOW STATUS statements (using LIKE etc) from time to time.
The 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] STATUSstatement (see Section 13.7.5.37,
“
SHOW STATUSSyntax”). The optional
GLOBALkeyword
aggregates the values over all connections, and
SESSIONshows
the values for the current connection.
mysql> [code]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 |
+-----------------------------------+------------+
[/code]
Many status variables are reset to 0 by the
FLUSH STATUSstatement.
The following table lists all available server status variables:
Table 5.4. Status Variable Summary
“MySQL Cluster Status Variables”.
Aborted_clients
The number of connections that were aborted because the client died without closing the connection properly. SeeSection C.5.2.11,
“Communication Errors and Aborted Connections”.
Aborted_connects
The number of failed attempts to connect to the MySQL server. See Section C.5.2.11,
“Communication Errors and Aborted Connections”.
Binlog_cache_disk_use
The number of transactions that used the temporary binary log cache but that exceeded the value of
binlog_cache_sizeand
used a temporary file to store statements from the transaction.
Binlog_cache_use
The number of transactions that used the temporary binary log cache.
Bytes_received
The number of bytes received from all clients.
Bytes_sent
The number of bytes sent to all clients.
Com_xxx
The
Com_xxxstatement
counter variables indicate the number of times each
xxxstatement
has been executed. There is one status variable for each type of statement. For example,
Com_deleteand
Com_updatecount
DELETEand
UPDATEstatements,
respectively.
Com_delete_multiand
Com_update_multiare
similar but apply to
DELETEand
UPDATEstatements
that use multiple-table syntax.
If a query result is returned from query cache, the server increments the
Qcache_hitsstatus
variable, not
Com_select. See Section 8.6.3.4,
“Query Cache Status and Maintenance”.
All of the
Com_stmt_xxxvariables
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.
The
Com_stmt_xxxstatus
variables are as follows:
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_xxxcommand
set used in the network layer. In other words, their values increase whenever prepared statement API calls such asmysql_stmt_prepare(), mysql_stmt_execute(),
and so forth are executed. However,
Com_stmt_prepare,
Com_stmt_executeand
Com_stmt_closealso
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_sqlincrease for the
PREPARE,
EXECUTE,
and
DEALLOCATE PREPAREstatements.
Com_stmt_fetchstands for
the total number of network round-trips issued when fetching from cursors.
Com_stmt_reprepareindicates the number of times statements
were automatically reprepared by the server after metadata changes to tables or views referred to by the statement. This variable was added in MySQL 5.1.25. A reprepare operation increments
Com_stmt_reprepare,
and also
Com_stmt_prepare.
Compression
Whether the client connection uses compression in the client/server protocol. Added in MySQL 5.1.2.
Connections
The number of connection attempts (successful or not) to the MySQL server.
Created_tmp_disk_tables
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_sizeand
max_heap_table_sizevalues.
If
Created_tmp_disk_tablesis
large, you may want to increase the
tmp_table_sizeor
max_heap_table_sizevalue
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_tablesand
Created_tmp_tablesvariables.
See also Section 8.8.5,
“How MySQL Uses Internal Temporary Tables”.
Created_tmp_files
How many temporary files mysqld has
created.
Created_tmp_tables
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_tablesand
Created_tmp_tablesvariables.
See also Section 8.8.5,
“How MySQL Uses Internal Temporary Tables”.
Each invocation of the
SHOW STATUSstatement uses an internal temporary table and increments the global
Created_tmp_tablesvalue.
Delayed_errors
The number of rows written with
INSERT DELAYEDfor which some error occurred (probably
duplicate key).
Delayed_insert_threads
The number of
INSERT DELAYEDhandler threads in use.
Delayed_writes
The number of
INSERT DELAYEDrows written.
Flush_commands
The number of times the server flushes tables, whether because a user executed a
FLUSH TABLESstatement or due to internal server operation. It is also incremented by receipt of a
COM_REFRESHpacket.
This is in contrast to
Com_flush,
which indicates how many
FLUSHstatements have been executed,
whether
FLUSH TABLES,
FLUSH LOGS, and so forth.
Handler_commit
The number of internal
COMMITstatements.
Handler_delete
The number of times that rows have been deleted from tables.
Handler_prepare
A counter for the prepare phase of two-phase commit operations.
Handler_read_first
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
col1is indexed.
Handler_read_key
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.
Handler_read_next
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.
Handler_read_prev
The number of requests to read the previous row in key order. This read method is mainly used to optimize
ORDER BY ... DESC.
Handler_read_rnd
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.
Handler_read_rnd_next
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.
Handler_rollback
The number of requests for a storage engine to perform a rollback operation.
Handler_savepoint
The number of requests for a storage engine to place a savepoint.
Handler_savepoint_rollback
The number of requests for a storage engine to roll back to a savepoint.
Handler_update
The number of requests to update a row in a table.
Handler_write
The number of requests to insert a row in a table.
Innodb_buffer_pool_pages_data
The number of pages containing data (dirty or clean).
Innodb_buffer_pool_pages_dirty
The number of pages currently dirty.
Innodb_buffer_pool_pages_flushed
The number of buffer pool page-flush requests.
Innodb_buffer_pool_pages_free
The number of free pages.
Innodb_buffer_pool_pages_latched
The number of latched pages in
InnoDBbuffer pool. These
are pages currently being read or written or that cannot be flushed or removed for some other reason. Calculation of this variable is expensive, so as of MySQL 5.1.28, it is available only when the
UNIV_DEBUGsystem
is defined at server build time.
Innodb_buffer_pool_pages_misc
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.
Innodb_buffer_pool_pages_total
The total size of the buffer pool, in pages.
Innodb_buffer_pool_read_ahead
(
InnoDB Pluginonly) The number of pages read into the
InnoDBbuffer
pool by the read-ahead background thread.
This variable was added in MySQL 5.1.41.
Innodb_buffer_pool_read_ahead_evicted
(
InnoDB Pluginonly) The number of pages read into the
InnoDBbuffer
pool by the read-ahead background thread that were subsequently evicted without having been accessed by queries.
This variable was added in MySQL 5.1.41.
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.
For
InnoDB Plugin, this variable was removed in MySQL 5.1.41.
Innodb_buffer_pool_read_ahead_seq
The number of sequential read-aheads initiated by
InnoDB.
This happens when
InnoDBdoes a sequential full table scan.
For
InnoDB Plugin, this variable was removed in MySQL 5.1.41.
Innodb_buffer_pool_read_requests
The number of logical read requests
InnoDBhas done.
Innodb_buffer_pool_reads
The number of logical reads that
InnoDBcould not satisfy
from the buffer pool, and had to read directly from the disk.
Innodb_buffer_pool_wait_free
Normally, writes to the
InnoDBbuffer 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.
Innodb_buffer_pool_write_requests
The number writes done to the
InnoDBbuffer pool.
Innodb_data_fsyncs
The number of
fsync()operations so far.
Innodb_data_pending_fsyncs
The current number of pending
fsync()operations.
Innodb_data_pending_reads
The current number of pending reads.
Innodb_data_pending_writes
The current number of pending writes.
Innodb_data_read
The amount of data read since the server was started.
Innodb_data_reads
The total number of data reads.
Innodb_data_writes
The total number of data writes.
Innodb_data_written
The amount of data written so far, in bytes.
Innodb_dblwr_pages_written
The number of pages that have been written for doublewrite operations. See Section 14.6.10.1,
“
InnoDBDisk I/O”.
Innodb_dblwr_writes
The number of doublewrite operations that have been performed. See Section 14.6.10.1,
“
InnoDBDisk I/O”.
Innodb_have_atomic_builtins
(
InnoDB Pluginonly) Indicates whether the server was built
with atomic instructions. This variable was added in in MySQL 5.1.38.
Innodb_log_waits
The number of times that the log buffer was too small and a wait was required for it to be flushed before continuing.
Innodb_log_write_requests
The number of log write requests.
Innodb_log_writes
The number of physical writes to the log file.
Innodb_os_log_fsyncs
The number of
fsync()writes done to the log file.
Innodb_os_log_pending_fsyncs
The number of pending log file
fsync()operations.
Innodb_os_log_pending_writes
The number of pending log file writes.
Innodb_os_log_written
The number of bytes written to the log file.
Innodb_page_size
The compiled-in
InnoDBpage size (default 16KB). Many values
are counted in pages; the page size enables them to be easily converted to bytes.
Innodb_pages_created
The number of pages created.
Innodb_pages_read
The number of pages read.
Innodb_pages_written
The number of pages written.
Innodb_row_lock_current_waits
The number of row locks currently being waited for.
Innodb_row_lock_time
The total time spent in acquiring row locks, in milliseconds.
Innodb_row_lock_time_avg
The average time to acquire a row lock, in milliseconds.
Innodb_row_lock_time_max
The maximum time to acquire a row lock, in milliseconds.
Innodb_row_lock_waits
The number of times a row lock had to be waited for.
Innodb_rows_deleted
The number of rows deleted from
InnoDBtables.
Innodb_rows_inserted
The number of rows inserted into
InnoDBtables.
Innodb_rows_read
The number of rows read from
InnoDBtables.
Innodb_rows_updated
The number of rows updated in
InnoDBtables.
Key_blocks_not_flushed
The number of key blocks in the key cache that have changed but have not yet been flushed to disk.
Key_blocks_unused
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_sizein Section 5.1.4,
“Server System Variables”.
Key_blocks_used
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.
Key_read_requests
The number of requests to read a key block from the cache.
Key_reads
The number of physical reads of a key block from disk. If
Key_readsis
large, then your
key_buffer_sizevalue
is probably too small. The cache miss rate can be calculated as
Key_reads/
Key_read_requests.
Key_write_requests
The number of requests to write a key block to the cache.
Key_writes
The number of physical writes of a key block to disk.
Last_query_cost
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. The default value is 0.
Last_query_costhas
session scope.
The
Last_query_costvalue
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.
Max_used_connections
The maximum number of connections that have been in use simultaneously since the server started.
Not_flushed_delayed_rows
The number of rows waiting to be written in
INSERT DELAYEDqueues.
Open_files
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.
Open_streams
The number of streams that are open (used mainly for logging).
Open_table_definitions
The number of cached
.frmfiles. This variable was added
in MySQL 5.1.3.
Open_tables
The number of tables that are open.
Opened_files
The number of files that have been opened with
my_open()(a
mysyslibrary
function). Parts of the server that open files without using this function do not increment the count. This variable was added in MySQL 5.1.21.
Opened_table_definitions
The number of
.frmfiles that have been cached. This variable
was added in MySQL 5.1.24.
Opened_tables
The number of tables that have been opened. If
Opened_tablesis
big, your
table_open_cachevalue
is probably too small.
Prepared_stmt_count
The current number of prepared statements. (The maximum number of statements is given by the
max_prepared_stmt_countsystem
variable.) This variable was added in MySQL 5.1.14.
Qcache_free_blocks
The number of free memory blocks in the query cache.
Qcache_free_memory
The amount of free memory for the query cache.
Qcache_hits
The number of query cache hits.
Qcache_inserts
The number of queries added to the query cache.
Qcache_lowmem_prunes
The number of queries that were deleted from the query cache because of low memory.
Qcache_not_cached
The number of noncached queries (not cacheable, or not cached due to the
query_cache_typesetting).
Qcache_queries_in_cache
The number of queries registered in the query cache.
Qcache_total_blocks
The total number of blocks in the query cache.
Queries
The number of statements executed by the server. This variable includes statements executed within stored programs, unlike the
Questionsvariable.
It does not count
COM_PINGor
COM_STATISTICScommands.
This variable was added in MySQL 5.1.31.
Questions
The number of statements executed by the server. As of MySQL 5.1.31, this includes only statements sent to the server by clients and no longer includes statements executed within stored programs, unlike the
Queriesvariable.
This variable does not count
COM_PING,
COM_STATISTICS,
COM_STMT_PREPARE,
COM_STMT_CLOSE,
or
COM_STMT_RESETcommands.
Rpl_status
The status of fail-safe replication (not implemented). This variable is unused and is removed in MySQL 5.6.
Select_full_join
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.
Select_full_range_join
The number of joins that used a range search on a reference table.
Select_range
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.
Select_range_check
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.
Select_scan
The number of joins that did a full scan of the first table.
Slave_open_temp_tables
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.21,
“Replication and Temporary Tables”.
Slave_retried_transactions
The total number of times since startup that the replication slave SQL thread has retried transactions.
Slave_running
This is
ONif 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.
Slow_launch_threads
The number of threads that have taken more than
slow_launch_timeseconds
to create.
Slow_queries
The number of queries that have taken more than
long_query_timeseconds.
This counter increments regardless of whether the slow query log is enabled. For information about that log, see Section 5.2.5,
“The Slow Query Log”.
Sort_merge_passes
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_sizesystem
variable.
Sort_range
The number of sorts that were done using ranges.
Sort_rows
The number of sorted rows.
Sort_scan
The number of sorts that were done by scanning the table.
Ssl_accept_renegotiates
The number of negotiates needed to establish the connection.
Ssl_accepts
The number of accepted SSL connections.
Ssl_callback_cache_hits
The number of callback cache hits.
Ssl_cipher
The current SSL cipher (empty for non-SSL connections).
Ssl_cipher_list
The list of possible SSL ciphers.
Ssl_client_connects
The number of SSL connection attempts to an SSL-enabled master.
Ssl_connect_renegotiates
The number of negotiates needed to establish the connection to an SSL-enabled master.
Ssl_ctx_verify_depth
The SSL context verification depth (how many certificates in the chain are tested).
Ssl_ctx_verify_mode
The SSL context verification mode.
Ssl_default_timeout
The default SSL timeout.
Ssl_finished_accepts
The number of successful SSL connections to the server.
Ssl_finished_connects
The number of successful slave connections to an SSL-enabled master.
Ssl_session_cache_hits
The number of SSL session cache hits.
Ssl_session_cache_misses
The number of SSL session cache misses.
Ssl_session_cache_mode
The SSL session cache mode.
Ssl_session_cache_overflows
The number of SSL session cache overflows.
Ssl_session_cache_size
The SSL session cache size.
Ssl_session_cache_timeouts
The number of SSL session cache timeouts.
Ssl_sessions_reused
How many SSL connections were reused from the cache.
Ssl_used_session_cache_entries
How many SSL session cache entries were used.
Ssl_verify_depth
The verification depth for replication SSL connections.
Ssl_verify_mode
The verification mode for replication SSL connections.
Ssl_version
The SSL protocol version of the connection.
Table_locks_immediate
The number of times that a request for a table lock could be granted immediately.
Table_locks_waited
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.
Tc_log_max_pages_used
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_usedand
Tc_log_page_sizeis
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-sizeoption.
Currently, 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 capable of two-phase commit is greater than one. (
InnoDBis
the only applicable engine.)
Tc_log_page_size
The page size used for the memory-mapped implementation of the XA recovery log. The default value is determined using
getpagesize().
Currently, this variable is unused for the same reasons as described for
Tc_log_max_pages_used.
Tc_log_page_waits
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-sizeoption).
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.)
Threads_cached
The number of threads in the thread cache.
Threads_connected
The number of currently open connections.
Threads_created
The number of threads created to handle connections. If
Threads_createdis
big, you may want to increase the
thread_cache_sizevalue.
The cache miss rate can be calculated as
Threads_created/
Connections.
Threads_running
The number of threads that are not sleeping.
Uptime
The number of seconds that the server has been up.
Uptime_since_flush_status
The number of seconds since the most recent
FLUSH STATUSstatement.
This variable was added in 5.1.24.
Copyright © 1997, 2013, Oracle and/or its affiliates. All rights reserved. Legal
Notices
Previous / Next / Up / Table
of Contents
User Comments
Posted by Demetrios Stavrinos on July 22 2004 12:27pm | [Delete] [Edit] |
large.
Handler read key 42053
Handler read next 453703
Handler read rnd 696
Handler read rnd next 104378
Posted by Heikki Hannikainen on April 28 2006 10:23am | [Delete] [Edit] |
Posted by sheila yao on April 16 2007 9:23pm | [Delete] [Edit] |
Example:
Handler_delete:
The number of times a row was deleted from a table.
Handler_update
The number of requests to update a row in a table.
Handler_write
The number of requests to insert a row in a table.
Could this be a typo for Handler_delete? Because requests and rows updated/deleted/inserted are different concept.
Sheila
Posted by Roel Van de Paar on September 21 2009 4:34am | [Delete] [Edit] |
------
mysql> FLUSH STATUS;
Query OK, 0 rows affected (0.00 sec)
mysql> SHOW GLOBAL STATUS; SHOW SESSION STATUS;
[...] 224 rows in set (0.01 sec)
[...] 224 rows in set (0.01 sec)
mysql> SHOW SESSION STATUS LIKE 'Handler_write';
+---------------+-------+ | Variable_name | Value | +---------------+-------+ | Handler_write | 448 | +---------------+-------+
1 row in set (0.00 sec)
------
Given the bug for Handler_write it is not possible to find out how many rows were inserted in this version, unless you use a workaround:
Rows_inserted= Handler_write - (number of times SHOW STATUS was run * number of rows SHOW STATUS displayed)
This could be programmed further using the Com_show_status variable:
--------
mysql> SHOW SESSION STATUS LIKE 'Com_show_status';
+-----------------+-------+ | Variable_name | Value | +-----------------+-------+ | Com_show_status | 8 | +-----------------+-------+
1 row in set (0.00 sec)
--------
So, on a system/version that had 224 rows in SHOW STATUS (please check), the workaround formula would be:
Rows_inserted=Handler_write-(Com_show_status * 224)
Note though that this workaround does not work when using partial SHOW STATUS statements (using LIKE etc) from time to time.
相关文章推荐
- Howto change runtime variables without restart MySQL Server
- MySQL - 翻译 - 5.1 Reference Manual参考手册 - 5.1.3 Server System Variables服务器系统变量 - max_heap_table_size
- 5.1.6. Server Status Variables
- Mysql中关于Could not retrieve transation read-only status server
- MySQL错误: could not retrieve transation read-only status server
- mysql之status和variables区别及用法详解
- MySQL Server Status Problem in El Capitan
- 好多东西还是看官网的比较好... MySQL 5.1 Server System Variables
- MySQL的variables和status
- mysql之status和variables区别及用法详解
- mysql结合status和variables 优化mysql
- Mysql中关于Could not retrieve transation read-only status server
- Notes on <High Performance MySQL> -- Ch13: MySQL Server Status
- SSH环境mysql6.0报错Could not retrieve transation read-only status server
- Mysql中关于Could not retrieve transation read-only status server
- MySQL Select and Sort Status Variables
- mysql 报错Could not retrieve transation read-only status server
- MySQL错误: could not retrieve transation read-only status server
- mysql之status和variables区别
- MySQL Select and Sort Status Variables