Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 34231 invoked from network); 27 Sep 2010 12:01:45 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 27 Sep 2010 12:01:45 -0000 Received: (qmail 57157 invoked by uid 500); 27 Sep 2010 12:01:43 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 56795 invoked by uid 500); 27 Sep 2010 12:01:41 -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 56787 invoked by uid 99); 27 Sep 2010 12:01:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Sep 2010 12:01:40 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of wout.mertens@gmail.com designates 209.85.215.180 as permitted sender) Received: from [209.85.215.180] (HELO mail-ey0-f180.google.com) (209.85.215.180) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Sep 2010 12:01:32 +0000 Received: by eya25 with SMTP id 25so1680803eya.11 for ; Mon, 27 Sep 2010 05:01:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:content-type:mime-version :subject:from:in-reply-to:date:content-transfer-encoding:message-id :references:to:x-mailer; bh=ssAKrFVUgQUmW/YWjn5YxgDyr7WwYUkTsQPSsjEPQlw=; b=Go066Xvds5nw3H7q6l8rbQ86aE/Ud7lslhqBmiwqzojMSWzboyEPB4tqz/Vflh7mLk MploXknWEYISSvEdgV1X7odDQYvmzNufCEb3ibmPbAHWWkwsn9XfC7JJdQO4hFFFW0sw 8EnK6u6mD/yd4XU6+qVRkC+Vjc3cBKcyLQV6o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; b=MIGlvw4sUVG7JLAP3enilxUM4J9gXQVrczBK0Y+u+ATlSXCuG0cuJg4O+atMov5kEU gTfTLJrpcSc9sM8s7txvU0D7GWsMSZGn//kLnut85C67EUAtfniPtXESe4SYFeR62TWX LXtnA7aPWk7kWb2Gic9Lt+aKxt46uVuWCH7FM= Received: by 10.213.105.66 with SMTP id s2mr2971857ebo.92.1285588871139; Mon, 27 Sep 2010 05:01:11 -0700 (PDT) Received: from dhcp-peg3-cl31144-254-5-133.cisco.com (dhcp-peg3-cl31144-254-5-133.cisco.com [144.254.5.133]) by mx.google.com with ESMTPS id a48sm8367103eei.7.2010.09.27.05.01.08 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 27 Sep 2010 05:01:09 -0700 (PDT) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Apple Message framework v1081) Subject: Re: Question on view design for both Hierarchy and Date. From: Wout Mertens In-Reply-To: Date: Mon, 27 Sep 2010 14:01:06 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: To: user@couchdb.apache.org X-Mailer: Apple Mail (2.1081) On Sep 26, 2010, at 13:02 , S=F8ren Hilmer wrote: > Hi >=20 > A few questions to your comments >=20 > On Thu, Sep 23, 2010 at 10:06 PM, Wout Mertens = wrote: >=20 >> 2 comments: >> - your time is a fixed-length string (until the year 10000 ;)) so you >> could just leave it as-is instead of splitting it >>=20 >=20 > Yes, but will that allow me to do the sum on a monthly basis, like = with this > query for september: > startkey=3D["A","B","c6",2010,9,1]&endkey=3D["A","B","c6",2010,9,31,{}] Simply query for = startkey=3D["A","B","c6","2010-09-01"]&endkey=3D["A","B","c6","2010-09-32"= ] >> - using group=3Dtrue you can get the sum for each sub level in your = key >> array so you don't have to emit the full path. Just emit the path and >> then the time. >>=20 >=20 > Hmm, if I do that how do I query the sum under for instance the root = for a > period? Oh I see. Yeah you can't do that unless you use multi_views which are in = development. Basically you have a 2-dimensional search space (path and time) and = you're cheating your way into 1-dimensionality by preparing all the = possible 2-dimensional queries you might ask. That works but it costs = you disk space obviously. Wout.