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: [SOLVED for good] performance tuning questions: replace IN (values)by JOIN

Re: [SOLVED for good] performance tuning questions: replace IN (values)by JOIN

From: Howard J. Rogers <howardjr2000_at_yahoo.com.au>
Date: Tue, 2 Sep 2003 06:00:02 +1000
Message-ID: <3f53a5b4$0$15132$afc38c87@news.optusnet.com.au>

"Daniel Morgan" <damorgan_at_exxesolutions.com> wrote in message news:3F535E0D.7716475A_at_exxesolutions.com...
> mitt wrote:

> Given that foreign keys must be to either a primary key or unique
> constraint. And given that both of these constraints build an index by
> default ... how could you not have an index on the column in the parent
> table?
>

Er, Daniel. The reason it's called a foreign key is that it is a primary key in *another* table, but a mere column in the child table, which is where it needs indexing. It is, in other words, a column which 'comes from' another table (from the parent, to the child), and is thus strange to it, or foreign.

So yes, the source of a foreign key will always be indexed. But the foreign key itself (ie, the presence of that column in a different table) will not be unless you make it so.

Regards
HJR Received on Mon Sep 01 2003 - 15:00:02 CDT

Original text of this message

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