Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: Tree Structure and Db

by pg (Canon)
on Jul 06, 2005 at 01:38 UTC ( [id://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 (Patriarch) 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://472658]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2024-04-16 10:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found