incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Metin Akat <>
Subject Re: Tree structure: how to calculate branch node sum, using results from a view that calculates leaf node sums.
Date Tue, 08 Sep 2009 07:34:04 GMT
> Why not record the account hierarchy with each transaction and think
> of that as a snapshot of the hierarchy when the transaction occurred?
> You get a little extra historical data that way.  You can emit a view
> row for every account in the lineage so that when you calculate
> account balances you only need to use the account id as the key.  So
> it does not matter if the hierarchy in the transaction does not match
> the current hierarchy

That's not good in my situation. When I move an account, that action
has to update the balances of all parent accounts.
I mean, that must update all the balances up to the root of the tree.
It can't be historic.

View raw message