Learned Index Lab Documentation
Welcome to the Learned Index Lab documentation portal — a pure Rust implementation and comparative benchmark suite for Piecewise Geometric Model (PGM) learned index structures.
Core Structures
PgmIndex: Single-pass optimal streaming Piecewise Linear Approximation (PLA) with strict $\epsilon$ error bounds and bounded local search.MultilevelPgmIndex: Hierarchical recursive PGM index reducing lookup complexity to $O(h \cdot \log \epsilon)$ for massive datasets.EytzingerSearch: Cache-conscious breadth-first binary search layout without approximation error.
Documentation Map
- Architecture & Production: Internal Rust memory layout, cache-line alignment, and production deployment patterns.
- Theoretical Foundations: Mathematical foundations of CDF approximation, streaming PLA, error corridors, and $\epsilon$ tuning.
- Integration Cookbook: Practical production recipes for point/range queries, concurrent reads, LSM SSTables, and zone maps.
- Statistical Benchmarks: Reproducible latency, memory, and build-time comparisons across synthetic and SOSD real-world workloads.
- Historical Archives: Frozen snapshots of previous major release READMEs.
Crate & Project Links
- GitHub Repository: Source code, issue tracker, and releases.
- Crates.io: Published Rust crate package.
- Docs.rs API Reference: Generated
rustdocAPI documentation. - Roadmap: Planned v0.5.0 milestones and SIMD/mmap roadmap.
- License (Apache-2.0): Open-source license terms.
References
Technical Articles & Deep Dives
- Why We’ve Been Indexing Data Wrong for 50 Years: Replacing B-Trees with Math in Rust: Architectural breakdown of CPU cache dynamics, the memory wall, mathematical CDF approximation, and real-world system implications of replacing pointer hierarchies with linear functions.
- Learned Indexes in Rust v0.2: Answering Reddit, Adding Range Queries, and Beating B-Trees: Community technical follow-up addressing memory overhead questions, implementing predecessor search (
lower_bound), slice scans, and expanding benchmark baselines.
Seminal Research Papers
- Kraska et al. (2018): “The Case for Learned Index Structures” (ACM SIGMOD 2018) – PDF (arXiv) · arXiv:1712.01208. Seminal paper proving that sorted indexes can be modeled as cumulative distribution function (CDF) regressions.
- Ferragina & Vinciguerra (2020): “The PGM-index: a fully-dynamic compressed learned index with provable worst-case bounds” (PVLDB 2020) – PDF (PVLDB) · PDF (arXiv) · arXiv:1910.06169. Establishes optimal piecewise linear approximation (PLA) under bounded error corridors $\epsilon$.
- Khuong & Morin (2017): “Array Layouts for Comparison-Based Searching” (ACM JEA 2017) – PDF (arXiv) · arXiv:1509.05053. Formalizes the cache-conscious Eytzinger array layout and branchless level-order search.
Reference Codebases & Implementations
- gvinciguerra/PGM-index: Official C++ reference implementation of the Piecewise Geometric Model index (University of Pisa, pgm.di.unipi.it).
- std::collections::BTreeMap: Rust Standard Library B-Tree implementation.
- slice::binary_search: Rust Standard Library core slice binary search.
- Algorithmica: Eytzinger Binary Search: Microarchitectural analysis of cache line alignment and branchless search.
Industry Storage Engines & Analytical Systems
- facebook/rocksdb: High-performance embedded key-value database using LSM-Trees and BlockBasedTable format.
- duckdb/duckdb: High-performance embedded analytical columnar database.
- ClickHouse/ClickHouse: High-performance columnar database management system for real-time analytics.
- apache/parquet-format: Open-source columnar storage format for deep nested and flat record data.
- scylladb/scylladb: Low-latency NoSQL columnar database written in C++.
- google/leveldb: Foundational LSM-Tree storage engine written by Sanjay Ghemawat and Jeff Dean.