Introduction
Learned indexes have emerged as a powerful alternative to traditional B+trees, leveraging machine learning models to predict data locations and significantly reduce memory footprints and lookup times. However, as modern hardware shifts toward high-concurrency multi-core systems, these indexes often hit a "scalability wall." While they perform exceptionally well in single-threaded scenarios, their performance frequently plateaus or degrades when multiple CPU cores attempt simultaneous updates.
SALI (Scalable Adaptive Learned Index) is a novel framework designed to dismantle these bottlenecks. By replacing high-contention hardware counters with lightweight probability models and introducing adaptive "node-evolving" strategies, SALI achieves over 2x the insertion throughput of previous state-of-the-art indexes while maintaining the lightning-fast lookups characteristic of learned models.
The Scalability Wall in Learned Indexes
Through rigorous analysis, the authors identified three primary bottlenecks that prevent existing learned indexes from scaling effectively in multi-core environments:
- Coarse-Grained Locking: Many designs lock large segments of the data structure during updates. In high-concurrency workloads, this leads to significant thread queuing, where CPU cores spend more time waiting for locks than performing useful work.
- Lookup Errors and Memory Bandwidth: Some learned indexes allow for "last mile" search errors, requiring a secondary search (like a binary search) to find the exact key. Under heavy concurrent access, these corrective searches saturate the system's memory bandwidth, creating a performance ceiling.
- Statistics Contention: To determine when a model needs retraining, indexes typically maintain exact counters (e.g., the number of insertions). In multi-core systems, every thread attempting to update the same global counter causes "cacheline ping-pong." This phenomenon occurs when CPU cores fight over the same piece of memory, forcing constant cache invalidations and destroying throughput.
The SALI Framework
SALI is built upon the foundation of LIPP+, a learned index known for its precise, error-free lookups. To address the scalability issues, SALI introduces two core innovations:
Lightweight Probability Models
Instead of relying on expensive global counters to trigger maintenance or retraining, SALI utilizes probabilistic estimation. The framework calculates the likelihood that a node requires retraining based on local insertion rates and timestamps. This shift allows individual threads to make local, autonomous decisions about index maintenance without constantly locking or updating shared memory counters, effectively eliminating the statistics contention bottleneck.
Adaptive Node-Evolving Strategies
SALI moves beyond static retraining by dynamically altering the physical structure of the index based on the specific workload of a node:
- Insert-Heavy Nodes: These nodes are expanded with additional "gaps" to accommodate future data points without causing immediate collisions, reducing the frequency of structural reorganizations.
- Hot Read Nodes: For frequently accessed data, SALI "flattens" the tree structure. This reduces the number of hops required to locate a key and enables the use of SIMD (Single Instruction, Multiple Data) instructions for high-speed parallel searches.
- Cold Nodes: To maintain memory efficiency, rarely accessed nodes are compacted, ensuring that the index does not waste space on stagnant data.
Experimental Evaluation
The authors evaluated SALI against several state-of-the-art indexes using real-world datasets from the SOSD and GRE benchmarks, including COVID (tweet IDs), FACE (Facebook user IDs), LIBIO (repository IDs), and "hard" datasets like OSM (OpenStreetMap locations) and GENOME (human genome location pairs).
Key Results
- Throughput: In write-only workloads using 64 threads, SALI outperformed the second-best learned index (ALEX+) by an average of 2.04x.
- Scalability: While competing indexes saw performance drop sharply once the thread count exceeded the number of physical CPU cores (due to lock contention), SALI continued to scale effectively even into hyper-threading ranges.
- Latency: SALI maintained consistently low 99.9% tail latency. In contrast, competitors like LIPP+ and ALEX+ experienced significant latency spikes as thread counts increased.
- Space Efficiency: The "cold node" compression strategy proved highly effective, reducing the total index size by 31% to 37% on complex datasets like OSM and GENOME.
Discussion and Future Work
SALI demonstrates that precision is the key to scaling; by providing exact lookups, it avoids the memory bandwidth saturation that plagues approximate models. Furthermore, it proves that in high-concurrency systems, being "mostly right" via probability models is superior to being "exactly right" via expensive global counters.
Despite its strengths, SALI currently does not support duplicate keys, a limitation inherited from its underlying LIPP structure. The authors suggest that future iterations could handle duplicates using overflow lists. Additionally, on very "easy" datasets with low tree depth, the logic used to identify "hot" nodes can introduce a slight overhead; a proposed "toggle switch" for read-evolving could mitigate this. Finally, while SALI excels at point lookups, future work will focus on optimizing range scans by identifying and specializing "hot scan" nodes.
Summary updated