couchdb - 如何在 Cloudant 或 CouchDB 中使用 skip 参数?

标签 couchdb cloudant

在 Cloudant 或 CouchDB 的索引中使用 skip 参数是否存在潜在的性能损失?有没有更好的技术可以使用?

最佳答案

Writing and Querying MapReduce Views in CouchDB有一个很好的例子和使用跳过参数的描述:

The skip parameter can be used along with the limit parameter to implement pagination. However, skipping a large number of rows can be inefficient. Instead, set the skip parameter’s value to 1 and use the key of the last row on the previous page as the startkey (endkey if output is reversed) parameter, and the document ID of the last row on the previous page as the startkey_docid (endkey_docid if output is reversed) parameter. This should give you better performance since CouchDB will not need to scan the entire range of skipped rows."



Scaling CouchDB中也有类似的信息

关于couchdb - 如何在 Cloudant 或 CouchDB 中使用 skip 参数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21238261/

相关文章:

node.js - 函数 Node 中的 for 循环导致 IBM Bluemix 上的 Node-RED 应用程序崩溃

mysql - elastic search + couchdb 或 sphinx + mysql .... 用于文档审查 SaaS

database-design - 让应用程序通过 REST Api 直接访问 CouchDB 是否安全?

webserver - 我可以使用 Couchdb 作为网络服务器和唯一的后端吗?

javascript - 代码没有按顺序执行

java - Cloudant java 非拉丁字符

couchdb - 如何将多个 CouchDB 查询合并为一个请求?

json - 如何将clojure代码映射到JSON?

docker - 错误:无法解析CouchDB Docker容器中的http://any:5984/verifytestdb/

json - 将 IBM 移动应用程序构建器连接到 Cloudant JSON 数据 - bluemix-mobile-services