`ROW_FORMAT=REDUNDANT` | Storage format used prior to MySQL 5.0.3 | Less efficient than `ROW_FORMAT=COMPACT`; for backward compatibility |
`ROW_FORMAT=COMPACT` | Default storage format since MySQL 5.0.3 | Stores a prefix of 768 bytes of long column values in the clustered index page, with the remaining bytes stored in an overflow page |
`ROW_FORMAT=DYNAMIC` | Available only with `innodb_file_format=Barracuda` | Store values within the clustered index page if they fit; if not, stores only a 20-byte pointer to an overflow page (no prefix) |
`ROW_FORMAT=COMPRESSED` | Available only with `innodb_file_format=Barracuda` | Compresses the table and indexes using zlib to default compressed page size of 8K bytes; implies`ROW_FORMAT=DYNAMIC` |
`KEY_BLOCK_SIZE=_n`_ | Available only with `innodb_file_format=Barracuda` | Specifies compressed page size of 1, 2, 4, 8 or 16K bytes; implies `ROW_FORMAT=DYNAMIC` and`ROW_FORMAT=COMPRESSED` |
那天有同事担心压缩之后假如性能不能接受能否改回未压缩版本,可以使用alter table row_format=compact,前提是innodb_strict_mode为0,否则提示ERROR 1005 (HY000): Can’t create table ‘test.#sql-4d7e_1’ (errno: 1478)类似的错误。改了之后在show create table的时候还会看到key_block_size,但是此时key_block_size已经被ignore了。推荐的方式重新建一张表,然后insert into select * from。 另外一篇orczhu写的关于innodb plugin压缩特性的文章,写的非常不错