Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 1368 invoked from network); 27 Jul 2010 14:19:47 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 27 Jul 2010 14:19:47 -0000 Received: (qmail 5881 invoked by uid 500); 27 Jul 2010 14:19:45 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 5607 invoked by uid 500); 27 Jul 2010 14:19:42 -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 5594 invoked by uid 99); 27 Jul 2010 14:19:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Jul 2010 14:19:41 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.210.52] (HELO mail-pz0-f52.google.com) (209.85.210.52) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Jul 2010 14:19:35 +0000 Received: by pzk27 with SMTP id 27so3061985pzk.11 for ; Tue, 27 Jul 2010 07:19:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.171.7 with SMTP id t7mr10342847wfe.214.1280240353151; Tue, 27 Jul 2010 07:19:13 -0700 (PDT) Received: by 10.220.84.207 with HTTP; Tue, 27 Jul 2010 07:19:12 -0700 (PDT) Date: Tue, 27 Jul 2010 10:19:12 -0400 Message-ID: Subject: Reporting in CouchDB From: Cory Zue To: user Content-Type: text/plain; charset=ISO-8859-1 I need to write some reports on top of the data in my couch db application. My use case is a central database monitoring the data coming in from a bunch of satellite sites, and they want to generate aggregate reports on the data by site and by date range. My current plan is to use a view with a complex key that includes the site id and date the data came in, with the value being a dictionary of contributions the data makes to each aggregate indicator in the report. Then my reduce function can just sum up the individual keys. However, this will only generate reports with the granularity of a single day out-of-the-box, which means I will need to do further processing on the client side in order to aggregate the counts over the entire range specified. My question is -- is there any way to do this in one view via couchdb? My understanding is that the best aggregation I can do is get it down to one value per key, so even though I am only using the keys to specify start and end ranges and always want to return a full aggregate with a single set of counts I still have to do the final aggregation on the client side. Sorry if this is unclear. I'd be happy to clarify over mail or IRC if necessary. thanks, Cory