gpt4 book ai didi

javascript - Couchbase 全局二级指数 (GSI) 与普通指数

转载 作者:行者123 更新时间:2023-12-03 03:42:38 25 4
gpt4 key购买 nike

自 4.0 起,我一直在研究 Couchbase 中的全局二级索引功能,现在已在 5.0 中改进为具有自动重新平衡功能

在下面提到的视频中,与通常存储在 MapReduce View 中的普通二级索引相比,GSI 有多种优势。 GSI 是基于节点的,而 MapReduce View 是本地的、基于分区的。

听起来 GSI 是所有索引解决方案的 Elixir 。 map 缩减 View 的一些显着优势包括:* 对于高数据操作数据库来说更好 - 但 GSI 能够推迟索引的构建,从而减少问题,而且与插入相比,我倾向于看到查询变得更加复杂并且花费更多时间。* 可以使用 javascript 进行索引逻辑 - 我认为这只适用于极少数情况。

如果GSI这么好的话,它会成为默认索引吗?我忍不住认为小型数据库(即小于 1GB)不应该需要 GSI。听起来太复杂了。我是否遗漏了一些东西,一个让人们选择普通指数与 GSI 的关键点?

引用文献:

最佳答案

在某些情况下,MapReduced View 是首选。

查看此Couchbase forum post详情:

Views will continue to be recommended for the following cases:

  1. Using Javascript logic as part of the query
  2. Performing aggregation (reduce), materializing the results, and then maintaing the results incrementally as the source data is modified.

(2) is important for performance, because the aggregate results are essentially pre-computed.

关于javascript - Couchbase 全局二级指数 (GSI) 与普通指数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45552733/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com