Re: Storage method for foreign keys?

From: Jim Smith <jim_at_jimsmith.demon.co.uk>
Date: 1995/08/25
Message-ID: <809371789.22893_at_jimsmith.demon.co.uk>#1/1


cs321717_at_student.uq.edu.au (Blair Layton) wrote:

>Hi,
> Does anyone know how Oracle stores foreign keys, ie. is a foreign key
>stored "literally" or is it stored as a pointer (to the primary key
>being referenced)?
 

>Thanks in advance,
> Blair.

A foreign key is just a rule that says "some existing data must match some other existing date" (grossly simplified), so in one sense there is no additional storage for the foreign key.

In fact, oracle stores the text of the rule (fk table and column, and PK table and column) in a table USER_CONSTRAINTS. The rule is thus interpreted each time the relevant columns change.

Pointers are a no-no in modern relational databases which is why they are slower then network (codasyl) databases but a lot easier to manage.

Jim Smith                      jim_at_jimsmith.demon.co.uk
Oracle DBA                     
Received on Fri Aug 25 1995 - 00:00:00 CEST

Original text of this message