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: Where is a Foreign Key stored?

Re: Where is a Foreign Key stored?

From: Allen Kirby <akirby_at_att.com>
Date: 1997/02/06
Message-ID: <32FA418E.4DA1@att.com>#1/1

Rory Skelly wrote:
>
> Greetings from an Oracle DBA-in-the-making
>
> My question has to do with adding foreign key constraints.
>
> When creating Primary or Unique Key constraints you can specify the index
> to use (and where it will be located etc.) but with Foreign Keys you don't
> have that option.
>
> 1. What object is created when you add a Foreign Key constraint?
> 2. In which tablespace is it created?
>
> I've read everything I can find in the manuals - this item doesn't seem to
> be mentioned.
>
> Any help would be appreciated
>
> Regards
>
> Rory Skelly
> Kingston, Ontario
> skellyr_at_kgh.kari.net

Foreign key constraints don't create indexes. Indexes are created for unique constraints because that is how the uniqueness is enforced. Otherwise a full table scan would have to be done to make sure it is unique. Not all foreign keys need indexes, especially foreign keys in small tables or where the possible values for the column are limited. Besides, you need the index on the table you are pointing to with the foreign key, not the foreign key column on the current table.

-- 
---
Allen Kirby			AT&T ITS Production Services
akirby_at_att.com			Alpharetta, GA.
Received on Thu Feb 06 1997 - 00:00:00 CST

Original text of this message

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