CREATE TEMPORARY TABLE `INNODB_CMP_PER_INDEX` (
`database_name` varchar(192) NOT NULL DEFAULT '',
`table_name` varchar(192) NOT NULL DEFAULT '',
`index_name` varchar(192) NOT NULL DEFAULT '',
`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
# 需要先启用innodb_cmp_per_index_enabled系统参数为ON,然后在innodb表中使用建表选项key_block_size指定一个小于默认的page size的块大小时才会有数据
## INNODB_CMP_PER_INDEX表
root@localhost : test 12:38:08> select * from information_schema.INNODB_CMP_PER_INDEX;
+---------------+------------+------------+--------------+-----------------+---------------+----------------+-----------------+
| database_name | table_name | index_name | compress_ops | compress_ops_ok | compress_time | uncompress_ops | uncompress_time |
+---------------+------------+------------+--------------+-----------------+---------------+----------------+-----------------+
| test | test | i_id | 4 | 4 | 0 | 0 | 0 |
+---------------+------------+------------+--------------+-----------------+---------------+----------------+-----------------+
1 row in set (0.00 sec)
## INNODB_CMP_PER_INDEX_RESET表
root@localhost : test 12:38:11> select * from information_schema.INNODB_CMP_PER_INDEX_RESET;
+---------------+------------+------------+--------------+-----------------+---------------+----------------+-----------------+
| database_name | table_name | index_name | compress_ops | compress_ops_ok | compress_time | uncompress_ops | uncompress_time |
+---------------+------------+------------+--------------+-----------------+---------------+----------------+-----------------+
| test | test | i_id | 4 | 4 | 0 | 0 | 0 |
+---------------+------------+------------+--------------+-----------------+---------------+----------------+-----------------+
1 row in set (0.00 sec)