Hierarchical Data Storage

Ruslan Zasukhin sunshine at public.kherson.ua
Tue Feb 13 04:38:42 CST 2007


On 13/2/07 12:30 PM, "Trevor DeVore" <lists at mangomultimedia.com> wrote:

>> Bart,
>> 
>> Actually Trevor points that IF exists several ROOTs than this
>> algorithm
>> simply may not work.
>> 
>> Because you already cannot use
>>     UPDATE WHERE  left > 1 and RIGHT < 32
>> 
>> Because this UPDATE also will touch nodes of OTHER trees.
>> 
>> Right Trevor?
>> 
>> Hmm.
> 
> Well, I don't know that it won't work.  It seems that it would work
> as long as the left/right values for the each root node were set to
> it's children but there may be a complication.

Yes, may be it needs one more field -- ID of tree.
 
> My main concern is that editing one hierarchy in the table would
> invalidate the hierarchy information of records to the right of the
> node being updated.

> In the example I presented, you could have
> multiple people working on different lessons at once.  If an update
> to the hierarchy in one lesson forced everyone to update their
> lessons that would be bad.

What you mean with:

* "forced everyone to update their lessons" ?

So few users work with own lessons.
Work via cursors, right?

Each cursors most probably will set at least READ lock.
So yes, one user cannot update right nodes until other lock them.

Wait. No.

If keep TreeID field, then will be

    UPDATE .. WHERE treeid = rootID and left > x and right < y

So USER1 will not touch trees of other users.


-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list