This is a read-only copy of the MariaDB Knowledgebase generated on 2024-11-14. For the latest, interactive version please visit https://mariadb.com/kb/.

Information Schema TABLE_STATISTICS Table

The Information Schema TABLE_STATISTICS table shows statistics on table usage.

This is part of the User Statistics feature, which is not enabled by default.

It contains the following columns:

FieldTypeNotes
TABLE_SCHEMAvarchar(192)The schema (database) name.
TABLE_NAMEvarchar(192)The table name.
ROWS_READbigint(21)The number of rows read from the table.
ROWS_CHANGEDbigint(21)The number of rows changed in the table.
ROWS_CHANGED_X_INDEXESbigint(21)The number of rows changed in the table, multiplied by the number of indexes changed.
ROWS_INSERTEDbigint(21)From MariaDB 11.5
ROWS_UPDATEDbigint(21)From MariaDB 11.5
ROWS_DELETEDbigint(21)From MariaDB 11.5
KEY_READ_HITSbigint(21)From MariaDB 11.5
KEY_READ_MISSESbigint(21)From MariaDB 11.5

Example

SELECT * FROM INFORMATION_SCHEMA.TABLE_STATISTICS WHERE TABLE_NAME='user';
+--------------+------------+-----------+--------------+------------------------+
| TABLE_SCHEMA | TABLE_NAME | ROWS_READ | ROWS_CHANGED | ROWS_CHANGED_X_INDEXES |
+--------------+------------+-----------+--------------+------------------------+
| mysql        | user       |         5 |            2 |                      2 |
+--------------+------------+-----------+--------------+------------------------+
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.