Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Tree structure

Re: Tree structure

From: Michael Kay <M.H.Kay_at_eng.icl.co.uk>
Date: 1998/03/04
Message-ID: <34fd9406.0@145.227.194.253>#1/1

>Does anyone know how to implement a tree data structure into RDBMS ? and
>provide a grouping query for any note within the tree.

Joe Celko has written some good articles on the subject in DBMS Magazine.

The general answer is it's not easy: you need to do recursion, which is beyond the scope of the predicate calculus that underlies the relational model. You can sometimes achieve what you want using the SQL extensions in products like ORACLE, but they are rather ad-hoc. More often you will end up writing programs that navigate the data procedurally. My usual advice, given today's cheap memory, is to read the whole structure into memory and process it there. But that's assuming you're dealing with Megabytes rather than Gigabytes!

Mike Kay, ICL Received on Wed Mar 04 1998 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US