couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hhsuper <>
Subject Re: 'Grouping' documents so that a set of documents is passed to the view function
Date Fri, 26 Jun 2009 09:01:37 GMT
Thx brian for your patient and great help, maybe it doesn't suitable for my
requirement, because it's so difficult to impl my common
requirement(paging/sorting on couchdb level), such as:

i need output from view( or multi-view):
key:[col1,clo2,clo3],values:["v1":23, "v2":7]

by the way caculated in reduce function, can you give a example how to impl
sorting by any of the col1/col2/col3/v1/v2 column value with couchdb
(multi-view also accepted), because the sorting is based the all data when
with million records it's unable to load them to client and then sorting, so
the couchdb level sorting is needed to me.

also paging is the same thing, when i impl sorting/paging  together in
couchdb level, i need consider the startkey for descending param, it's
especially difficult (i impl paging with couchdb's startkey and limit param

On Fri, Jun 26, 2009 at 3:15 PM, Brian Candler <> wrote:

> On Fri, Jun 26, 2009 at 01:32:44PM +0800, hhsuper wrote:
> >    also the sorting need to be support
> >    with any col of the returned keys and returned values, but now it's
> >    difficult to impl that with couchdb, isn't it?
> You need multiple views with couchdb, just as with an RDBMS you need
> multiple indexes. (Well, with the RDBMS you don't *need* multiple indexes,
> but if you don't have them, the query will end up doing whole table scans,
> which may result in excessive amounts of slow disk I/O. In other words,
> you're hiding the problem and storing it up to bite you later)

Yours sincerely

Jack Su

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message