arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 0811.3062cs.DS
收藏

动态外部哈希:缓冲的极限

Dynamic External Hashing: The Limit of Buffering

Zhewei Wei, Ke Yi, Qin Zhang

摘要:

哈希表是计算机科学中最基本的数据结构之一,无论在理论上还是在实践中都是如此。它们在外部存储器中特别有用,在外部存储器中,它们的查询性能接近仅一次磁盘访问的理想成本。Knuth给出了一个优雅的分析,表明使用一些简单的冲突解决策略(如线性探测或链接),查找的预期平均磁盘I/O数仅为$1+1/2^{Ω(b)}$,其中每个I/O可以读取包含$b$项的磁盘块。向哈希表中插入新项也会消耗$1+1/2^{Ω(b)}$ I/O,如果哈希表完全存储在磁盘上,这几乎是最好的方法。然而,这种假设是不现实的,因为任何在外部哈希表上运行的算法都必须有一些内部内存(至少是$Ω(1)$块)来工作。对于许多外部存储器数据结构,小的内部存储器缓冲区的可用性可以显著地减少对$o(1)$ I/O的摊销插入成本。在本文中,我们研究了固有的查询插入外部哈希表中存在的内存缓冲区的权衡。特别是,我们表明,对于任何常数$c>1$,如果查询成本是针对$1+O(1/b^{c})$ I/O,那么它是不可能的,以支持插入小于$1-O(1/b^{\frac{c-1}{4}})$ I/O摊销,这意味着内存缓冲区基本上是无用的。而对于任何常量$c<1$,如果将查询成本放宽为$1+O(1/b^{c})$ I/O,则存在具有$o(1)$插入成本的简单动态哈希表。这些结果也回答了Jensen和Pagh最近提出的一个悬而未决的问题。

英文摘要:

Hash tables are one of the most fundamental data structures in computer science, in both theory and practice. They are especially useful in external memory, where their query performance approaches the ideal cost of just one disk access. Knuth gave an elegant analysis showing that with some simple collision resolution strategies such as linear probing or chaining, the expected average number of disk I/Os of a lookup is merely $1+1/2^{Ω(b)}$, where each I/O can read a disk block containing $b$ items. Inserting a new item into the hash table also costs $1+1/2^{Ω(b)}$ I/Os, which is again almost the best one can do if the hash table is entirely stored on disk. However, this assumption is unrealistic since any algorithm operating on an external hash table must have some internal memory (at least $Ω(1)$ blocks) to work with. The availability of a small internal memory buffer can dramatically reduce the amortized insertion cost to $o(1)$ I/Os for many external memory data structures. In this paper we study the inherent query-insertion tradeoff of external hash tables in the presence of a memory buffer. In particular, we show that for any constant $c>1$, if the query cost is targeted at $1+O(1/b^{c})$ I/Os, then it is not possible to support insertions in less than $1-O(1/b^{\frac{c-1}{4}})$ I/Os amortized, which means that the memory buffer is essentially useless. While if the query cost is relaxed to $1+O(1/b^{c})$ I/Os for any constant $c<1$, there is a simple dynamic hash table with $o(1)$ insertion cost. These results also answer the open question recently posed by Jensen and Pagh.

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

↑