MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:jim kraai Date:September 8 1999 3:08am
Subject:Re: hierarchy of categories implementation
View as plain text  
Thimble Smith wrote:
> 
> >> Has anyone ever done a hierarchical categorization using MySQL?
> 
> "Joe Celko's SQL for Smarties: Advanced SQL Programming", Morgan
> Kaufmann, 1995, has two chapters on representing trees and graphs
> in relational databases.  It's not superb information, and the
> examples rely heavily on views and subselects, but you might find
> it useful.  The main thing I got out of it (although I haven't had
> the chance to use this, yet) is the idea of representing a graph
> as nested sets instead of as trees.
> 
> Tim

This is off-topic, as the original author wasn't looking for 
the full tree from the db, but rather the parent, node, and 
children of a given node.

I had a similar quest about a year ago.

Not to drop names, but Joe & I had a long e-mail conversation 
via e-mail last fall where he concluded that I couldn't write 
strict SQL92 code (correct), and that his nested sets methods 
update _way_ too many indexes to be effective in production 
use (he conceded).

Also, his method relied heavily on features that aren't 
implemented in MySQL--views and subselects.

SQL for Smarties is a must read for anyone using SQL.  Really, 
really good stuff & lots of it.

Anyone interested can ask Joe directly if he's had some better ideas:
web:	http://www.celko.com/
email:	71062.1056@stripped

Your SQL had better be SQL-92 compliant and correctly capitalized!!!

I really like the guy.

--jim
Thread
Re: hierarchy of categories implementationjim kraai8 Sep