From: Brian Candler Date: 2004-10-08T23:11:42+09:00 Subject: Re: [ANN] ndb Object-Relational Mapper On Fri, Oct 08, 2004 at 10:39:44PM +0900, George Moschovitis wrote: > Have a look at the following link tha explains this technique: > > http://www.ibase.ru/devinfo/DBMSTrees/sqltrees.html This is a very cute data structure which I hadn't come across before. However, if I add a new subordinate to 'Bert' (say 'Bob'), don't I end up having to renumber almost the entire tree? Albert 1,14 / \ Bert Chuck 2,5 6,13 | / | \ Bob Donna Eddie Fred 3,4 7,8 9,10 11,12 Example 5 in that page gives the SQL to do this, but I don't fancy updating 10 million nodes on each insert (and in an ISP, signups happen continuously). Perhaps there is a workaround: e.g. add the nodes into a temporary adjacency list representation, and then once a night walk the tree to insert in bulk. I'd have to think about that. Regards, Brian.