couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dirkjan Ochtman <dirk...@ochtman.nl>
Subject Re: Question on view design for both Hierarchy and Date.
Date Tue, 21 Sep 2010 07:55:43 GMT
On Tue, Sep 21, 2010 at 08:53, Søren Hilmer <sh@widetrail.dk> wrote:
> //reduce just sums the values

I hope you're using the built-in "_sum" reduce function?

> This allows me to do the wanted query
> like, startkey=["A","B","c6",2010,9,20,12,0,0]&endkey=["A","B","c6",2010,9,20,22,0,0,{}]
>
> Is there a better (for some value of better like: faster and/or uses less
> space) approach to this problem?

I think your approach is about right (and close to what we use).

> The documents are actually only on the leaves in the hierarchy, but I need
> to sum their values up the tree, can this extra information somehow be used
> to improve the view?

As long as you're summing along the key order you're using, that
should work great.

> I can get up to 500.000 of these documents pr. hour. would that be a problem
> as I do several emits pr document?

It starts to be a problem if the view indexer can't keep up with your
insertion rate.

Cheers,

Dirkjan

Mime
View raw message