Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

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.


Comment on Re^2: Tree Structure and Db
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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2014-07-12 14:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (240 votes), past polls