INNODB_BUFFER_PAGE 表提供有关 InnoDB 缓冲池 中每个 页面 的信息。The INNODB_BUFFER_PAGE table provides
information about each page in
the InnoDB
buffer pool.
有关相关用法信息和示例,请参见 第 17.15.5 节,“InnoDB INFORMATION_SCHEMA 缓冲池表”。For related usage information and examples, see Section 17.15.5, “InnoDB INFORMATION_SCHEMA Buffer Pool Tables”.
查询 INNODB_BUFFER_PAGE 表可能会影响性能。除非您了解性能影响并确定其可接受,否则不要在生产系统上查询此表。为了避免影响生产系统的性能,请在测试实例上重现您要调查的问题并查询缓冲池统计信息。Querying the INNODB_BUFFER_PAGE
table can affect performance. Do not query this table on a
production system unless you are aware of the performance impact
and have determined it to be acceptable. To avoid impacting
performance on a production system, reproduce the issue you want
to investigate and query buffer pool statistics on a test
instance.
INNODB_BUFFER_PAGE 表具有以下列:The INNODB_BUFFER_PAGE table has
these columns:
POOL_ID缓冲池 ID。这是用于区分多个缓冲池实例的标识符。The buffer pool ID. This is an identifier to distinguish between multiple buffer pool instances.
BLOCK_ID缓冲池块 ID。The buffer pool block ID.
SPACE表空间 ID;与
INNODB_TABLES.SPACE的值相同。The tablespace ID; the same value asINNODB_TABLES.SPACE.PAGE_NUMBER页码。The page number.
PAGE_TYPE页类型。下表显示允许的值。The page type. The following table shows the permitted values.
表 28.4 INNODB_BUFFER_PAGE.PAGE_TYPE 值Table 28.4 INNODB_BUFFER_PAGE.PAGE_TYPE Values
页类型Page Type 说明Description ALLOCATED新分配的页面Freshly allocated page BLOB未压缩的 BLOB 页面Uncompressed BLOB page COMPRESSED_BLOB2后续压缩 BLOB 页面Subsequent comp BLOB page COMPRESSED_BLOB第一个压缩 BLOB 页面First compressed BLOB page ENCRYPTED_RTREE加密 R 树Encrypted R-tree EXTENT_DESCRIPTOR区段描述符页面Extent descriptor page FILE_SPACE_HEADER文件空间头File space header FIL_PAGE_TYPE_UNUSED未使用Unused IBUF_BITMAP插入缓冲区位图Insert buffer bitmap IBUF_FREE_LIST插入缓冲区空闲列表Insert buffer free list IBUF_INDEX插入缓冲区索引Insert buffer index INDEXB 树节点B-tree node INODE索引节点Index node LOB_DATA未压缩的 LOB 数据Uncompressed LOB data LOB_FIRST未压缩 LOB 的第一页First page of uncompressed LOB LOB_INDEX未压缩 LOB 索引Uncompressed LOB index PAGE_IO_COMPRESSED压缩页Compressed page PAGE_IO_COMPRESSED_ENCRYPTED已压缩和加密的页面Compressed and encrypted page PAGE_IO_ENCRYPTED加密页面Encrypted page RSEG_ARRAY回滚段数组Rollback segment array RTREE_INDEXR 树索引R-tree index SDI_BLOB未压缩的 SDI BLOBUncompressed SDI BLOB SDI_COMPRESSED_BLOB已压缩的 SDI BLOBCompressed SDI BLOB SDI_INDEXSDI 索引SDI index SYSTEMSYSTEM系统页面System page TRX_SYSTEM事务系统数据Transaction system data UNDO_LOG回滚日志页Undo log page UNKNOWNUNKNOWN未知Unknown ZLOB_DATA压缩的 LOB 数据Compressed LOB data ZLOB_FIRST压缩 LOB 的第一页First page of compressed LOB ZLOB_FRAG压缩 LOB 片段Compressed LOB fragment ZLOB_FRAG_ENTRY压缩 LOB 片段索引Compressed LOB fragment index ZLOB_INDEX压缩 LOB 索引Compressed LOB index FLUSH_TYPE刷新类型。The flush type.
FIX_COUNT在缓冲池中使用该块的线程数。当为零时,该块有资格被淘汰。The number of threads using this block within the buffer pool. When zero, the block is eligible to be evicted.
IS_HASHED该页是否已建立哈希索引。Whether a hash index has been built on this page.
NEWEST_MODIFICATION最新修改的日志序列号。The Log Sequence Number of the youngest modification.
OLDEST_MODIFICATION最早修改的日志序列号。The Log Sequence Number of the oldest modification.
ACCESS_TIME用于判断页面首次访问时间的抽象值。An abstract number used to judge the first access time of the page.
TABLE_NAMETABLE_NAME页面所属表的名称。此列仅适用于
PAGE_TYPE值为INDEX的页面。如果服务器尚未访问该表,则该列为NULL。The name of the table the page belongs to. This column is applicable only to pages with aPAGE_TYPEvalue ofINDEX. The column isNULLif the server has not yet accessed the table.INDEX_NAME页面所属索引的名称。这可以是聚集索引或二级索引的名称。此列仅适用于
PAGE_TYPE值为INDEX的页面。The name of the index the page belongs to. This can be the name of a clustered index or a secondary index. This column is applicable only to pages with aPAGE_TYPEvalue ofINDEX.NUMBER_RECORDS页面内记录的数量。The number of records within the page.
DATA_SIZE记录大小的总和。此列仅适用于
PAGE_TYPE值为INDEX的页面。The sum of the sizes of the records. This column is applicable only to pages with aPAGE_TYPEvalue ofINDEX.COMPRESSED_SIZE压缩页面大小。对于未压缩的页面,值为
NULL。The compressed page size.NULLfor pages that are not compressed.PAGE_STATE页面状态。下表显示允许的值。The page state. The following table shows the permitted values.
表 28.5 INNODB_BUFFER_PAGE.PAGE_STATE 值Table 28.5 INNODB_BUFFER_PAGE.PAGE_STATE Values
页面状态Page State 说明Description FILE_PAGE一个缓冲文件页面A buffered file page MEMORYMEMORY包含主存对象Contains a main memory object NOT_USED在空闲列表中In the free list NULL干净的压缩页面、在刷新列表中的压缩页面、用作缓冲池监视哨的页面Clean compressed pages, compressed pages in the flush list, pages used as buffer pool watch sentinels READY_FOR_USE一个空闲页面A free page REMOVE_HASH在放入空闲列表之前应移除哈希索引Hash index should be removed before placing in the free list IO_FIX此页面是否有任何待处理的 I/O:
IO_NONE= 无待处理 I/O,IO_READ= 待读取,IO_WRITE= 待写入,IO_PIN= 不允许迁移和从刷新中移除。Whether any I/O is pending for this page:IO_NONE= no pending I/O,IO_READ= read pending,IO_WRITE= write pending,IO_PIN= relocation and removal from the flush not permitted.IS_OLD该块是否属于 LRU 列表的旧块子列表。Whether the block is in the sublist of old blocks in the LRU list.
FREE_PAGE_CLOCK当该块最后一次被放置在 LRU 列表头部时
freed_page_clock计数器的值。freed_page_clock计数器用于跟踪从 LRU 列表末端移除的块数。The value of thefreed_page_clockcounter when the block was the last placed at the head of the LRU list. Thefreed_page_clockcounter tracks the number of blocks removed from the end of the LRU list.IS_STALE此页面是否已过期。Whether the page is stale.
示例Example
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE LIMIT 1\G
*************************** 1. row ***************************
POOL_ID: 0
BLOCK_ID: 0
SPACE: 97
PAGE_NUMBER: 2473
PAGE_TYPE: INDEX
FLUSH_TYPE: 1
FIX_COUNT: 0
IS_HASHED: YES
NEWEST_MODIFICATION: 733855581
OLDEST_MODIFICATION: 0
ACCESS_TIME: 3378385672
TABLE_NAME: `employees`.`salaries`
INDEX_NAME: PRIMARY
NUMBER_RECORDS: 468
DATA_SIZE: 14976
COMPRESSED_SIZE: 0
PAGE_STATE: FILE_PAGE
IO_FIX: IO_NONE
IS_OLD: YES
FREE_PAGE_CLOCK: 66
IS_STALE: NO
说明Notes
此表主要用于专家级性能监控,或者在为 MySQL 开发与性能相关的扩展时使用。This table is useful primarily for expert-level performance monitoring, or when developing performance-related extensions for MySQL.
你必须拥有
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.当表、表行、分区或索引被删除时,相关的页面会保留在缓冲池中,直到需要空间存放其他数据。
INNODB_BUFFER_PAGE表会报告这些页面的信息,直到它们从缓冲池中被移除。有关InnoDB如何管理缓冲池数据的更多信息,请参见 第 17.5.1 节,“缓冲池”。When tables, table rows, partitions, or indexes are deleted, associated pages remain in the buffer pool until space is required for other data. TheINNODB_BUFFER_PAGEtable reports information about these pages until they are evicted from the buffer pool. For more information about how theInnoDBmanages buffer pool data, see Section 17.5.1, “Buffer Pool”.