Documentation Home
MySQL 8.0 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 32.3Mb
PDF (A4) - 32.3Mb
PDF (RPM) - 30.4Mb
HTML Download (TGZ) - 7.8Mb
HTML Download (Zip) - 7.8Mb
HTML Download (RPM) - 6.7Mb
Man Pages (TGZ) - 142.5Kb
Man Pages (Zip) - 201.7Kb
Info (Gzip) - 3.0Mb
Info (Zip) - 3.0Mb


MySQL 8.0 Reference Manual  /  ...  /  The INFORMATION_SCHEMA INNODB_CACHED_INDEXES Table

Pre-General Availability Draft: 2017-05-29

23.30.4 The INFORMATION_SCHEMA INNODB_CACHED_INDEXES Table

The INNODB_CACHED_INDEXES table reports the number of index pages cached in the InnoDB buffer pool for each index.

Table 23.4 INNODB_CACHED_INDEXES Columns

Column nameDescription
SPACE_IDTablespace Space ID.
INDEX_IDAn identifier for each index that is unique across all the databases in an instance.
N_CACHED_PAGESThe 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 DESCRIBE or SHOW COLUMNS to view additional information about the columns of this table including data types and default values.

  • You must have the PROCESS privilege to query this table.


User Comments
Sign Up Login You must be logged in to post a comment.