-
Notifications
You must be signed in to change notification settings - Fork 111
INNODB_CMP和INNODB_CMP_RESET
xiaoboluo768 edited this page Jun 7, 2020
·
2 revisions
- 这两个表中的数据包含了与压缩的InnoDB表页有关的操作的状态信息。表中记录的数据为测量数据库中的InnoDb表压缩的有效性提供参考。
- 查询该表的用户必须具有PROCESS权限,该表为Memory引擎临时表
- 表定义语句
CREATE TEMPORARY TABLE `INNODB_CMP` (
`page_size` int(5) NOT NULL DEFAULT '0',
`compress_ops` int(11) NOT NULL DEFAULT '0',
`compress_ops_ok` int(11) NOT NULL DEFAULT '0',
`compress_time` int(11) NOT NULL DEFAULT '0',
`uncompress_ops` int(11) NOT NULL DEFAULT '0',
`uncompress_time` int(11) NOT NULL DEFAULT '0'
) ENGINE=MEMORY DEFAULT CHARSET=utf8
- 表字段含义
- PAGE_SIZE:表示压缩的页有效块大小(以字节为单位),例如:默认page size值为16K,则可压缩的块大小为16K、8K、4K、2K、1K,注意:这里的块大小指的是建表选项中指定的block size
- COMPRESS_OPS:表示PAGE_SIZE字段值大小的BTREE页被压缩的次数。当创建一个空白页或者非压缩页的修改日志空间用完,页都会被压缩
- COMPRESS_OPS_OK:表示PAGE_SIZE字段值大小的BTREE页成功压缩的次数。此计数不应超过COMPRESS_OPS字段值
- COMPRESS_TIME:尝试压缩大小为PAGE_SIZE字段值的BTREE页所花费的总时间(以秒为单位)
- UNCOMPRESS_OPS:表示PAGE_SIZE字段值大小的BTREE页被解压缩的次数。 B-tree页面在压缩失败时或在首次访问一个压缩页时在缓冲池中不存时被解压
- UNCOMPRESS_TIME:解压缩PAGE_SIZE字段值大小的BTREE页所用的总时间(单位秒)
- 表记录内容示例
# INNODB_CMP表
root@localhost : information_schema 11:02:28> select * from INNODB_CMP;
+-----------+--------------+-----------------+---------------+----------------+-----------------+
| page_size | compress_ops | compress_ops_ok | compress_time | uncompress_ops | uncompress_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 |
+-----------+--------------+-----------------+---------------+----------------+-----------------+
5 rows in set (0.00 sec)
# INNODB_CMP_RESET表
root@localhost : information_schema 11:33:00> select * from INNODB_CMP_RESET;
+-----------+--------------+-----------------+---------------+----------------+-----------------+
| page_size | compress_ops | compress_ops_ok | compress_time | uncompress_ops | uncompress_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 |
+-----------+--------------+-----------------+---------------+----------------+-----------------+
5 rows in set (0.00 sec)
- 验证、测试、整理:罗小波
- QQ:309969177
- 提示:本系列文章的主体结构遵循Oracle MySQL 官方 5.7 手册中,关于information_schema、mysql schema、performance_schema、sys schema的章节结构体系,并额外添加了一些验证、测试数据。鉴于本人精力和能力有限,难免出现一些纰漏,欢迎大家踊跃指正!