couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcello Nuccio <marcello.nuc...@gmail.com>
Subject Re: Bug or my lack of understanding? "Reduce output must shrink more rapidly"
Date Wed, 17 Aug 2011 21:13:10 GMT
2011/8/17 Chris Stockton <chrisstocktonaz@gmail.com>:
> Hello,
>
> On Tue, Aug 16, 2011 at 11:58 PM, Marcello Nuccio
> <marcello.nuccio@gmail.com> wrote:
>> I don't think this is a bug. Citing from
>> http://guide.couchdb.org/draft/cookbook.html#aggregate
>>
>>    As a rule of thumb, the reduce function should reduce to a single
>> scalar value. That is, an integer; a string; or a small, fixed-size
>> list or object that includes an aggregated value (or values) from the
>> values argument.
>>
>> The object returned by your reduce function, is not fixed-size.
>> Actually it is bigger than the input document.
>>
>> Marcello
>>
>
> I actually think we fit the rule of thumb in the sense the object
> returned is fixed size object of scalars. It just so happens to have
> lots of keys.

It says: "SMALL, fixed-size...".


> The reason this is necessary is because we do much more
> then just the total, we do the population variance, population
> standard deviation, square, sums, the average total including nulls,
> and the average total not including nulls.
>
> I wont go too deep into our applications architecture but this record
> represents a "row" in a list of user data with different kinds of data
> types, typically users don't want any kinds of stats etc, so we just
> serve out the documents.

How do you lookup documents? By the key "result"?
Can you emit a value for each data key ("C003089", "C006990", ...)
then use group_level query parameter to collect statistics?

Marcello

Mime
View raw message