couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Anderson <>
Subject Re: Penalty for reduce?
Date Fri, 06 Feb 2009 03:09:15 GMT
On Thu, Feb 5, 2009 at 12:38 PM, Brian Candler <> wrote:
> I'm just wondering, how much is the performance penalty for adding reduce to
> a view? In other words, is there any reason *not* to include a reduce

I'm not sure. It would be a simple matter to add log() statements to a
reduce function to see if it is run during map queries or if it is
only run when reduce=true.

> Might it be useful to include such a reduce in the _all_docs pseudo-view?

We're planning to take some of the most common reductions and
implement them in Erlang, so that you could perhaps query like:


The built-in reductions would be available on any view regardless of
whether it has a JavaScript reduce function specified.

This will be a fun patch to implement but so far I don't think anyone
has picked it up.

Chris Anderson

View raw message