couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Couchdb Wiki] Update of "HTTP_view_API" by HenrikHofmeister
Date Mon, 04 Apr 2011 15:30:39 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification.

The "HTTP_view_API" page has been changed by HenrikHofmeister.
The comment on this change is: note added for multiple keys requests and reduce views.


  If you specify ''?limit=0'' you don't get any data, but all meta-data for this View. The
number of documents in this View for example.
+ ''Note: Multiple keys request to a reduce function only supports group=true and NO group_level
(identical to group_level=exact). The resulting error is "Multi-key fetchs for reduce view
must include `group=true`"''
  The ''skip'' option should only be used with small values, as skipping a large range of
documents this way is inefficient (it scans the index from the startkey and then skips N elements,
but still needs to read all the index values to do that). For efficient paging you'll need
to use ''startkey'' and ''limit''. If you expect to have multiple documents emit identical
keys, you'll need to use ''startkey_docid'' in addition to ''startkey'' to paginate correctly.
The reason is that ''startkey'' alone will no longer be sufficient to uniquely identify a
  The ''stale'' option can be used for higher performance at the cost of possibly not seeing
the all latest data. If you set the ''stale'' option to ''ok'', CouchDB may not perform any
refreshing on the view that may be necessary. Using this option essentially tells CouchDB
that if a reference to the view index is available in memory (ie, if the view has been queried
at least once since couch was started), go ahead and use it, even if it may be out of date.
The result is that for a highly trafficked view, end users can see lower latency, although
they may not get the latest data. However, if there is no view index pointer in memory, the
behavior with this option is that same as the behavior without the option. If your application
use ''stale=ok'' for end-user queries, you'll need either a cron or a notification process
like the one described in [[Regenerating_views_on_update]], which queries without ''stale=ok''
to ensure that the view is kept reasonably up to date.

View raw message