incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wout Mertens <wout.mert...@gmail.com>
Subject Re: Question on view design for both Hierarchy and Date.
Date Mon, 27 Sep 2010 12:01:06 GMT
On Sep 26, 2010, at 13:02 , Søren Hilmer wrote:

> Hi
> 
> A few questions to your comments
> 
> On Thu, Sep 23, 2010 at 10:06 PM, Wout Mertens <wout.mertens@gmail.com>wrote:
> 
>> 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
>> 
> 
> Yes, but will that allow me to do the sum on a monthly basis, like with this
> query for september:
> startkey=["A","B","c6",2010,9,1]&endkey=["A","B","c6",2010,9,31,{}]

Simply query for startkey=["A","B","c6","2010-09-01"]&endkey=["A","B","c6","2010-09-32"]

>> - using group=true 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.
>> 
> 
> 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.


Mime
View raw message