docs/components/read_flow/index.md
RocksDB serves reads through a layered search path: memtables, then SST files organized by LSM levels. Each read acquires a SuperVersion for a consistent snapshot, searches from newest to oldest data, and resolves merges, deletions, and blob references before returning. Multiple caching tiers, bloom filters, and prefetching mechanisms minimize I/O on the hot path.
Key source files: db/db_impl/db_impl.cc, db/version_set.cc, db/db_iter.cc, table/block_based/block_based_table_reader.cc, db/memtable.cc, db/range_del_aggregator.cc
| Chapter | File | Summary |
|---|---|---|
| 1. Point Lookup (Get) | 01_point_lookup.md | DBImpl::GetImpl end-to-end flow: SuperVersion acquisition, snapshot selection, memtable search, SST search, and post-processing. |
| 2. MultiGet Optimizations | 02_multiget.md | Batched point lookups with sorted keys, shared SuperVersion, coalesced I/O, block reuse, batched bloom filters, and async cache lookups. |
| 3. SuperVersion and Snapshot Isolation | 03_superversion_and_snapshots.md | SuperVersion structure, thread-local caching, refcounting, sequence number assignment, and snapshot visibility guarantees. |
| 4. MemTable Lookup | 04_memtable_lookup.md | MemTable::Get flow with bloom filter check, skiplist search, SaveValue callback, range deletion integration, and immutable memtable search order. |
| 5. SST File Lookup | 05_sst_file_lookup.md | FilePicker level-by-level search, L0 epoch ordering, L1+ binary search, TableCache::Get, bloom filter integration, and GetContext state machine. |
| 6. Block Cache Integration | 06_block_cache.md | Multi-tier cache architecture, cache key construction, miss handling, admission policies, priority levels, and secondary cache. |
| 7. Iterator and Scan Path | 07_iterator_scan.md | Iterator stack (DBIter, MergingIterator, child iterators), direction model, FindNextUserEntry resolution, seek optimization, and pinned iteration. |
| 8. Range Deletion Handling | 08_range_deletions.md | RangeDelAggregator architecture, tombstone fragmentation, ShouldDelete algorithm, file boundary truncation, and point lookup vs iterator integration. |
| 9. Merge Operator Resolution | 09_merge_resolution.md | MergeContext operand collection, full vs partial merge, resolution in Get/Iterator/Compaction paths, and snapshot boundary constraints. |
| 10. Prefetching and Async I/O | 10_prefetching_and_async_io.md | FilePrefetchBuffer, auto-readahead for scans, adaptive readahead, async I/O integration, and MultiGet I/O coalescing. |
| 11. ReadOptions and Tuning | 11_read_options_and_tuning.md | Key ReadOptions fields, prefix seek modes, iterator bounds, read tiers, performance characteristics, and common read patterns. |
prefix_seek_opt_in_only gates prefix mode behind explicit opt-inseq <= snapshot_seq are visible