Introduction
Modern in-memory databases face significant performance bottlenecks due to traditional B+-tree indices. While B+-trees are standard, they often suffer from heavy latching (locking) requirements in multi-core environments and poor cache locality, especially on Non-Uniform Memory Access (NUMA) architectures. This paper introduces PI (Parallel Index), a latch-free, NUMA-aware index based on a modified skip list. By leveraging SIMD instructions and a novel workload redistribution technique, PI achieves up to 3x higher query throughput compared to state-of-the-art B-tree variants.
System Architecture
PI reimagines the skip list structure to better align with modern hardware capabilities. The design is centered around two primary layers:
- Storage Layer: A standard linked list of data nodes at the base level (Level 1).
- Index Layer: The upper routing levels of the skip list (Levels 2-4), stored in contiguous memory blocks to maximize cache efficiency.
This separation allows PI to maintain the probabilistic benefits of skip lists while overcoming the "pointer-chasing" performance penalties typically associated with them. By partitioning data across NUMA nodes, PI ensures that queries are routed to the local memory of the relevant CPU socket, minimizing slow remote accesses.
Technical Innovations
SIMD-Accelerated Search
Because the Index Layer is stored contiguously, PI can pack multiple keys into a single "entry." This enables the use of Single Instruction, Multiple Data (SIMD) instructions to compare a query key against all keys in an entry simultaneously. A routing table then uses the resulting bitmask to determine the next step in the traversal, significantly speeding up the search process.
Latch-Free Workload Redistribution
The most significant innovation in PI is its approach to concurrency. Traditional indices use latches to manage simultaneous access, which limits parallelism. PI instead processes queries in batches and employs a workload redistribution phase.
Before any modifications occur, threads communicate to negotiate strictly disjoint segments of the storage layer. By ensuring that no two threads ever access the same node for a write operation, PI completely eliminates the need for expensive latches.
Performance Evaluation
The authors evaluated PI using the Yahoo! Cloud Serving Benchmark (YCSB) against Masstree, a highly optimized B-tree variant. Key findings include:
- Throughput: PI achieved approximately 34 million searches/sec on a 2M key dataset, outperforming Masstree by 3x to 5x.
- Scalability: PI demonstrated super-linear scalability when moving from 1 to 4 threads, as partitioned indices fit more effectively into L1/L2 caches.
- Skew Resistance: The dynamic NUMA load-balancing mechanism allowed PI to maintain high throughput even under highly skewed Zipfian workloads ($\theta = 0.9$).
Conclusion and Future Work
PI demonstrates that a carefully designed skip list can outperform traditional B-trees in high-concurrency, in-memory environments. By prioritizing coordination over locking and utilizing hardware-level optimizations like SIMD and NUMA-awareness, PI sets a new bar for parallel indexing. Future work includes implementing finer-grained background index rebuilding and further hardware-specific optimizations like TLB miss reduction.
Summary updated