You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by Apache Wiki <wi...@apache.org> on 2011/04/04 17:30:39 UTC

[Couchdb Wiki] Update of "HTTP_view_API" by HenrikHofmeister

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.
http://wiki.apache.org/couchdb/HTTP_view_API?action=diff&rev1=52&rev2=53

--------------------------------------------------

  
  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 row.
  
  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.