2
我们目前正在使用MySQL和innodb,并且我们有一些大型表格,它们是行格式的紧凑型表格。当我将行格式更改为压缩格式时,我们仍然看到表格的大小相同。任何人都知道这个的原因?为什么在更改行格式时我的表格大小不会减少?
我们目前正在使用MySQL和innodb,并且我们有一些大型表格,它们是行格式的紧凑型表格。当我将行格式更改为压缩格式时,我们仍然看到表格的大小相同。任何人都知道这个的原因?为什么在更改行格式时我的表格大小不会减少?
是否有可能为表声明ROW_FORMAT = COMPRESSED,但是您没有启用配置值innodb_file_format = BARRACUDA?
如果你不做后面的步骤,那么梭子鱼行格式的任何请求都不会生效。而这样的请求生成一个警告:
mysql> alter table foo row_format=compressed;
Query OK, 0 rows affected, 2 warnings (0.03 sec)
Records: 0 Duplicates: 0 Warnings: 2
mysql> show warnings;
+---------+------+-----------------------------------------------------------------------+
| Level | Code | Message |
+---------+------+-----------------------------------------------------------------------+
| Warning | 1478 | InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope. |
| Warning | 1478 | InnoDB: assuming ROW_FORMAT=COMPACT. |
+---------+------+-----------------------------------------------------------------------+
此外,您不能使用压缩的行格式,除非您还启用innodb_file_per_table
。
mysql> alter table foo row_format=compressed;
Query OK, 0 rows affected, 2 warnings (0.03 sec)
Records: 0 Duplicates: 0 Warnings: 2
mysql> show warnings;
+---------+------+---------------------------------------------------------------+
| Level | Code | Message |
+---------+------+---------------------------------------------------------------+
| Warning | 1478 | InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table. |
| Warning | 1478 | InnoDB: assuming ROW_FORMAT=COMPACT. |
+---------+------+---------------------------------------------------------------+
我在更改行格式时没有收到任何警告。 – user962449
这是非常好的答案。谢谢比尔 - 今天也很有用4me ;-) – Artur