I'm in the process of building a tree-structured message base, or rather 
porting software I wrote back in mid-80s to the web.  This isn't the 
ubiquitous "threaded" BBS software.  It's tree-structured.  This means that 
every message on the message base is related through a single ancestor, Msg #0.

I've written and re-written the software many times using ISAMs and custom 
lookup-type indices, usually just keying a parent message pointer in every 
message.  However this is the first time I've done it with SQL.  Naturally, 
the procedural approaches I've used in the past won't do with a result set 
architecture of a SQL database.  To prove it, I tried it.  Performance, as 
expected, was miserable.

Is there a way to build table is such a way that a classic Knuth, pre-order 
tree traversal is possible with a single SQL call?  I mean, besides this 
one: http://www.dbmsmag.com/9603d06.html.  That method looked very 
promising until I realized that adding a new leaf node would mean 
potentially having to update the right/left counters for every record in 
the message base.  Since a tree can easily grow to 100k messages or more, I 
don't think that's feasible.
-----------------------[ http://www.magpie.com ]-------=o&>o-------
Steve Manes
Brooklyn, N'Yawk


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to