Re: Trying to implent (Joe Celko's) Nested Sets, but need more data columns

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Joe Celko (jcelko212_at_earthlink.net)
Date: 09/19/04


Date: Sun, 19 Sep 2004 04:31:26 -0700


>> The lft and rgt columns of the nested set model are not relational,
not verifiable, and not stable. <<

Unh? The (lft,rgt) pairs are easily veriable. They have nothing to do
with a particular physical storage mechanism, unlike a GUID. You look
at the graph of the tree and compute them; they are a kind of logical
"co-ordinate pair" for tree structures.

Explain why they are not stable. Each tree structure has one and only
one nested set representation when you close any gaps in the sequence.
I would understand if you complained that nested sets are TOO stable,
making structural changes expensive.

Tropashko's nested intervals are good when you have a tree structure
that is not stable -- like newgroup threads. But the price is the
overhead of a library of UDFs for rational numbers and some extra
complexity in the basic operations. Always a trade-off.

--CELKO--
Please post DDL, so that people do not have to guess what the keys,
constraints, Declarative Referential Integrity, datatypes, etc. in your
schema are. Sample data is also a good idea, along with clear
specifications.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Relevant Pages

  • Re: Joe Celkos work with nested set models - update times??
    ... This seems to be the downside to the nested set model. ... >1) Sibling are added to the right side of their parent, ... >3) Given a clustered index on the tree structure, ... >a tree structure in the adjacency list model (no cycles when the new ...
    (microsoft.public.sqlserver.programming)
  • Re: converting an existing structure to support heirarchies
    ... > the adjacency model and the nested set model but neither seem to fit ... Nested set seems to work when there is ultimately one root but ...
    (microsoft.public.sqlserver.programming)
  • Re: converting an existing structure to support heirarchies
    ... >> the adjacency model and the nested set model but neither seem to fit ... Nested set seems to work when there is ultimately one root but ... works when all containers exists under container 1 but what if container ...
    (microsoft.public.sqlserver.programming)