InnoDB tables have the following
Each index record contains a six-byte header. The header is used to link together consecutive records, and also in row-level locking.
Records in the clustered index contain fields for all user-defined columns. In addition, there is a six-byte transaction ID field and a seven-byte roll pointer field.
If no primary key was defined for a table, each clustered index record also contains a six-byte row ID field.
Each secondary index record also contains all the primary key fields 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 these pointers is called the record directory. The area where these pointers point is called the data part of the record.
InnoDB stores fixed-length
character columns such as
CHAR(10) in a fixed-length
InnoDB truncates trailing spaces
VARCHAR columns. Note
that MySQL may internally convert
CHAR columns to
Section 126.96.36.199, “Silent Column Specification Changes”.
NULL value reserves one or two
bytes in the record directory. Besides that, an SQL
NULL value reserves zero bytes in the
data part of the record if stored in a variable length
column. In a fixed-length column, it reserves the fixed
length of the column in the data part of the record.
Reserving the fixed space for
enables an update of the column from
to a non-
NULL value to be done in place
without causing fragmentation of the index page.