Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How to associate Foreign Key with an Index?

Re: How to associate Foreign Key with an Index?

From: John K. Hinsdale <hin_at_alma.com>
Date: 8 Feb 2007 06:35:12 -0800
Message-ID: <1170945312.022377.15510@a75g2000cwd.googlegroups.com>


On Feb 8, 7:15 am, "sybrandb" <sybra..._at_gmail.com> wrote:

> but a FK is NOT
> automatically indexed when you create the FK.

Sybrand,
I think I figured out where we got "disconnected"

When I said, "Oracle does it for you,"

> On Feb 8, 12:13 pm, "John K. Hinsdale" <h..._at_alma.com> wrote:
> > On Feb 8, 4:48 am, MRCarver <mrcnewGr..._at_charter.net> wrote:
> > > I am having a hard time figuring out how to
> > > make sure that the foreign keys I create have indexes.
> > Oracle does it for you.

I meant "it" to mean exactly what the original poster was asking for: to make sure the foreign keys HAVE the needed index, not the automatic creation of such indexes. Later in my post I described that the user must explicitly create such things, but I understand if you stopped reading after the first sentence if it was misinterpreted to be making the false claims that FK's create indexes automatically.

I'm still interested to know if Oracle allows an FK without an unique index on the child columns, which you seemd to imply was the case. Is that really possible? I'll be surprised, but then I have been surprised by Oracle before.

Also, I'm curious as to what the other DBMS's (InterBase and SQL Server) from which our original poster Mr. Carver is arriving, do in the face of an FK without a unique index on the child cols... not enforce the FK? enforce it with un-indexed uniqueness check?

Sorry for the vagueness & confusion of my response.

John Hinsdale Received on Thu Feb 08 2007 - 08:35:12 CST

Original text of this message

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