mapreduce - CouchDB 的 stale=update_after 性能如何?

标签 mapreduce couchdb

我很好奇 stale=update_after CouchDB View API 的功能有效。

我可以看到 here它返回陈旧的结果,然后更新 View :

If stale=ok is set, CouchDB will not refresh the view even if it is stale, the benefit is a an improved query latency. If stale=update_after is set, CouchDB will update the view after the stale result is returned. update_after was added in version 1.1.0.



假设我插入了大量文档——足以需要几分钟来更新 View 索引——然后我用 stale=update_after 快速连续地查询 View 两次。 .第一个查询会很快返回;这就是update_after的全部意义.

我的问题是,第二个查询是否也会快速返回陈旧的结果,还是会等待 View 完成更新?

最佳答案

第二个查询也返回陈旧的结果。它使用查询到达服务器时可用的部分结果。如果您只是添加了文档,那就没问题了。

但是如果您修改了 View ,第一个查询将返回第一个查询的结果并触发 View 的完全重建。所以第二个查询可能不会提供结果或只有很少的行。

所以简短的回答:在您的情况下,两个查询都会快速返回,第二个查询可能会给出与第一个相同的结果,可能还有一些额外的行。

希望我能帮上忙!

你的,伯恩哈德

关于mapreduce - CouchDB 的 stale=update_after 性能如何?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12557801/

相关文章:

hadoop - 什么决定了 map() 将被调用多少次?

java - hadoop map reduce线程中整个reducer步骤是否安全?

parallel-processing - 并行化 CouchDB View 组索引器

hadoop - 在独立模式下执行hadoop示例时,权限被拒绝

Hadoop 1 个输入文件 = 1 个输出文件,仅映射

python - 使用 MongoDB 聚合框架计算一阶导数

couchdb - Hyperledger Fabric 是否可以归档?

javascript - 将函数代码映射为 CouchDB 上的过滤器复制器

android - 在 ionic 应用程序中创建远程 couchdb 数据库

javascript - PouchDB/CouchDB 复制失败,方法不允许