Skip to content

A key reference is a column slot whose values are not stored because they equal a 9-byte field inside the key of the same entry. It exists in columnar revisions 4 and 5 (SPEC V714). SEAM 1 writers produce it.

The slot reference field is c + 1, where c is the index of the column itself. The slot then holds:

  1. count(65535): the key offset off.
  2. tags, floats, bools and bytes as in an ordinary slot.
  3. No ints stream.

Every row’s tag in such a column is constant: INT (1) or TS (6).

The value equals the 9-byte key field at off:

  • key[off] is 0x03 for INT or 0x05 for TS, and
  • the value is BE u64(key[off+1..off+9]) ^ 2^63.

This is the order-preserving value encoding of an integer or timestamp.

Readers expand key references into the revision 3 layout in memory, filling the ints from the keys. A corrupt reference is Corrupt. In a revision 5 block the keys are first rebuilt from the typed key section (expand_typed_refs, mod.rs:2383).