Re: Other tree representations in SQL

From: Carl Rosenberger <carl_at_db4o.com>
Date: Fri, 6 Dec 2002 17:19:27 +0100
Message-ID: <asqi6f$o51$02$1_at_news.t-online.com>


Alfredo Novoa wrote:
> > I challenge any relational system to provide the same functionality with
> > an equally small number of lines of code. I challenge any relational
> > system for a performance race on any kind of tree search or tree traversal.
>
> This is a solution using Tutorial D:
>
> var Tree = real relation { N Char, P Char } key { N, P };
> Tree := relation { tuple { 'A', 'A' }, tuple { 'B', 'A' }, tuple { 'C', 'A' },
> tuple { 'D', 'B' }, tuple { 'E', 'B' }, tuple { 'F', 'C' },
> tuple { 'G', 'C' } };
> TClose(Tree);

Taking a look again:

Your "solution" is not a Tree.

You provide no possibility to differentiate between nodes that precede the parent node and nodes that succeed the parent node.

tuple{ 'B', 'A' } and tuple { 'C', 'A' }

both hang down limp in vertical direction from their parent

                    tuple{ 'A', 'A' }


Kind regards,
Carl

--
Carl Rosenberger
db4o - database for objects - http://www.db4o.com
Received on Fri Dec 06 2002 - 17:19:27 CET

Original text of this message