content_image/714715.jpg
<img src='content_image/714715.jpg'>

The topics that follow describe row format storage characteristics and how to define and determine the row format of a table. 

## REDUNDANT Row Format 

•REDUNDANT Row Format 

•COMPACT Row Format 

•DYNAMIC Row Format 

•COMPRESSED Row Format 

•Defining the Row Format of a Table 

•Determining the Row Format of a Table 

The REDUNDANT  format provides compatibility with older versions of MySQL. 

Tables that use the REDUNDANT  row format store the first 768 bytes of variable-length column values ( VARCHAR , VARBINARY , and BLOB  and TEXT  types) in the index record within the B-tree node, with the remainder stored on overflow pages. Fixed-length columns greater than or equal to 768 bytes are encoded as variable-length columns, which can be stored off-page. For example, a CHAR(255)  column can exceed 768 bytes if the maximum byte length of the character set is greater than 3, as it is with utf8mb4 . 

If the value of a column is 768 bytes or less, an overflow page is not used, and some savings in I/O may result, since the value is stored entirely in the B-tree node. This works well for relatively short BLOB  column values, 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, and contain too few rows, making the entire index less efficient than if rows were shorter or column values were stored off-page. 

## REDUNDANT Row Format Storage Characteristics 

The REDUNDANT  row format has the following storage characteristics: 

•Each index record contains a 6-byte header. The header is used to link together consecutive records, and for row-level locking. 

•Records in the clustered index contain fields for all user-defined columns. In addition, there is a 6-byte transaction ID field and a 7-byte roll pointer field. 

•If no primary key is defined for a table, each clustered index record also contains a 6-byte row ID field. 

•Each secondary index record contains all the primary key columns defined for the clustered index key that are not in the secondary index. 

•A record contains a pointer to each field of the record. If the total length of the fields in a record is less than 128 bytes, the pointer is one byte; otherwise, two bytes. The array of pointers is called the record directory. The area where the pointers point is the data part of the record. 

