在 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/