Re: Nested set model with large gaps and spreads in the numbering

From: milkchaser <member_at_dbforums.com>
Date: Tue, 01 Oct 2002 17:12:17 +0000
Message-ID: <1877652.1033492337_at_dbforums.com>


Originally posted by --Celko--
> >> Whens your next book due out? <<
>
> I am trying to move to Salt Lake City in October and my wife is not
> her to help. My plan is to have it to Morgan-Kaufmann before the end
> of the year for publication in early 2003 (?)

Writing a book AND moving! You're a glutton for punishment. :-)

Looking over the many posts in this forum concerning the nested set model, I can't help but wonder if one could define the sets equally well by replacing the "left" and "right" columns with "node_id" and "num_descendants" columns. Using your standard org chart table, that would yield:

emp      .  node_id  .  num_descendants
=========.===========.===================
'Albert' .     1     .       5
'Bert'   .     2     .       0
'Chuck'  .     3     .       3
'Donna'  .     4     .       0
'Eddie'  .     5     .       0
'Fred'   .     6     .       0

I don't know as this is an advantage or disadvantage, but it uses fewer node ids. Using the left/right numbering process, each node enumerates a non-existent node (ie. left=2,right=3 enumerates the node itself, namely 2, and an empty neighbor, namely 3).

--
Posted via http://dbforums.com
Received on Tue Oct 01 2002 - 19:12:17 CEST

Original text of this message