MariaDB 5.2.0

The INDEX_STATISTICS table was introduced in MariaDB 5.2.0 as part of the User Statistics feature.

The Information Schema INDEX_STATISTICS table shows statistics on index usage and makes it possible to do such things as locating unused indexes and generating the commands to remove them.

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.
INDEX_NAMEvarchar(192)The index name (as visible in SHOW CREATE TABLE).
ROWS_READint(21)The number of rows read from this index.

Example

SELECT * FROM INFORMATION_SCHEMA.INDEX_STATISTICS WHERE TABLE_NAME = "author";
+--------------+------------+------------+-----------+
| TABLE_SCHEMA | TABLE_NAME | INDEX_NAME | ROWS_READ |
+--------------+------------+------------+-----------+
| books        | author     | by_name    |        15 |
+--------------+------------+------------+-----------+

Comments

Comments loading...