dynamic and compressed Row Formats
This section discusses the dynamic and compressed row formats for
InnoDB tables. You can only
create these kinds of tables when the innodb_f ile_format [1752] configuration option is set to
Barracuda. (The Barracuda file format also allows the COMPACT and REDUNDANT row formats.)
When a table is created with row_format= dynamic or row_format=compressed, long column
values are stored fully off-page, and the clustered index record contains only a 20-byte pointer to the overflow page.
Whether any columns are stored off-page depends on the page size and the total size of the row.
When the row is too long, InnoDB chooses the longest columns for off-page storage until the clustered index record fits on the B-tree page.
The dynamic row format maintains the efficiency of storing the entire row in the index node if it fits
(as do the compact and redundant formats), but this new format avoids the problem of filling B-tree
nodes with a large number of data bytes of long columns. The dynamic format is based on the idea
that if a portion of a long data value is stored off-page, it is usually most efficient to storę all of the value
off-page. With DYNAMIC format, shorter columns are likely to remain in
the B-tree node, minimizing the
number of overflow pages needed for any given row.
The compressed row format uses similar internal details for off-page storage as the dynamic
row format, with additional storage and performance considerations from the table and index data
being compressed and using smaller page sizes. With the COMPRESSED row format, the option
key block size Controls how much column data is stored in the clustered index, and how much
is placed on overflow pages. For fuli details about the compressed row format, see Section 5.4.6,
‘Working with InnoDB Compressed Tables”.