couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fabio Forno <fabio.fo...@gmail.com>
Subject Re: counting rows in range queries
Date Thu, 30 Jul 2009 06:53:25 GMT
On Thu, Jul 30, 2009 at 3:22 AM, Paul Davis<paul.joseph.davis@gmail.com> wrote:
>>
>
> My bad, that should read 'emit([doc.bucket, doc.date], value)'
>

Well but it doesn't work either, since when I retrieve the view I get
as many rows as the selected docs, with count 1. Perhaps my
description was confusing, since date is not something like YYMMDD,
but YYMMDDhhmmss. Therefore all the emitted keys are different and the
reduce function can't do any aggregation.

This seems to me the case in which the returned total_rows should be
not the number of docs in the view, but instead the actual number of
selected documents. I know that there is a big penalty, however it is
more efficient to let couchdb do it (if the btree implementation is is
good, walking though keys shouldn't be so slow, since consecutive keys
are in the same disk pages) than retrieving everything through the
network. So why not adding a parameter to the view GET for telling
couchdb if it has to count all the documents or not?

-- 
Fabio Forno, Ph.D.
Bluendo srl http://www.bluendo.com
jabber id: ff@jabber.bluendo.com

Mime
View raw message