Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re^2: Tree Structure and Db

by pg (Canon)
on Jul 06, 2005 at 01:38 UTC ( #472658=note: print w/replies, xml ) Need Help??

in reply to Re: Tree Structure and Db
in thread Tree Structure and Db

As the author stated, this structure is good for trees that are mostly static.

In case the tree can be updated, performance becomes an issue. Even a simple operation as to insert a leaf node, could cause you to insert multiple rows (average number of rows inserted equals average depth of all pathes, and in the worst case, the number of rows get inserted is the length of the deepest path.)

Look at one more operation: to move a subtree to be under a new parent. if you only store the immediate parent-child relationship, you only need to modify 1 row, but if you store all ancestor, you will need to modify multiple rows for each node in the subtree (basically to modify all relationships towards a node that is above the root of the subtree.)

Data integraty could also be an issue, a simple coding mistake can spread dirty data all over the place, not just an isolated spot.

Replies are listed 'Best First'.
Re^3: Tree Structure and Db
by ikegami (Pope) on Jul 06, 2005 at 03:00 UTC
    Thanks for expanding on this. I intended to do so, but didn't get get a chance 'til now. That is exactly what I meant by my comment.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://472658]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2020-05-31 11:17 GMT
Find Nodes?
    Voting Booth?
    If programming languages were movie genres, Perl would be:

    Results (173 votes). Check out past polls.