pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: depesz@depesz.pl
To: pgsql-sql@postgresql.org
Subject: Re: tree structures in sql - my point of view (with request of comment from joe celko)
Date: Tue, 3 Sep 2002 11:17:38 -0700
Message-ID: <200209031117.38107.josh@agliodbs.com> (raw)
In-Reply-To: <20020903132207.GC24879@depesz.pl>
References: <20020903132207.GC24879@depesz.pl>


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 Berkus
 Aglio Database Solutions
 San Francisco




view thread (6+ messages)  latest in thread

Message-ID: <200209031117.38107.josh@agliodbs.com>
Permalink:  ../200209031117.38107.josh@agliodbs.com/
Also on:    postgresql.org/message-id/200209031117.38107.josh@agliodbs.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: josh@agliodbs.com, depesz@depesz.pl
  Subject: Re: tree structures in sql - my point of view (with request of comment from joe celko)
  In-Reply-To: <200209031117.38107.josh@agliodbs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox