Pre-General Availability Draft: 2017-07-17
The INNODB_CACHED_INDEXES table reports the
number of index pages cached in the InnoDB
buffer pool for each index.
Table 24.4 INNODB_CACHED_INDEXES Columns
| Column name | Description |
|---|---|
SPACE_ID | Tablespace Space ID. |
INDEX_ID | An identifier for each index that is unique across all the databases in an instance. |
N_CACHED_PAGES | The number of index pages cached in the InnoDB buffer
pool. |
Examples:
This query returns the number of index pages cached in the
InnoDB buffer pool for a specific index:
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_CACHED_INDEXES WHERE INDEX_ID=65\G
*************************** 1. row ***************************
INDEX_ID: 65
N_CACHED_PAGES: 45
1 row in set (0.00 sec)
This query returns the number of index pages cached in the
InnoDB buffer pool for each index, and uses the
INNODB_SYS_INDEXES and
INNODB_SYS_TABLES to resolve the
table name and index name for each INDEX_ID
value.
SELECT
tables.name AS table_name,
indexes.name AS index_name,
cached.n_cached_pages AS n_cached_pages
FROM
INFORMATION_SCHEMA.INNODB_CACHED_INDEXES AS cached,
INFORMATION_SCHEMA.INNODB_SYS_INDEXES AS indexes,
INFORMATION_SCHEMA.INNODB_SYS_TABLES AS tables
WHERE
cached.index_id = indexes.index_id
AND indexes.table_id = tables.table_id;Notes:
Use
DESCRIBEorSHOW COLUMNSto view additional information about the columns of this table including data types and default values.You must have the
PROCESSprivilege to query this table.