Skip to content

The stats frame

Worked example: footer revision 4 file

The stats frame has no explicit offset in the footer. It occupies [bloom_off + bloom_len, index_off), here [4556, 4611): 55 bytes, made of a 5-byte frame header, an 18-byte raw body and the 32-byte trailer. The AAD is "stc" ‖ 0x04 ‖ file_id u64 ‖ 0u32. See Block stats frame.

00 12 00 00 00 codec raw, block format 0, raw_len 18

This file’s footer is revision 4, so the stats frame is stats revision 1: there is no per-block versions code.

01 stats version 1
02 2 blocks
f0 06 00 07 07 00 f0 06 block 0: entries 880, deletes 0, min_ts 7, max_ts 7, rows 0, opaque 880
00 0 columns
78 00 07 07 00 78 00 block 1: entries 120, deletes 0, ts 7..7, rows 0, opaque 120, 0 columns
  • Counts are varints: f0 06 is 0x70 + 6 * 128 = 880.
  • rows is 0 and opaque equals entries: no entry is summarised per column, so every put counts as opaque. Block stats then prove nothing about values and may_match is true.
  • 880 + 120 = 1000, the footer’s entries.
  • The block count, 2, equals the number of index entries.