From couchdb-user-return-1317-apmail-incubator-couchdb-user-archive=incubator.apache.org@incubator.apache.org Wed Sep 17 14:46:26 2008 Return-Path: Delivered-To: apmail-incubator-couchdb-user-archive@locus.apache.org Received: (qmail 2925 invoked from network); 17 Sep 2008 14:46:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Sep 2008 14:46:26 -0000 Received: (qmail 73451 invoked by uid 500); 17 Sep 2008 14:46:22 -0000 Delivered-To: apmail-incubator-couchdb-user-archive@incubator.apache.org Received: (qmail 73290 invoked by uid 500); 17 Sep 2008 14:46:21 -0000 Mailing-List: contact couchdb-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: couchdb-user@incubator.apache.org Delivered-To: mailing list couchdb-user@incubator.apache.org Received: (qmail 73279 invoked by uid 99); 17 Sep 2008 14:46:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2008 07:46:21 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [83.97.50.139] (HELO jan.prima.de) (83.97.50.139) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2008 14:45:22 +0000 Received: from macnolia.lan (f053000125.adsl.alicedsl.de [::ffff:78.53.0.125]) (AUTH: LOGIN jan, SSL: TLSv1/SSLv3,128bits,AES128-SHA) by jan.prima.de with esmtp; Wed, 17 Sep 2008 14:45:53 +0000 Message-Id: <1F06BFA2-E764-48F2-8DA6-02C392156B05@apache.org> From: Jan Lehnardt To: couchdb-user@incubator.apache.org In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v928.1) Subject: Re: Combine ( / rereduce?) implementation in CouchDB Date: Wed, 17 Sep 2008 16:45:21 +0200 References: X-Mailer: Apple Mail (2.928.1) X-Virus-Checked: Checked by ClamAV on apache.org On Sep 16, 2008, at 13:32, Jaap van der Plas wrote: > Greets, > > I've been searching around and found various hints towards the third > parameter of reduce-functions but I have not been able to find a > description of when exactly it is invoked, and if it is possible to > avoid your reduce function to be used in this way. It is also referred > to as re-reduce sometimes? > Would anyone be able to shed some light on this for, or point me to > resources where I can learn more about this? rereduce is a phase that the view engine might decide to run to further reduce its input. if it runs rereduce, the third parameter to your reduce function is set to true. if your reduce function returns data that is structurally different from its input, you need to specially take care of the rereduce call. in case of a simple `return sum(values)` reduce and rereduce work the same way. you cannot rely on rereduce being run or not, you just have to be prepared to deal with it if you are doing anything fancy. sorry for the rather lame explanation. :-) Cheers Jan --