couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Avi Flax <>
Subject Re: startkey_docid and "wildcard" paging
Date Mon, 02 Aug 2010 00:35:48 GMT
Actually I've been paging that way for a while, it's only today that I
added the timestamp to my view and had to start using the "wildcard"
approach. But now I think I see what I was missing — I only need to
use the "wildcard" for my first page. I'll give it a try and report


On Sun, Aug 1, 2010 at 19:44, J Chris Anderson <> wrote:

> Ffirst just stop using startkey_docid at all. It has no relevance for your current use
case. It will start to matter, someday when you have billions of rows, such that you start
to regularly have more than 11 rows with the same exact tags and timestamp.
> Your query string for the second request should be:
> ?limit=11&startkey=KEY_OF_THE_LAST_ROW_FROM_PAGE_ONE&descending=true&skip=1&endkey=SAME_OLD_SAME_OLD
> Essentially you are building a linked list. You tell Couch: "I know there is a doc with
key X, cause it was at the bottom of page 1, so lets put that row at the top of page 2. Oh
but since we just saw that, lets skip just that row this time."
> Try that, and page through my blog to see how I do it, if you are still stuck.
> Chris
>> Does that help clarify what my confusion is?
>> Thanks!
>> Avi

View raw message