Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7259710D9D for ; Thu, 18 Jul 2013 13:53:17 +0000 (UTC) Received: (qmail 6726 invoked by uid 500); 18 Jul 2013 13:53:16 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 6552 invoked by uid 500); 18 Jul 2013 13:53:15 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 6544 invoked by uid 99); 18 Jul 2013 13:53:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Jul 2013 13:53:14 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of tisdall@gmail.com designates 209.85.217.179 as permitted sender) Received: from [209.85.217.179] (HELO mail-lb0-f179.google.com) (209.85.217.179) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Jul 2013 13:53:09 +0000 Received: by mail-lb0-f179.google.com with SMTP id w20so2567581lbh.10 for ; Thu, 18 Jul 2013 06:52:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=/KJqEJZKwdyNbcljeR1LnmWDncl9mD/x2epwg8Y5ScM=; b=VKybqbZaWDMLC+gQDxZunDvVni7uldG+mRcYt4aG6MaH02yEKimKEvr3qK+mRZ8tvb Yh/v9CNSUx6q/obEAMKCz7d3HKkTlwE8Ecu8KWA6XeH7/OA+I/qvNF309IqSOpCUHQfX ILqoEUqQtDP+2FivTRe6bF6pfh1Q0cdXK8K0vQi0xloVGVCZauqRXn3YVwQmHRgwJeW1 yU7/SYZOch6eiY8Djm520sQn8iHU+vqOxzE1gvwi9W8qDJD4glSZZllRrCdzRHAq0yvj jC+Ch4JJz6iaq0rRStMkmVXMfcV0ZXyM3zPX3kUZCYuHdcjbIzqzoNd0wtQ/iqMMprGl pjbw== MIME-Version: 1.0 X-Received: by 10.112.144.35 with SMTP id sj3mr5534922lbb.4.1374155568250; Thu, 18 Jul 2013 06:52:48 -0700 (PDT) Received: by 10.112.70.169 with HTTP; Thu, 18 Jul 2013 06:52:48 -0700 (PDT) In-Reply-To: <21E91DE1-D95E-48CC-975B-C4D54405415E@comcast.net> References: <21E91DE1-D95E-48CC-975B-C4D54405415E@comcast.net> Date: Thu, 18 Jul 2013 09:52:48 -0400 Message-ID: Subject: Re: Need Strategy for Dealing with Large List Output From: Tim Tisdall To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=047d7b3432be83063404e1c98602 X-Virus-Checked: Checked by ClamAV on apache.org --047d7b3432be83063404e1c98602 Content-Type: text/plain; charset=ISO-8859-1 Does this help? http://guide.couchdb.org/draft/recipes.html#pagination On Thu, Jul 18, 2013 at 9:05 AM, Paul Roebuck 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. > --047d7b3432be83063404e1c98602--