Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: foreign key
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 CorporationReceived on Tue May 20 1997 - 00:00:00 CDT