incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Candler <B.Cand...@pobox.com>
Subject Penalty for reduce?
Date Thu, 05 Feb 2009 20:38:02 GMT
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.

Mime
View raw message