...
Given a set of user-defined columns, this set is then rearranged so that fixed-sized columns go first. This sorted set of columns is used to form a row. Row layout is as follows:
Field | Size |
---|
Comments | |
---|---|
Schema version | 2 bytes. |
short number. The possible values are:
| ||
Key columns hash | 4 bytes | |
Key chunk: | ||
Key chunk size | 4 bytes | |
Flags | 1 byte | |
Variable-length columns offsets table size | 2 bytes | |
Variable-length columns offsets table |
Variable (number of non-null varlen |
columns * <format_size>) | <format_size> - depends on the Flags field. See the table below | |
Fix-sized columns values | Variable | |
Variable-length columns values | Variable | |
Value chunk: | ||
Value chunk size | 4 bytes | |
Flags | 1 byte | |
Null-map | (number of columns / 8 ) or |
0 bytes | Zero size if and only if schema has no nullable columns | |
Variable-length columns offsets table size | 2 bytes | |
Variable-length columns offsets table | Variable (number of non-null varlen columns * <format_size> |
Schema version is the short number. The possible values are:
...
) | <format_size> - depends on the Flags field. See the table below | |
Fix-sized columns values | Variable | |
Variable-length columns values | Variable |
...
For the small rows, the metadata sizes may introduce a very noticeable overhead, so it looks reasonable to write them in a more compact way using different techniques.
...