Documentation Home
MySQL 5.5 Reference Manual
Related Documentation Download this Manual Excerpts from this Manual

MySQL 5.5 Reference Manual  /  ...  /  COMPACT and REDUNDANT Row Formats

14.14.4 COMPACT and REDUNDANT Row Formats

Early versions of InnoDB used an unnamed file format (now called Antelope) for database files. With that file format, tables are defined with ROW_FORMAT=COMPACT or ROW_FORMAT=REDUNDANT. With these row formats, InnoDB stores up to the first 768 bytes of variable-length columns (VARCHAR, VARBINARY, and BLOB and TEXT types) in the index record within the B-tree node, with the remainder stored on the overflow pages.

For tables defined with ROW_FORMAT=COMPACT, CHAR is treated as variable-length column if the length of the column value is greater than or equal to 768 bytes, which can occur if the maximum byte length of the character set is greater than 3, as it is with utf8mb4, for example.

With the Antelope file format, if the value of a column is 768 bytes or less, no overflow page is needed, and some savings in I/O may result, since the value is in the B-tree node. This works well for relatively short BLOBs, but may cause B-tree nodes to fill with data rather than key values, reducing their efficiency. Tables with many BLOB columns could cause B-tree nodes to become too full of data, and contain too few rows, making the entire index less efficient than if the rows were shorter or if the column values were stored off-page.

To preserve compatibility with prior versions of InnoDB, InnoDB tables created in MySQL 5.5 default to the COMPACT row format rather than the newer DYNAMIC row format. See Section 14.14.3, “DYNAMIC and COMPRESSED Row Formats” for more information.

For information about the physical row structure of tables that use the REDUNDANT or COMPACT row format, see Section 14.11.3, “Physical Row Structure of InnoDB Tables”.

User Comments
Sign Up Login You must be logged in to post a comment.