Re: pointers on representing tree in db?

From: Todd Gillespie <toddg_at_linux127.ma.utexas.edu>
Date: 19 Apr 2001 00:13:16 GMT
Message-ID: <9blais$g3a$1_at_geraldo.cc.utexas.edu>


David Cressey <david_at_dcressey.com> wrote:
: I've seen a tiny addition to Joe Celko's "nested set" method. This involves
: adding a "level number" column to the hierarchy table. The level number is
: 1 for the root, 2 for the direct children of the root, and so on. So the
: direct children of level N nodes would all have N+1 in the level column.

Another way to do that is to keep tree access queries in stored procs/functions and compute the level inside the function. That's what I did in Postgres when I was trying to emulate Oracle.

Oh, and try not to quote the entire previous article - that Celko bit was quite long.... Received on Thu Apr 19 2001 - 02:13:16 CEST

Original text of this message