From dev-return-11697-apmail-couchdb-dev-archive=couchdb.apache.org@couchdb.apache.org Mon Sep 13 03:56:49 2010 Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 10361 invoked from network); 13 Sep 2010 03:56:48 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 13 Sep 2010 03:56:48 -0000 Received: (qmail 48235 invoked by uid 500); 13 Sep 2010 03:56:46 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 47764 invoked by uid 500); 13 Sep 2010 03:56:44 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 47748 invoked by uid 99); 13 Sep 2010 03:56:42 -0000 Received: from Unknown (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Sep 2010 03:56:42 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of mikeal.rogers@gmail.com designates 209.85.216.180 as permitted sender) Received: from [209.85.216.180] (HELO mail-qy0-f180.google.com) (209.85.216.180) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Sep 2010 03:56:21 +0000 Received: by qyk31 with SMTP id 31so5279840qyk.11 for ; Sun, 12 Sep 2010 20:55:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=B9grCiGk92PmyQiTEjTDSAv6C4QhyUP8pX2qbAYWc6E=; b=g7E4iKg9iRW8ueuZKWykqj4oZKlWvARBSIzHNIv1g2lb5z1933RkVQhedewqdUTl94 O62n96mg3L5xwy+HB0an89MOQkwXk4/qBnQPY0x5uyz3qglFgljBBInwIpSSFfjd2bc1 g+4CUNlx9E+oimJ43srnGynLLZG1g0UFmBSdM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=d3Oq0LvK8SXFG09Lxh6dqn8TsM2W1mzOgDuUd595T0rriQg0sFA5IEdUwrdi49gyXZ C8Js3WvzQWW1aaabnHyoNHm5tYbCLwQPelPooWXvhc6f59z2i5BQMQ3E6S3BlEdU6tLN jeplUt4ruQG4upFJjNJfB4b0z+QI5TDhHYI1k= MIME-Version: 1.0 Received: by 10.229.182.3 with SMTP id ca3mr2780855qcb.173.1284350157277; Sun, 12 Sep 2010 20:55:57 -0700 (PDT) Received: by 10.229.249.81 with HTTP; Sun, 12 Sep 2010 20:55:57 -0700 (PDT) In-Reply-To: References: <15DB6D61-5832-47B8-A2CA-8C608BCA1965@apache.org> Date: Sun, 12 Sep 2010 20:55:57 -0700 Message-ID: Subject: Re: endkey doesn't obey limit parameter and always returns entries starting with offset 0 From: Mikeal Rogers To: dev@couchdb.apache.org Cc: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=0016364175ade4533604901c12ac X-Virus-Checked: Checked by ClamAV on apache.org --0016364175ade4533604901c12ac Content-Type: text/plain; charset=ISO-8859-1 The document count of the db at the time of view generation or the document count that emits at least one key in the index? Or do you really mean the number of keys in the index? On Sun, Sep 12, 2010 at 8:21 PM, Randall Leeds wrote: > Any reason why we don't put a document count in the btree index to make > skip > cheap? > > > > On Sep 12, 2010, at 9:39 AM, Mikeal Rogers wrote: > > > >> For pagination you can use the skip parameter instead of trying to > change > >> the startkey for each pagination. > >> > >> http://wiki.apache.org/couchdb/HTTP_view_API#Querying_Options > >> > >> ?startkey="foo"&limit=10 > >> ?startkey="foo"&limit=10&skip=10 > >> ?startkey="foo"&limit=10&skip=20 > >> > > > > You can but you shouldn't. > > > > The right way to do it is to use startkey and limit, as documented here. > > > > http://guide.couchdb.org/draft/recipes.html#fast > > > >> > >> On Sun, Sep 12, 2010 at 12:06 AM, Henrik Skupin > wrote: > >> > >>> Hi, > >>> > >>> For my current Couch application I'm using pagination to show only 50 > >>> results per page. To navigate back and forward the endkey vs. startkey > >>> parameters are used. While startkey in combination with limit is > working > >>> fine, endkey doesn't return results for [offset(endkey)-limit, > >>> offset(endkey)] but for [0, limit]. This makes pagination impossible > for > me > >>> and looks like to be a bug. An example you can find here: > >>> > >>> http://mozmill.hskupin.info/general/reports > >>> > >>> After opening the page click 'Next' twice and check the URL of the > >>> 'Previous' link before clicking on it. The endkey parameter will not be > >>> obeyed and a click on that link causes the first page to be opened. > >>> > >>> The code can be found at: http://github.com/whimboo/mozmill-dashboard > >>> > >>> Is the above problem a known broken behavior and worth filing a bug? > >>> > >>> Thanks, > >>> Henrik > >>> > > > --0016364175ade4533604901c12ac--