Skip to content

Commit 02e742f

Browse files
dfa1claude
andcommitted
docs: document O(1) random access as a key read performance driver
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent d8fa7da commit 02e742f

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

docs/explanation.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,15 @@ unique values).
157157

158158
#### Why Vortex is faster on single-column reads
159159

160+
**0. O(1) random access within a column.**
161+
Fixed-width encodings (ALP, BitPacked) make row N directly addressable:
162+
`byte_offset = column_base + N * fixed_bits / 8`. Reading row 5 000 000 does not
163+
require scanning or decompressing rows 0–4 999 999. The OS pages in only the
164+
memory-mapped region that is actually touched, so filtered scans that skip
165+
large ranges pay nothing for the skipped bytes. Variable-width encodings (RLE,
166+
RunEnd) are not O(1), but they encode low-cardinality columns where the run table
167+
is tiny and the scan is over a handful of entries, not individual rows.
168+
160169
**1. mmap zero-copy.**
161170
Vortex reads directly from the mmap'd `MemorySegment` — the file bytes _are_ the decode
162171
input, no intermediate copies. Hardwood reads into internal page buffers and materialises

0 commit comments

Comments
 (0)