couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Anderson" <>
Subject Re: Basic re-understanding of reduce.
Date Wed, 24 Dec 2008 19:13:14 GMT
On Tue, Dec 23, 2008 at 7:25 PM, Simon Wex <> wrote:
> So this just the system reducing to enable group_level=3|2|1|0 (since
> my key is max 3 elements)?  That does explain what I'm seeing in the
> logs. Very clever.

Reduce is designed to allow you to retrieve the reduction value from
arbitrary key ranges. group_level queries are just a way of
calculating a set of key ranges (eg all those key which share a common
2 element prefix, etc.) You can query a reduce view with any start or
end key you'd like. Group level is just a way to ask CouchDB to make a
series of those queries for you. The cleverness is in being able to
reuse intermediate reduce values to calculate the reduction for novel
key ranges. That is, if part of a reduce has been calculated for a
range, then that partial calculation can be reused when computing the
reduction value for the completed range.

There are some figures that may clear the rereduce parts up here:

Chris Anderson

View raw message