Home  >  Article  >  Database  >  MySQL压缩表的一种应用

MySQL压缩表的一种应用

WBOY
WBOYOriginal
2016-06-07 15:54:591260browse

1.设置服务器参数innodb_file_per_table=ONinnodb_file_format=Barracuda 2.创建表或者修改表参数alter table sod_song_log_2014

1.设置服务器参数
innodb_file_per_table=ON
innodb_file_format=Barracuda

2.创建表或者修改表参数
alter table sod_song_log_2014_10_12 row_format=compressed key_block_size=8;

业务系统都有很多日志数据,超过半年一年可以做离线处理,但是不能删除(老板说以后要做数据挖掘)
这时候可以单独启动一个实例,作为集中日志服务器,所有的表均采用压缩表
 这样既可以使用数据(挖掘),又可以减少磁盘空间占用.

压缩之前的日志数据

在经过压缩之后,

可以看到占用空间从3.2G减小为1.2G.效果十分明显.

本文永久更新链接地址

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn