Google Answers Logo
View Question
 
Q: Comparison of tree hierarchy methods in SQL ( No Answer,   0 Comments )
Question  
Subject: Comparison of tree hierarchy methods in SQL
Category: Computers > Algorithms
Asked by: mrsmith99-ga
List Price: $15.00
Posted: 24 Oct 2004 21:36 PDT
Expires: 23 Nov 2004 20:36 PST
Question ID: 419571
There are a number of ways of storing a hierarchy in SQL, then
accessing that tree, displaying it, etc., with PHP or Cold Fusion.
I'm currently using the easy method, store a parent ID, and iterate
through with a recursive function.  Simply put, this doesn't scale.
Too much stuff in memory, too many database accesses.

I'm considering a preorder traversal as being better - more complex -
less database accesses.  Since the bottleneck is usually the
database, I like the idea of the pre-order.

However: is there a more advanced algorithm out there?  (I'm a CS grad
so I can handle your best shot).  Graph theory too complex?

Ideally just provide the names of algorithms, a summary, with a few
pros and cons..
Bonus points if it scales to handle simultaneous hierarchies intersecting.

I am not interested in XSLT or XML related technologies, I am using SQL

Clarification of Question by mrsmith99-ga on 24 Oct 2004 22:15 PDT
If it helps, by 'preorder traversal' I mean the Joe Celko nested set
method outlined here:

http://www.intelligententerprise.com/001020/celko.jhtml?_requestid=136925
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy