Re: Linked Lists in Oracle Tables
Date: 11 Apr 2003 17:39:04 -0700
Message-ID: <cf59f633.0304111639.1ce801a9_at_posting.google.com>
Would it be possible to use type ROWID to represent the pointers here?
google_at_kevyale.com (KevY) wrote in message news:<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
> (i.e. just a "parent" reference)?
>
> 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
> (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 Sat Apr 12 2003 - 02:39:04 CEST