Vonng / ddia

《Designing Data-Intensive Application》DDIA中文翻译

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

第三章存储与检索,散列索引这章最后一段翻译是不是有问题

chlch opened this issue · comments

散列表必须能放进内存。如果你有非常多的键,那真是倒霉。原则上可以在硬盘上维护一个散列映射,不幸的是硬盘散列映射很难表现优秀。它需要大量的随机访问 I/O,而后者耗尽时想要再扩充是很昂贵的,并且需要很烦琐的逻辑去解决散列冲突

我理解应该是内存耗尽

commented

后面几句说的都是如果不能把索引放进内存里,用硬盘存储来解决的话,一旦硬盘的随机读写能力也用满了,再想扩展挺麻烦的。

原文供参考:
The hash table must fit in memory, so if you have a very large number of keys, you’re out of luck. In principle, you could maintain a hash map on disk, but unfortunately it is difficult to make an on-disk hash map perform well. It requires a lot of random access I/O, it is expensive to grow when it becomes full, and hash collisions require fiddly logic [5].