incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Tisdall <tisd...@gmail.com>
Subject Re: Need Strategy for Dealing with Large List Output
Date Thu, 18 Jul 2013 13:52:48 GMT
Does this help?  http://guide.couchdb.org/draft/recipes.html#pagination


On Thu, Jul 18, 2013 at 9:05 AM, Paul Roebuck <paul_roebuck@comcast.net>wrote:

> Have a couchapp whose list() can't seem to output its information
> before OS timeout  occurs. We initially just increased the OS timeout,
> but still have issues depending on whatever else is going on.
>
> What is the recommended means of paginating the output with
> multiple calls (i.e., pieces parts instead of the whole enchilada)?
>
> list(head, req) {
>     provides("json") {
>         // generate time consuming output
>     }
>     provides("xml") {
>         // generate time consuming output
>     }
> }
>
> Had initially thought of adding a response header and doing a HEAD
> call, but had problems kept getting badarg exceptions (does using
> provides() preclude using start()?).
>
> list(head, req) {
>     start({
>         headers: {
>             "X-NRows": head.total_rows
>         }
>     });
>
>     provides("json") {
>         if (req.method === 'HEAD')
>             return "";
>
>         // generate time consuming output
>     }
>     provides("xml") {
>         // generate time consuming output
>     }
> }
>
> Assuming I can retrieve this value, then the idea was to make a series
> of GETs to same list function with its view using 'limit=' and 'start=',
> collating the output using mbostock's QueueJS on HTML page prior
> to display.
>
> Or is there a better way?
>
> Thx.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message