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 2E9EC10CCB for ; Tue, 15 Oct 2013 18:52:20 +0000 (UTC) Received: (qmail 41804 invoked by uid 500); 15 Oct 2013 18:52:17 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 41503 invoked by uid 500); 15 Oct 2013 18:52:16 -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 41495 invoked by uid 99); 15 Oct 2013 18:52:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Oct 2013 18:52:15 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of robert.newson@gmail.com designates 209.85.212.178 as permitted sender) Received: from [209.85.212.178] (HELO mail-wi0-f178.google.com) (209.85.212.178) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Oct 2013 18:52:09 +0000 Received: by mail-wi0-f178.google.com with SMTP id hn9so2091642wib.11 for ; Tue, 15 Oct 2013 11:51:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=from:content-type:message-id:mime-version:subject:date:references :to:in-reply-to; bh=X601XhLQZpcbjxy3MBJMJ4VlndltYEdTaIMwuLVj13A=; b=kr2X5dNozTEoSfRp7nBro1R+2t23ZnZL4QWoILKrJKgZLS+jkfp17U9kbca2CZ3UGr R3RIxBFvYfZDVJrfkr4IsKMyA2UGgi+QQoZhPWaVF+LVUK4aGm0k7a/XW3QWhhVZnt31 Fs0x/AmSl7G1yVy0ufIP7nKeHtAbQS9eyS7ap87Wr4iFAx+aIlwoSY3qgtL45nAd2B3z CHLIQTO9uJbBWFvr36YLH3i/G7qOg2cGcq6FT7mTFuI8GIey0iC+ScTtwwI+ufLQBWl+ /D1m2p07roWKXF3Ap9ZrTfFvPG79sEefAcezEn8jcCMDsYQ/5tc9ZQ0yxI3hF8dOovGG kFKQ== X-Received: by 10.180.208.49 with SMTP id mb17mr20960136wic.64.1381863107644; Tue, 15 Oct 2013 11:51:47 -0700 (PDT) Received: from [192.168.1.4] (79-77-214-165.dynamic.dsl.as9105.com. [79.77.214.165]) by mx.google.com with ESMTPSA id e5sm103555wiy.2.2013.10.15.11.51.46 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Oct 2013 11:51:46 -0700 (PDT) From: Robert Newson Content-Type: multipart/signed; boundary="Apple-Mail=_CC0EC25F-D2C3-42A2-B9EA-8C661B7F39ED"; protocol="application/pgp-signature"; micalg=pgp-sha512 Message-Id: <89D8D3C8-99B5-4AC3-BE47-57747A61F883@apache.org> Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Subject: Re: Strange values for "total_rows" and "offset" Date: Tue, 15 Oct 2013 19:51:43 +0100 References: <305D22F7-FD26-4142-B749-34A52A2AA6CC@apache.org> <2B8ADCE1-6AA1-4674-AB46-F62B28CFCFC4@apache.org> To: user@couchdb.apache.org In-Reply-To: X-Mailer: Apple Mail (2.1510) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail=_CC0EC25F-D2C3-42A2-B9EA-8C661B7F39ED Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 Near zero, I'd say. The number is not cheaply computable with structures = as they are. I would be ok with removing total_rows and offset from the = output given that they're a bit silly, really. On 15 Oct 2013, at 19:05, Hank Knight wrote: > What are the chances of this feature being added to future releases of > CouchDB? I am sure it would benefit many. >=20 >=20 > On Tue, Oct 15, 2013 at 10:19 AM, Robert Newson = wrote: >=20 >>=20 >> Sadly not. >>=20 >> On 15 Oct 2013, at 13:56, Hank Knight wrote: >>=20 >>> I need the total rows matching my query so I can do proper = pagination >> based >>> on a query. Is this possible? >>>=20 >>>=20 >>> On Tue, Oct 15, 2013 at 9:42 AM, Robert Newson >> wrote: >>>=20 >>>> total_rows is the total number of rows in the view, not that match = your >>>> query. >>>>=20 >>>> B. >>>>=20 >>>> On 15 Oct 2013, at 13:38, Hank Knight wrote: >>>>=20 >>>>> There are only 10 matching results where the key is "GOLD": >>>>> http://example.com/abc/_design/iws/_view/q?key=3D%GOLD%22 >>>>>=20 >>>>> However the first line of the response is this: >>>>>=20 >>>>> {"total_rows":52340,"offset":218,"rows":[ >>>>>=20 >>>>> Why doesn't it say this? >>>>>=20 >>>>> {"total_rows":10,"offset":0,"rows":[ >>>>>=20 >>>>> The problem is that when I limit results like this: >>>>>=20 >>>>> = http://example.com/abc/_design/iws/_view/q?key=3D%GOLD%22&limit=3D5&skip=3D= 0 >>>>>=20 >>>>> I cannot tell from the response if that response includes all = matches >> or >>>>> only the first five. >>>>=20 >>>>=20 >>=20 >>=20 --Apple-Mail=_CC0EC25F-D2C3-42A2-B9EA-8C661B7F39ED Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJSXY7CAAoJEBAV9o+doki8h8QQAIE/EsE/vSZuTsd7zo8IFE4g 3R0o8VWduuZZWS5+px/u3A6w+wWpMnMlUJD5JDpF2dQBBxOKZ1i3f5jFBzmmQKha VfHXlmhEw1nmnDGG/b6EKa61u9iKmY2V0KeXjCK8+9VbgweUGmxQTrCihxJS/Qy+ ebYfzH3hYCAUkehN7GnuugW8OtqhSO2e574uzQnuW12zTuM7Swijb9HpZ9FrrCOd 1TQ+OEek6tCI29McadSKD3ctaUz8O5w3gyITj61nqx4vF57XNf5Q8l4C+hGdd7tv 2Oiy53pqPVAUAk/uwbPjLQbrHUaPHoujUgwLuAWr/NC9vMPB+BJP9nbREJ1aTkTh LJfZ42VBesnoa1RgC4zqYOxkwR4vsJWXqurks58F6XFGoLKDj4dWTMzjWLumVPL9 BW/dckUzXRzagDR7mfNej++CimeriYDsBWwBA5zI4epaoF87wbd1G9EcDdostHme eQU7yrr3aGOH51YBs5KL9R3i6ARNrFL4nT8ZQlMHyqwjsrraLfHk7R+ji+tU42A3 ej7UFVPfBfwpCrFaxleOWKQTgeRvpeg6n8eHZm+IuaBW7B5TeRby/rTNjl2T6r55 w+ZsrKmkbbsDbhxsBolQpWprR/FlbCEKRKFjdaZH1N9sCqKE8qjmxPj7UH2DyWcF 0FHRJnhATmvV+dD2IiuA =l2zn -----END PGP SIGNATURE----- --Apple-Mail=_CC0EC25F-D2C3-42A2-B9EA-8C661B7F39ED--