All pages
Powered by GitBook
1 of 1

Loading...

SHOW INDEX_STATISTICS

View usage statistics for table indexes. This statement displays how often specific indexes are used, helping optimize query performance.

Syntax

SHOW INDEX_STATISTICS

Description

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.

SHOW INDEX_STATISTICS is replaced by the generic statement.

The SHOW INDEX_STATISTICS statement was introduced in as part of the feature. It was removed as a separate statement in , but effectively replaced by the generic statement.

The system variable must be set to 1 to activate this feature. See the and table for more information.

Example

This page is licensed: CC BY-SA / Gnu FDL

SHOW TABLE STATISTICS
User Statistics
SHOW TABLE STATISTICS
userstat
User Statistics
information_schema.INDEX_STATISTICS
SHOW INDEX_STATISTICS;
+--------------+-------------------+------------+-----------+
| Table_schema | Table_name        | Index_name | Rows_read |
+--------------+-------------------+------------+-----------+
| test         | employees_example | PRIMARY    |         1 |
+--------------+-------------------+------------+-----------+
MariaDB 5.2
MariaDB 10.1.1