INNODB_SYS_TABLESTATS provides a view of
low-level status information about
tables. This data is used by the MySQL optimizer to calculate
which index to use when querying an
table. This information is derived from in-memory data structures
rather than corresponding to data stored on disk. There is no
InnoDB system table.
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.
For related usage information and examples, see Section 14.15.3, “InnoDB INFORMATION_SCHEMA System Tables”.
Table 23.26 INNODB_SYS_TABLESTATS Columns
||An identifier representing the table for which statistics are available,
using the same value as
||The name of the table, using the same value as
||The value is
||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.|
||Number of pages on disk that store the clustered index, which holds the
||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.|
||The number of rows modified by DML operations, such as
||The next number to be issued for any auto-increment-based operation. The
rate at which the
||When this counter reaches zero, the table metadata can be evicted from the table cache.|
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS where TABLE_ID = 71\G *************************** 1. row *************************** TABLE_ID: 71 NAME: test/t1 STATS_INITIALIZED: Initialized NUM_ROWS: 1 CLUST_INDEX_SIZE: 1 OTHER_INDEX_SIZE: 0 MODIFIED_COUNTER: 1 AUTOINC: 0 REF_COUNT: 1
This table is primarily useful for expert-level performance monitoring, or when developing performance-related extensions for MySQL.
You must have the
PROCESSprivilege to query this table.