Re: tree structures in sql - my point of view (with request of comment from joe celko) - Mailing list pgsql-sql

From Josh Berkus
Subject Re: tree structures in sql - my point of view (with request of comment from joe celko)
Date
Msg-id 200209031117.38107.josh@agliodbs.com
Whole thread Raw
In response to tree structures in sql - my point of view (with request of comment from joe celko)  (Hubert depesz Lubaczewski <depesz@depesz.pl>)
Responses Re: tree structures in sql - my point of view (with request of comment from joe celko)  (knut.suebert@web.de)
List pgsql-sql
Hubert,

> i recently spent some time on tree-structures in sql.
> i started with simple id/parent_id approach, used by nearly everyone,
> then i stopped at joe celko's nested sets, but i found it not very
> usable.

I'll be posting an article on implementing nested set trees "real soon now".

My experieince:

Adjacency list trees are easier to understand conceptually, there are more
tools on freshmeat.net for them, and they are the most efficient form of tree
for graphical display.

Nested Set trees are hard to wrap your mind around, lack a lot in the way of
code samples on freshmeat, are harder to build GUI tools for, but are much,
much faster for determining branch membership and branch parenthood.

So which model you use depends on what you intend to do with the tree.



--
-Josh BerkusAglio Database SolutionsSan Francisco



pgsql-sql by date:

Previous
From: "alexandre :: aldeia digital"
Date:
Subject: Outer Join with For Update
Next
From: Bruce Momjian
Date:
Subject: Re: UPDATE & LIMIT together?