Documentation Home
MySQL 8.0 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 37.9Mb
PDF (A4) - 37.9Mb
PDF (RPM) - 33.0Mb
HTML Download (TGZ) - 8.0Mb
HTML Download (Zip) - 8.1Mb
HTML Download (RPM) - 6.9Mb
Man Pages (TGZ) - 132.9Kb
Man Pages (Zip) - 189.5Kb
Info (Gzip) - 3.4Mb
Info (Zip) - 3.4Mb
Excerpts from this Manual

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

24.33.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 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_INDEXES and INNODB_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_INDEXES AS indexes,
  INFORMATION_SCHEMA.INNODB_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.