Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 251 invoked from network); 23 Mar 2010 16:36:36 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 23 Mar 2010 16:36:36 -0000 Received: (qmail 26851 invoked by uid 500); 23 Mar 2010 16:36:35 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 26791 invoked by uid 500); 23 Mar 2010 16:36:35 -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 26783 invoked by uid 99); 23 Mar 2010 16:36:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Mar 2010 16:36:35 +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 jchris@gmail.com designates 72.14.220.154 as permitted sender) Received: from [72.14.220.154] (HELO fg-out-1718.google.com) (72.14.220.154) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Mar 2010 16:36:25 +0000 Received: by fg-out-1718.google.com with SMTP id d23so997563fga.5 for ; Tue, 23 Mar 2010 09:36:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:mime-version :content-type:subject:date:in-reply-to:to:references:message-id :x-mailer; bh=hNbxx2nuYazt5CQxXaszzm3GfglniMmWjyNJCDBypok=; b=WYYc9GgtSh7pc5rTGakWLM9KfF8vSOXxRPFSLh7AUYIiAkDOckg4JKJaIR9eXuWEFh BhMv1gL3JI77aBJKeNoT08ulJP1skiBclG+Sa96IjLQYXb9I3CZf+JaS1T3fhh8mD/2u S1q7YowiozVRmecuCAyvx8z6WIAbPrJZfycgk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:mime-version:content-type:subject:date:in-reply-to:to :references:message-id:x-mailer; b=FC2OamuxmjvsDerUsVRQd4pTJ+fCXxXMtJNJiLOw428SQPJdnK40kLoqPHVs1pz/6z P8LEG4rUWnnQcSAQGMNoyeImE/Gil03anDruWfZEMIT7uBE/u0EMM8/BoAqQ9gpRTYyK T4fkiz6jcCFj7X+HP3Kw24NV31WCk5npmgHXY= Received: by 10.87.45.33 with SMTP id x33mr2414626fgj.68.1269362165125; Tue, 23 Mar 2010 09:36:05 -0700 (PDT) Received: from [10.0.1.213] (h-74-1-186-35.snfccasy.static.covad.net [74.1.186.35]) by mx.google.com with ESMTPS id 13sm4945225fxm.10.2010.03.23.09.36.02 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 23 Mar 2010 09:36:03 -0700 (PDT) From: J Chris Anderson Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: multipart/alternative; boundary=Apple-Mail-48--1002816457 Subject: Re: Pagination and 'pretty' urls Date: Tue, 23 Mar 2010 09:35:59 -0700 In-Reply-To: To: user@couchdb.apache.org References: Message-Id: <67725C06-4BB0-43CD-A02A-5D5A6B17B145@gmail.com> X-Mailer: Apple Mail (2.1077) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail-48--1002816457 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Mar 23, 2010, at 7:07 AM, Kevin Jackson wrote: >=20 > The problem is that we would > like to have urls of the form page=3D1, page=3D2 etc and at the moment = we > have page?start=3D[]&end=3D[].=20 There's a deep problem with trying to do page=3DN style pagination. It = is possible but you have to do extra reduce queries to support it. Because unless you know what the startkey is of page=3DN, you can't = query for it. If you are willing to do natural keys, this is simplified, = as instead of pages you can do Jan, Feb, March, April, etc. The other option is to do a binary search with reduce queries, to = approximately find the startkey of the Nth row. There's a lot of = overhead here, and you can get weird symptoms.=20 Have you ever tried browsing backwards through flickr's recent uploads = feed? If you aren't fast enough, people upload faster than you can = browse, and you see the same photos over and over again. If they used = linked-list or natural key style pagination, this wouldn't be an issue. Chris --Apple-Mail-48--1002816457--