您的位置:首页 > 其它

表压缩(innodb)

2017-10-08 21:10 134 查看
1.所有节点修改参数先

vim /home/mysql/conf/s01.cnf

vim /home/mysql/conf/s02.cnf

#compress

innodb_file_format=Barracuda

innodb_file_per_table=1

mysql> set global innodb_file_format=Barracuda;

mysql> SET GLOBAL innodb_file_per_table=1;

check:

mysql> show variables like 'innodb_file%';

2.检查状态(主)

use bdzh;

mysql> show table status like 'dim_image'\G

 Row_format: Compact --未压缩

3.压缩表在线操作(主)

mysql> alter table dim_image key_block_size=8 row_format=compressed;

4.检查是否压缩( 主备)

mysql> show table status like 'dim_image'\G

 Row_format: Compressed --压缩了

1.6g的表压缩到了1.2g。用时<2min。实际使用效率待测试.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: