Linked Lists in Oracle Tables
Date: 10 Apr 2003 13:19:18 -0700
Message-ID: <2c436769.0304101219.5d12c677_at_posting.google.com>
If I'm storing a hierrachy in an Oracle table, is there any benefit in
making the records "doubly-linked" (i.e. each having a "parent" and a
"child" reference) rather than simply having a "singly-linked" list
In order to find all the offspring of a record in a singly-linked
system, I have (or the system has) to examine every record to see if
it has me as a "parent". Then repeat this step for all my 1st
generation children, etc., until I have a complete list.
In the doubly-linked version, although I can quickly identify the
children (have a foreign key to them) I have (or the system has) still
to examine every record to see if it is the right one. Then repeat for
all the 1sr generation children found ...
On the face of it, the doubly-linked version doesn't seem to save much
(i.e. just a "parent" reference)?
(although it is able to stop searching once it has found the matching
record).
Is that really as good as it gets? Doesn't Oracle efficientize this somehow? Is there no real concept of "pointers" that can take you directly to another referenced record, without having to check all records against the key to find the match? Received on Thu Apr 10 2003 - 22:19:18 CEST