| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Best SQL hierarchical model for large/heavily updated graphs?
>> One of the fundamental floors of this technique is that if you want to link a particular branch into another part of the tree, you have to replicate the whole branch's materialized paths to the new position in the tree, <<
But that is the nature of a tree. The question is: do want a copy of the subtree or do you want to link to the same subtree? I have code for making a copy of a subtree under a second parent in TREES & HIERARCHIES IN SQL. It is not bad and you just have to remember to check for cycles.
If youy wan to do a link, then you need a forest table with multiple trees so you can reference the same subtree in multiple places as lead nodes within the parent tree. A little ugly, but do-able, if you don't go too deep with it.
In nested sets or intervals, you separate the nodes from the edges. You can modify this to allow a leaf node to reference a subtree Received on Tue Feb 07 2006 - 09:21:37 CST
![]() |
![]() |