Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Production Architecture & Real-World Applications

This document details practical integration patterns, performance trade-offs, and target use cases for learned index structures.


Decision Matrix: Selecting the Right Index Structure

Workload CharacteristicRecommended StructureRationale
Frequent in-place mutations / OLTPBTreeMap / B+TreeBetter suited for dynamic concurrent writes, page splits, and transaction management.
Immutable / Read-heavy sorted datasets (< 10M keys)PgmIndexIdeal for SSTables in LSM engines, Parquet columnar row groups, and static lookup tables.
Massive datasets (> 10M keys) where segments overflow L3MultilevelPgmIndexRecursive PGM tree guarantees O(h * log eps) lookup without binary searching large segment arrays.
Irregular distributions / Extreme Pareto skew / Micro-burstsBTreeMap / EytzingerSearchLocalized tree node caching and branchless binary search outperform linear approximation when segment counts explode.
Memory-constrained environmentsPgmIndex / MultilevelPgmIndexReduces index metadata footprint by up to 14,700x (~5.7x total resident RAM) compared to pointer-based trees.
Batch ingestion / SSTable compactionmerge_sorted_batchMerges sorted batches in O(N + M) and rebuilds streaming PLA segments at > 10M keys/sec.
Cache-friendly binary searchEytzingerSearchReplaces standard slice::binary_search with branchless level-order traversal when duplicate data buffer is tolerable.
Zero extra memory allowedslice::binary_searchIn-situ search over pre-sorted data with 0 KB metadata overhead.

Production Applications

1. Columnar OLAP Engines (ClickHouse, DuckDB, Apache Parquet)

Analytical columnar engines process sorted row groups containing millions of records. Replacing conventional coarse zone maps with PGM linear segments enables sub-microsecond tuple filtering without disk or memory amplification.

2. LSM-Tree Storage Engines (RocksDB, ScyllaDB, LevelDB)

SSTables written to NVMe storage are strictly immutable. Replacing sparse block index tables with compact PGM models allows billions of key offsets to reside resident in CPU cache or RAM, ensuring exactly 1 physical I/O per query.

3. OS File System Cataloging & Forensic Indexing

Fast file catalogers (e.g. NTFS Master File Table / USN journal indexers) can index tens of millions of records in only a few kilobytes of RAM.

4. High-Throughput Network Routing (Forwarding Information Base)

At line rates exceeding 100 Gbps, IP forwarding tables must guarantee bounded lookup latency without saturating CPU cache lines.