InnoDB Row Formats
The row format of a table determines how its rows are physically stored, which in turn can affect the performance of queries and DML operations. As more rows fit into a single disk page, queries and index lookups can work faster, less cache memory is required in the buffer pool, and less I/O is required to write out updated values.
The data in each table is divided into pages. The pages that make up each table are arranged in a tree data structure called a B-tree index. Table data and secondary indexes both use this type of structure. The B-tree index that represents an entire table is known as the clustered index, which is organized according to the primary key columns. The nodes of a clustered index data structure contain the values of all columns in the row. The nodes of a secondary index structure contain the values of index columns and primary key columns.
Variable-length columns are an exception to the rule that column values are stored in B-tree index nodes. Variable-length columns that are too long to fit on a B-tree page are stored on separately allocated disk pages called overflow pages. Such columns are referred to as off-page columns. The values of off-page columns are stored in singly-linked lists of overflow pages, with each such column having its own list of one or more overflow pages. Depending on column length, all or a prefix of variable-length column values are stored in the B-tree to avoid wasting storage and having to read a separate page.
The InnoDB
storage engine supports four row formats: REDUNDANT
, COMPACT
, DYNAMIC
, and COMPRESSED
.
Table 14.9 InnoDB Row Format Overview
Row Format | Compact Storage Characteristics | Enhanced Variable-Length Column Storage | Large Index Key Prefix Support | Compression Support | Supported Tablespace Types | Required File Format |
---|---|---|---|---|---|---|
REDUNDANT |
No | No | No | No | system, file-per-table, general | Antelope or Barracuda |
COMPACT |
Yes | No | No | No | system, file-per-table, general | Antelope or Barracuda |
DYNAMIC |
Yes | Yes | Yes | No | system, file-per-table, general | Barracuda |
COMPRESSED |
Yes | Yes | Yes | Yes | file-per-table, general | Barracuda |
- 点赞
- 收藏
- 关注作者
评论(0)