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: foreign key

Re: foreign key

From: Gary Melhaff <melhafg_at_wdni.com>
Date: 1997/05/20
Message-ID: <3381EE09.2EC0@wdni.com>#1/1

David Turner wrote:
>
> Does anyone know whether an index is created when you
> create a foreign key. I was under the impression that an
> index was created for a primary key but am unclear whether an
> index is created for a foreign and/or a unique key.
>
> Any help is appreciated, David T
Only for a pk is an index automatically created by the DDL (except for fk columns in Designer 2000 ONLY when you go through the DDW from entity to table). Remember to create the primary key index in your index tablespace - the default is the same tablespace as the table.

But, you should always create an index for foreign key columns whether you use Des2 or not since anytime you update/delete a master row, each child row will have to be scanned with full table scan, locking the entire table as well. Not a good thing.

-- 
Gary Melhaff
Senior Database Analyst
Weyerhauser Corporation
Received on Tue May 20 1997 - 00:00:00 CDT

Original text of this message

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