transitively closed relation

From: Mikito Harakiri <mikharakiri_at_yahoo.com>
Date: 19 Feb 2002 12:59:26 -0800
Message-ID: <bdf69bdf.0202191259.45fd2adf_at_posting.google.com>


71062.1056_at_compuserve.com (--CELKO--) wrote in message news:<c0d87ec0.0202070948.753fdd6f_at_posting.google.com>...
> > Using the adjacency list model will only require adding a row with parent relationship. <<
>
> The adjacency list model will built a tree one node at a time much
> faster. But DELETE can result in problems, since the tree becomes a
> disjointed forest. And aggregation queries are a nightmare of cursors
> or self-joins.

Transitive closure relation has been traditionally viewed as an incremental evaluation structure over adjacency list. For example if we have

AL('a','b').
AL('b','c').

then

TC('a','b').
TC('b','c').
TC('a','c').

Now, lets drop adjucency list altogether, and declare transitive closure as "the final relational representation" for hierarchy! Now deleting the node no longer has the anomaly that you mentioned for adjacency list. Also, if we want to find immediate parent or children of the node, we can query it with a single join. By all means adjucency list is the wrong model for hierarchy... Received on Tue Feb 19 2002 - 21:59:26 CET

Original text of this message