当数据库很大时使用 couchdb mapReduce 超时

问题描述

详情:

  • Apache CouchDB v. 3.1.1
  • 大约 5 GB 的 Twitter 数据已转储到分区中

我写的Map reduce函数

{
 "_id": "_design/Info","_rev": "13-c943aaf3b77b970f4e787be600dd240e","views": {
   "trial-view": {
     "map": "function (doc) {\n  emit(doc.account_name,1);\n}","reduce": "_count"
   }
 },"language": "javascript","options": {
   "partitioned": true
 }
}

当我在邮递员中尝试以下命令时:

http://:5984/mydb/_partition/partition1/_design/Info/_view/trial-view?key="BT"&group=true

我收到以下错误

{
    "error": "timeout","reason": "The request Could not be processed in a reasonable amount of time."
}

请帮助我如何在如此庞大的数据上应用mapReduce?

解决方法

所以,在意识到自己的错误后,我想到了回答我自己的问题。答案很简单。只是需要更多时间,因为索引需要很多时间。您可以查看元数据以查看正在索引的数据库数据。