incubator-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:13:18 GMT
by the way, we select to use couchdb as a part our current application,
because that part of data is huge and with everyday got growth, we need do
some analysis on these data and then give the result back to the user(
though our website), maybe i need consider another solution: analysis still
with couchdb view, but not query that directly to the web, we maybe give a
cron job sync the analysis(couchdb view) data to a mysql table and then use
the result data in mysql table to feed the webpage, that is easy to paging
and sorting at mysql level, this is a rough thought only.

On Fri, Jun 26, 2009 at 5:01 PM, hhsuper <> wrote:

> 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
> now).
> 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

Yours sincerely

Jack Su

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