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 <[email protected]>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.
