Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 734C01030A for ; Mon, 2 Dec 2013 14:10:32 +0000 (UTC) Received: (qmail 46476 invoked by uid 500); 2 Dec 2013 14:10:28 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 46426 invoked by uid 500); 2 Dec 2013 14:10:26 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 46413 invoked by uid 99); 2 Dec 2013 14:10:22 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Dec 2013 14:10:22 +0000 Received: from localhost (HELO mail-vb0-f44.google.com) (127.0.0.1) (smtp-auth username rnewson, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Dec 2013 14:10:22 +0000 Received: by mail-vb0-f44.google.com with SMTP id w20so8620378vbb.31 for ; Mon, 02 Dec 2013 06:10:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=NHr2ZcQ1fpgKdiDdbdychhU/X3xFYkgTsWs5wGl8ecA=; b=Wq/tzDCXgF369/A3hmxcR8zlwvDAuG3l/TDpnULoGZO/0oCyZ/bP4Vm4JTy0zID9Wv wrnCAVf6kqjHMfFpmUWedx1tyvC3qluG9mjIqPS0u8qdqX0v+hBppxKUG7vUZ6GVQT8L kUUwTo4Y7Sy1L/w8P5OJ3ewoGcxbALrEAKmpBjUq71omvq7wQPQaar1FXCO8TTlc2VRL KgpYK6GavdURKZHntl5PGQon+lHO/NYpEQC1w+0EtDUKaQu0hAmajFq8XUXOPuA3iQNc ZIhJxupZL0Pa6chfrYamuqMke3spH7VzqgdWWvGPOM7fKoZYJGOLF/pEll6sMp5P9siy vKEw== MIME-Version: 1.0 X-Received: by 10.58.178.239 with SMTP id db15mr53804094vec.9.1385993421185; Mon, 02 Dec 2013 06:10:21 -0800 (PST) Received: by 10.220.251.70 with HTTP; Mon, 2 Dec 2013 06:10:21 -0800 (PST) In-Reply-To: References: Date: Mon, 2 Dec 2013 14:10:21 +0000 Message-ID: Subject: Re: Why do couchdb reduce functions have to be commutative From: Robert Newson To: "user@couchdb.apache.org" Content-Type: text/plain; charset=ISO-8859-1 Because the order that we pass keys and values to the reduce function is not defined. In sharded situations (like bigcouch, which is being merged) an intermediate reduce value on an effectively random subset of keys/values is generated at each node and a final rereduce is done on all the intermediates. The constraints on reduce functions exist in anticipation of clustering. B. On 1 December 2013 21:45, Oliver Dain wrote: > Hey CouchDB users, > > I've just started messing around with CouchDB and I understand why CouchDB > reduce functions need to be associative, but I don't understand why they > also have to be commutative. I posted a much more detailed version of this > question to StackOverflow yesterday, but haven't gotten an answer yet (my > SO experience says that means I probably won't ever get one). Figured it > might be smart to explicitly loop in the couch community. > > The original StackOverflow question is here: > > http://stackoverflow.com/questions/20303355/why-do-couchdb-reduce-functions-have-to-be-commutative > > Any thoughts would be appreciated! > > Thanks, > Oliver