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: Aram Meguerian <aram_at_unisys.com.br>
Date: 1997/05/24
Message-ID: <01bc684b$6fd817c0$8a04dcc8@psaphos>#1/1

Paul Brewer <paulb_at_pbrewer.demon.co.uk> escreveu no artigo <eb8c0GAis3ezEw3B_at_pbrewer.demon.co.uk>...
> In article <3374D5B3.6950_at_iol.ie>, Chrysalis <cellis_at_iol.ie> writes
> >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
> >No.
> >The index, if required (and it usually is), must be created manually on
> >the referring key.
> >It is, of course, necessary that an index already exist on the
> >referred-to primary (or other unique) key.

      I'm not so sure, but I think it is NOT necessary to have an index    on the primary (or unique) key. In fact, it is not, since I do have    some small reference tables (< 10K, < 20 rows), where I CACHE'd them    and got ridden of the PK index (not the PK, however). Up to now (a    month latter) I have had no problems.

> >
> >Chrysalis.
> And, I'm told, if you don't create the index on the FK, you can have
> awful locking problems.

      I haven't seem it hapenning and I have some FK that are no indexed    also.

> --
> Paul Brewer
>
 

-- 

                     Aram Meguerian
                     aram_at_unisys.com.br

-------------------------------------------------------------------
  TANSTAAFL - There ain't no such thing as a free lunch 
                                           by Robert A. Heinlein
-------------------------------------------------------------------
     I don't work at Unisys, it is just my Internet Provider, 
     so don't blame it for anything I have just said.
-------------------------------------------------------------------
Received on Sat May 24 1997 - 00:00:00 CDT

Original text of this message

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