Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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:

FieldSize
Schema version2 bytes
Key columns hash4 bytes
Key chunk:
Key chunk size
4 bytes
Flags1 byte
Variable-length columns offsets table size2 bytes
Variable-length columns offsets tableVariable (number of non-null varlen columns * 4)
Fix-sized columns valuesVariable
Variable-length columns valuesVariable
Value chunk:
Value chunk size4 bytes
Flags1 byte
Null-map
  • (number of columns / 8) bytes -
  • If the value columns contains nullable column
:
  • ;
  • 0 bytes - otherwise
Variable-length  columns offsets table size2 bytes
Variable-length  columns offsets tableVariable (number of non-null varlen columns * 4)
Fix-sized columns valuesVariable
Variable-length columns valuesVariable

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.

...