The INNODB_SYS_TABLESTATS view provides status
information about performance statistics for
InnoDB tables. These statistics represent
low-level information used by the MySQL optimizer to calculate
which index to use when querying an InnoDB
table. This information is derived from in-memory data structures
rather than corresponding to data stored on disk.
InnoDB tables are represented in this view if
they have been opened since the last server restart, and not aged
out of the table cache. Tables for which persistent stats are
available are always represented in this view.
Table 19.12. INNODB_SYS_TABLESTATS Columns
| Column name | Description |
|---|---|
TABLE_ID |
An identifier representing the table for which statistics are available,
using the same value as
INNODB_SYS_TABLES.TABLE_ID. |
NAME |
The name of the table, using the same value as
INNODB_SYS_TABLES.NAME. |
STATS_INITIALIZED |
The value is Initialized if the statistics are
already collected, Uninitialized if
not. |
NUM_ROWS |
The current estimated number of rows in the table. Updated after each DML operation. Could be imprecise if uncommitted transactions are inserting into or deleting from the table. |
CLUST_INDEX_SIZE |
Number of pages on disk that store the clustered index, which holds the
InnoDB table data in primary key order.
This value might be null if no statistics are collected
yet for the table. |
OTHER_INDEX_SIZE |
Number of pages on disk that store all secondary indexes for the table. This value might be null if no statistics are collected yet for the table. |
MODIFIED_COUNTER |
The number of rows modified by DML operations, such as
INSERT, UPDATE,
DELETE, and also cascade operations
from foreign keys. |
AUTOINC |
|
REF_COUNT |
When this counter reaches zero, the table metadata can be evicted from the table cache. |
Notes:
This table is primarily useful for expert-level performance monitoring, or when developing performance-related extensions for MySQL.
Since the INFORMATION_SCHEMA is a
general-purpose way to monitor the MySQL server, use this
table rather than the corresponding InnoDB
system table for any new monitoring application you develop.
You must have the PROCESS privilege to
query this table.

User Comments
Add your own comment.