On Wed, Aug 12, 2009 at 11:40 PM, Brian Candler<[email protected]> wrote: > On Mon, Aug 10, 2009 at 01:56:49PM -0700, Chris Anderson wrote: >> The reason why CouchDB can't do the sorting by value inside itself is >> that on a multi node cluster, an individual couch can't know the >> global ordering. We have a commitment to ensuring that CouchDB's API >> remains invariant regardless of the size of the underlying cluster. >> >> So you basically have to copy the cluster-wide reduce values to an >> intermediate storage mechanism (which itself can be a cluster) before >> you can sort them by value. > > Not sure I understand. If this is a sharded cluster, then each node could > sort its own subset of results; then it's very simple and efficient to merge > the already-sorted results together. >
Exactly! Except that in order to get a global ordering for group reduces, you have to do the ordering after the merge, not before. -- Chris Anderson http://jchrisa.net http://couch.io
