arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2503.23397cs.DBcs.DScs.PF
收藏

FB$^+$-tree:一种支持无锁更新的内存优化B$^+$-tree

FB$^+$-tree: A Memory-Optimized B$^+$-tree with Latch-Free Update

Yuan Chen, Ao Li, Wenhai Li, Lingfeng Deng

AI总结:

本文提出FB$^+$-tree,一种结合B$^+$-tree和trie优势的内存优化索引结构,通过特征字节分支和乐观锁实现无锁更新,在多线程下性能显著优于传统B$^+$-tree。

摘要:

B$^+$-tree凭借其通用性和平衡结构,在传统数据库系统中非常普遍。虽然二分查找通常用于分支操作,但在内存场景中可能导致缓存利用率低下。相比之下,基于trie的索引结构通过前缀匹配驱动分支操作。虽然这些结构通常产生更少的缓存未命中,因此日益流行,但由于频繁的指针追踪,它们在范围扫描中可能表现不佳。本文提出了一种高性能的B$^+$-tree变体,称为Feature B$^+$-tree(FB$^+$-tree)。类似于trie中使用位或字节进行分支操作,FB$^+$-tree在其内部节点的每一层逐步考虑公共前缀之后的几个字节——称为特征,这使得FB$^+$-tree能够从前缀倾斜中受益。FB$^+$-tree模糊了B$^+$-tree和trie之间的界限,同时仍保持平衡。在最佳情况下,FB$^+$-tree几乎变成了trie,而在最坏情况下,它继续作为B$^+$-tree运行。同时,设计了一个结合链接技术和乐观锁的精心同步协议,以支持高效的并发索引访问。独特的是,FB$^+$-tree利用与乐观锁无缝协调的微妙原子操作来促进无锁更新,这可以轻松扩展到其他结构。在多种工作负载-数据集组合上的密集实验表明,FB$^+$-tree的查找性能与最先进的基于trie的索引相当,并且在96线程下比流行的B$^+$-tree快2.3x到3.7x。FB$^+$-tree在其他工作负载上也展现出显著潜力,特别是在争用下的更新工作负载和扫描工作负载。

英文摘要:

B$^+$-trees are prevalent in traditional database systems due to their versatility and balanced structure. While binary search is typically utilized for branch operations, it may lead to inefficient cache utilization in main-memory scenarios. In contrast, trie-based index structures drive branch operations through prefix matching. While these structures generally produce fewer cache misses and are thus increasingly popular, they may underperform in range scans because of frequent pointer chasing. This paper proposes a new high-performance B$^+$-tree variant called \textbf{Feature B$^+$-tree (FB$^+$-tree)}. Similar to employing bit or byte for branch operation in tries, FB$^+$-tree progressively considers several bytes following the common prefix on each level of its inner nodes\textemdash referred to as features, which allows FB$^+$-tree to benefit from prefix skewness. FB$^+$-tree blurs the lines between B$^+$-trees and tries, while still retaining balance. In the best case, FB$^+$-tree almost becomes a trie, whereas in the worst case, it continues to function as a B$^+$-tree. Meanwhile, a crafted synchronization protocol that combines the link technique and optimistic lock is designed to support efficient concurrent index access. Distinctively, FB$^+$-tree leverages subtle atomic operations seamlessly coordinated with optimistic lock to facilitate latch-free updates, which can be easily extended to other structures. Intensive experiments on multiple workload-dataset combinations demonstrate that FB$^+$-tree shows comparable lookup performance to state-of-the-art trie-based indexes and outperforms popular B$^+$-trees by 2.3x$\ \sim\ $3.7x under 96 threads. FB$^+$-tree also exhibits significant potential on other workloads, especially update workloads under contention and scan workloads.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑