-
Notifications
You must be signed in to change notification settings - Fork 111
INNODB_CMPMEM和INNODB_CMPMEM_RESET
xiaoboluo768 edited this page Jun 7, 2020
·
2 revisions
- 这两个表中记录着InnoDB缓冲池中压缩页上的状态信息,为测量数据库中InnoDB表压缩的有效性提供参考
- 查询该表的账户需要有PROCESS权限,该表为Memory引擎临时表
- 表定义语句
CREATE TEMPORARY TABLE `INNODB_CMPMEM` (
`page_size` int(5) NOT NULL DEFAULT '0',
`buffer_pool_instance` int(11) NOT NULL DEFAULT '0',
`pages_used` int(11) NOT NULL DEFAULT '0',
`pages_free` int(11) NOT NULL DEFAULT '0',
`relocation_ops` bigint(21) NOT NULL DEFAULT '0',
`relocation_time` int(11) NOT NULL DEFAULT '0'
) ENGINE=MEMORY DEFAULT CHARSET=utf8
- 表字段含义
- PAGE_SIZE:表示innodb的块大小(即表中可以使用的有效的压缩块大小,以字节为单位)。该表中的每个记录都描述了有效的可用块大小(每个buffer pool instance在该表中都记录了完整的可压缩的有效块大小值,例如:默认page size值为16K,则可压缩的块大小为16K、8K、4K、2K、1K,注意:这里的块大小指的是使用建表选项指定的block size)
- BUFFER_POOL_INSTANCE:buffer pool instance实例的唯一标识符
- PAGES_USED:表示对应每行记录中的PAGE_SIZE块大小的块数(页数)
- PAGES_FREE:表示每行记录对应的PAGE_SIZE块大小的当前可分配的块数。此列显示内存池中的外部碎片。理想情况下,该列值不应该超过1
- RELOCATION_OPS:表示PAGE_SIZE列值对应的块大小的块被重新设置的次数。当伙伴系统试图建立一个大块的空闲区域时,伙伴系统可以重新分配邻接页释放的空间。从表INNODB_CMPMEM_RESET中读同名列值取重置INNODB_CMPMEM表中该列的计数
- RELOCATION_TIME:重新设置PAGE_SIZE列值大小的块大小的块所用的总时间(以微秒为单位)。从表INNODB_CMPMEM_RESET读取相同列值来重置INNODB_CMPMEM表中的该列计数
- 表记录内容示例
# INNODB_CMPMEM表
root@localhost : information_schema 11:33:15> select * from INNODB_CMPMEM;
+-----------+----------------------+------------+------------+----------------+-----------------+
| page_size | buffer_pool_instance | pages_used | pages_free | relocation_ops | relocation_time |
+-----------+----------------------+------------+------------+----------------+-----------------+
| 1024 | 0 | 0 | 0 | 0 | 0 |
| 2048 | 0 | 0 | 0 | 0 | 0 |
| 4096 | 0 | 0 | 0 | 0 | 0 |
| 8192 | 0 | 0 | 0 | 0 | 0 |
| 16384 | 0 | 0 | 0 | 0 | 0 |
| 1024 | 1 | 0 | 0 | 0 | 0 |
| 2048 | 1 | 0 | 0 | 0 | 0 |
| 4096 | 1 | 0 | 0 | 0 | 0 |
| 8192 | 1 | 0 | 0 | 0 | 0 |
| 16384 | 1 | 0 | 0 | 0 | 0 |
| 1024 | 2 | 0 | 0 | 0 | 0 |
| 2048 | 2 | 0 | 0 | 0 | 0 |
| 4096 | 2 | 0 | 0 | 0 | 0 |
| 8192 | 2 | 0 | 0 | 0 | 0 |
| 16384 | 2 | 0 | 0 | 0 | 0 |
| 1024 | 3 | 0 | 0 | 0 | 0 |
| 2048 | 3 | 0 | 0 | 0 | 0 |
| 4096 | 3 | 0 | 0 | 0 | 0 |
| 8192 | 3 | 0 | 0 | 0 | 0 |
| 16384 | 3 | 0 | 0 | 0 | 0 |
+-----------+----------------------+------------+------------+----------------+-----------------+
20 rows in set (0.00 sec)
# INNODB_CMPMEM_RESET表
root@localhost : information_schema 11:44:01> select * from INNODB_CMPMEM_RESET;
+-----------+----------------------+------------+------------+----------------+-----------------+
| page_size | buffer_pool_instance | pages_used | pages_free | relocation_ops | relocation_time |
+-----------+----------------------+------------+------------+----------------+-----------------+
| 1024 | 0 | 0 | 0 | 0 | 0 |
| 2048 | 0 | 0 | 0 | 0 | 0 |
| 4096 | 0 | 0 | 0 | 0 | 0 |
| 8192 | 0 | 0 | 0 | 0 | 0 |
| 16384 | 0 | 0 | 0 | 0 | 0 |
| 1024 | 1 | 0 | 0 | 0 | 0 |
| 2048 | 1 | 0 | 0 | 0 | 0 |
| 4096 | 1 | 0 | 0 | 0 | 0 |
| 8192 | 1 | 0 | 0 | 0 | 0 |
| 16384 | 1 | 0 | 0 | 0 | 0 |
| 1024 | 2 | 0 | 0 | 0 | 0 |
| 2048 | 2 | 0 | 0 | 0 | 0 |
| 4096 | 2 | 0 | 0 | 0 | 0 |
| 8192 | 2 | 0 | 0 | 0 | 0 |
| 16384 | 2 | 0 | 0 | 0 | 0 |
| 1024 | 3 | 0 | 0 | 0 | 0 |
| 2048 | 3 | 0 | 0 | 0 | 0 |
| 4096 | 3 | 0 | 0 | 0 | 0 |
| 8192 | 3 | 0 | 0 | 0 | 0 |
| 16384 | 3 | 0 | 0 | 0 | 0 |
+-----------+----------------------+------------+------------+----------------+-----------------+
20 rows in set (0.00 sec)
- 验证、测试、整理:罗小波
- QQ:309969177
- 提示:本系列文章的主体结构遵循Oracle MySQL 官方 5.7 手册中,关于information_schema、mysql schema、performance_schema、sys schema的章节结构体系,并额外添加了一些验证、测试数据。鉴于本人精力和能力有限,难免出现一些纰漏,欢迎大家踊跃指正!