无法更改 Java 版中的 Berkeley DB 数据库类型?

发布于 2024-10-11 09:48:06 字数 156 浏览 9 评论 0原文

我正在寻找将 BDB 的 Java 版本 4.1.7 的数据库类型从 BTree 更改为 Hash。 Core 版本有 DatabaseType.HASH、DatabaseType.RECNO 和 DatabaseType.Queue - Java 版本不支持这些。如果是这样,是否有理由放弃这些?

I was looking for changing the Database Type of Java Edition 4.1.7 of BDB from BTree to Hash. The Core version had DatabaseType.HASH, DatabaseType.RECNO and DatabaseType.Queue- Are these not supported in the Java Edition. If so is there a reason for dropping these?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

謌踐踏愛綪 2024-10-18 09:48:06

David Segleau,Berkeley DB 产品管理总监。一般来说,我们建议人们在 Berkeley DB 论坛上提问。您会在那里找到一个由活跃的 Berkeley DB 应用程序开发人员组成的大型社区。

是的,Berkeley DB(C语言的原始产品)有B-Tree、Hash、Queue和Recno访问方法。 Berkeley DB Java 版仅支持 B 树。主要原因是我们大约 99% 的用户使用 B-Tree 进行存储,而 Hash 只被一小部分应用程序使用。

围绕这个主题的一些有用的技术花絮:

  1. 哈希对于拥有庞大数据集和非常少量可用内存缓存的人来说特别有用。在这种特定场景中,B 树可能需要多个 I/O 才能获取内部索引页(不适合缓存),然后获取记录。哈希通常可以使用单个 I/O 访问数据记录。
  2. 如果您想要顺序访问数据或允许重复数据,则哈希通常没有帮助,因为哈希索引中没有隐含的顺序。
  3. 大多数应用程序都有足够的可用内存缓存来保存 B 树的内部节点以及最常访问的数据记录。在这种更常见的场景中,B 树和哈希将具有几乎相同的性能。
  4. 去年,Berkeley DB Java 版团队一直与使用超大型数据集(250GB - 低 TB 范围)的客户和应用程序开发人员密切合作。特别是,他们一直关注如何最大化缓存效率、改进缓存逐出算法以及最小化 Java 垃圾收集的影响。我们发现 BDB JE 4.1 在缓存管理和效率方面表现得更好,特别是对于超出可用缓存的数据集。有关此更改的更多信息,请参阅 Berkeley DB 下载页面上的 BDB JE 4.1.7 更改日志。
  5. 有关 Berkeley DB 中哈希与 B 树访问方法的更多信息,请参阅 BDB 参考手册的第 2 章(选择访问方法)。

David Segleau, Director of Product Management for Berkeley DB here. Generally, we recommend that people ask questions on the Berkeley DB forums. You'll find a large community of active Berkeley DB application developers there.

Yes, Berkeley DB (the original product in C) has B-Tree, Hash, Queue and Recno access methods. Berkeley DB Java Edition only supports B-Tree. The main reason for this is that about 99% of our users use B-Tree for storage and Hash is only used by a small subset of applications.

Some useful technical tidbits around this topic:

  1. Hash is particularly useful for people who have a huge data set and a very small amount of available memory cache. In this particular scenario, a B-Tree might require multiple I/Os in order to fetch the internal index pages (that don't fit in cache) and then fetch the record. Hash can typically access the data record with a single I/O.
  2. Hash is usually not helpful if you want to sequentially access of your data or allow duplicates, since there is no implied ordering in a Hash index.
  3. Most applications have sufficient available memory cache to to hold the internal nodes of a B-tree as well as the most frequently accessed data records. In this much more common scenario, B-tree and Hash will have almost identical performance.
  4. Over the last year the Berkeley DB Java Edition team has been working very closely with customers and application developers using very large data sets (in the 250GB - low TB range). In particular, they have been focusing on how to maximize cache efficiency, improve the cache eviction algorithms and minimize the impact of Java garbage collection. We've found that BDB JE 4.1 performs much better, in terms of cache management and efficiency, especially for data sets that exceed the available cache. For more information on this change, see the BDB JE 4.1.7 changelog on the Berkeley DB download page.
  5. For more information on Hash vs B-Tree access methods in Berkeley DB, see chapter 2 of the BDB Reference Manual (Selecting an Access Method).
生寂 2024-10-18 09:48:06

我也试图理解同样的事情。我也很欣赏在 berkeley db je 中使用哈希的可能性,因为我正在(1)场景中工作,因此内存大小和数据集大小之间具有特定的比率。

这方面有什么选择吗?你打算将来把它放回去吗? berkeley db je 在 oracle.com 上的网站表示,访问时间是恒定的,与数据集大小无关。如果您使用 BTree,则这种说法是错误的。

I was also trying to understand the same thing. I would too appreciate the possibility of using Hash in berkeley db je as I'm working in the (1) scenario, so with a particular ratio between memory size and dataset size.

Are there any options on this? are you planning to put this back in the future? berkeley db je's site on oracle.com says that access time is constant independently from the dataset size. If you use BTrees, this claim is wrong.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文