INNODB_CACHED_INDEXES 表报告了 InnoDB 缓冲池中每个索引缓存的索引页面数量。The INNODB_CACHED_INDEXES table
reports the number of index pages cached in the
InnoDB buffer pool for each index.
有关相关用法信息和示例,请参见 第 17.15.5 节,“InnoDB INFORMATION_SCHEMA 缓冲池表”。For related usage information and examples, see Section 17.15.5, “InnoDB INFORMATION_SCHEMA Buffer Pool Tables”.
INNODB_CACHED_INDEXES 表包含以下列:The INNODB_CACHED_INDEXES table has
these columns:
SPACE_ID表空间 ID。The tablespace ID.
INDEX_ID索引的标识符。索引标识符在实例的所有数据库中都是唯一的。An identifier for the index. Index identifiers are unique across all the databases in an instance.
N_CACHED_PAGES自 MySQL 服务器上次启动以来,特定索引在
InnoDB缓冲池中缓存的索引页总数。The total number of index pages cached in theInnoDBbuffer pool for a specific index since MySQL Server last started.
示例Examples
此查询返回特定索引在 InnoDB 缓冲池中缓存的索引页数: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 ***************************
SPACE_ID: 4294967294
INDEX_ID: 65
N_CACHED_PAGES: 45
此查询返回每个索引在 InnoDB 缓冲池中缓存的索引页数,使用 INNODB_INDEXES 和 INNODB_TABLES 表来解析每个 INDEX_ID 对应的表名和索引名。This query returns the number of index pages cached in the
InnoDB buffer pool for each index, using the
INNODB_INDEXES and
INNODB_TABLES 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
你必须拥有
PROCESS权限才能查询此表。You must have thePROCESSprivilege to query this table.使用
INFORMATION_SCHEMACOLUMNS表或SHOW COLUMNS语句查看关于此表列的更多信息,包括数据类型和默认值。Use theINFORMATION_SCHEMACOLUMNStable or theSHOW COLUMNSstatement to view additional information about the columns of this table, including data types and default values.