在CouchDB中,有没有什么方法可以改善View索引过程的性能? [英] In CouchDB, are there ways to improve performance of the View index process?

查看:116
本文介绍了在CouchDB中,有没有什么方法可以改善View索引过程的性能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些基本视图和一些带有逻辑的映射/缩小视图。没什么复杂的。文件不太多。我曾尝试处理250k,75k和10k的文档。似乎我一直在等待视图索引。

I have some basic views and some map/reduce views with logic. Nothing too complex. Not too many documents. I've tried with 250k, 75k, and 10k documents. Seems like I'm always waiting for view indexing.

视图中的代码更好,更有效吗?我假设它基本上是在所有聚合级别上处理视图。因此,那里必须有所改进。

Does better, more efficient code in the view help? I'm assuming it's basically processing the view at all levels of aggregation. So there must be some improvement there.

emit()-较少的数据帮助吗?发出(doc.id,doc)与指定较少的字段?

Does emit()-ing less data help? emit(doc.id, doc) vs specifying fewer fields?

复杂度较高的键会影响视图索引编制吗?

Do more or less complex keys impact view indexing?

还是全部有关内存,CPU内核和处理器速度?

Or is it all about memory, CPU cores, and processor speed?

必须有一些文档,但是我找不到任何引用方式

There must be some documentation out there, but I can't find anything referencing ways to improve performance.

推荐答案

我将对reduce函数进行更深入的研究。尝试使用内置的Erlang函数,例如 _sum _count ,而不是编写Javascript。

I would take a deeper look into the reduce function. Try to use the built-in Erlang functions like _sum, _count, instead of writing Javascript.

复杂的视图可能要花费数小时甚至更多,这很正常。

Complex views can take hours and more, that's normal.

也许发布这样不太复杂的地图/缩小。

Maybe post such not too complex map/reduce.

不要忘记:索引 all 文档仅在更改视图(或推送大量新文档)后才执行一次。

And don't forget: indexing all docs is only done once after changing the view (or pushing a whole bunch of new docs). Subsequent new docs are indexed incrementally.

使用带有& stale = ok 的视图检索旧文档即时获取数据,因此您无需等待。 (但是请注意:您始终必须至少调用一次没有 stale = ok 的视图才能触发索引过程)。或者更好:使用 stale = update_after

Use a view with &stale=ok to retrieve the "old" data instantly, so you don't have to wait. (But pay attention: you always have to call a view without stale=ok at least once to trigger the indexing process). Or better: use stale=update_after.

这篇关于在CouchDB中,有没有什么方法可以改善View索引过程的性能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆