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
function like
function(ks, vs, co) {
if (co) {
return sum(vs);
}
else {
return vs.length;
}
}
in every map view I create? (Apart from the fact I have to remember to
supply reduce=false!) Even if all the keys are distinct, this gives the
ability to count all the keys, and to count keys in arbitary ranges.
Might it be useful to include such a reduce in the _all_docs pseudo-view?
Regards,
Brian.