The index frame
The footer says the index frame starts at offset 4611 and is 89 bytes long. Those 89 bytes are a 5-byte frame header, a 52-byte body and the 32-byte seal trailer. The AAD is "stc" ‖ 0x02 ‖ file_id u64 ‖ 0u32. See Block index and Frame.
Frame header
Section titled “Frame header”00 34 00 00 00 codec raw (low nibble 0), block format 0 (high nibble 0), raw_len 52The index is raw rather than zstd because compressing 52 bytes did not pay; see writer policy.
Each entry is varint klen ‖ key ‖ ts u64 ‖ offset u64 ‖ len u32, 26 bytes here, and the key is the last key of the block. Two entries make the 52 bytes.
05 62 00 00 01 7b 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 a2 0c 00 00 klen 5, last key 'b' 0x0000017b (b379), ts 7, offset 0, len 323405 62 00 00 01 f3 07 00 00 00 00 00 00 00 a2 0c 00 00 00 00 00 00 7e 02 00 00 last key 'b' 0x000001f3 (b499), ts 7, offset 3234, len 638| Block | Last key | Offset | Length | Ends at |
|---|---|---|---|---|
| 0 | 'b' and 379 |
0 | 3234 | 3234 |
| 1 | 'b' and 499 |
3234 | 638 | 3872 |
Block 0 holds the 500 'a' keys and 'b' keys up to 379, which is 880 entries. Block 1 ends at 3872, which is bloom_off, so no padding was needed between the last data block and the bloom frame. Every offset + len must be at most bloom_off, and it is.
Finding a key
Section titled “Finding a key”To look up (user, ts), binary-search for the first entry whose last key is not less than it. The key 'b' and 400 sorts after block 0’s last key ('b' and 379), so the search lands on block 1.