List:General Discussion« Previous MessageNext Message »
From:Peter Brawley Date:April 20 2007 3:22pm
Subject:Re: Storing forests in tables.
View as plain text  
Nathan,

 >I ve recently been playing with storing trees in mysql using nested
 >set, and I was wondering if anyone knows if this could be extended to
 >forests (set of trees) to be stored in one table?

Dead simple, add a treeID smallint column to the table that holds the 
nested sets, and add ... WHERE treeID = <treeid> ... to every update, 
delete, insert & select.

PB

-----

Nathan Harmston wrote:
> Hi,
>
> I ve recently been playing with storing trees in mysql using nested
> set, and I was wondering if anyone knows if this could be extended to
> forests (set of trees) to be stored in one table?
>
> Many Thanks in advance,
>
> Nathan
>
Thread
Storing forests in tables.Nathan Harmston20 Apr
  • Re: Storing forests in tables.Peter Brawley20 Apr