Re: Index creation

From: Alan <alanshein_at_erols.com>
Date: Fri, 9 Aug 2002 08:55:38 -0400
Message-ID: <aj0e3v$16tulq$1_at_ID-114862.news.dfncis.de>


What about the index range scan in Oracle 9i? Wouldn't that find the B index as well as the A index?

"Jan.Hidders" <hidders_at_hcoss.uia.ac.be> wrote in message news:3d538467$1_at_news.uia.ac.be...
> In article <73d921e1.0208081525.1bf53b1e_at_posting.google.com>,
> Flávio Maciel <flaviorm_at_portoweb.com.br> wrote:
> >Consider a basic many-to-many relationship where you have two foreign
> >keys that are also the primary key of this relationship table.
> >My question is: what's are the differences and implications of:
> >- building an index for the primary key and each foreign key?
> >- building an index just for thew primary key?
> >- building an index just for the foreign keys?
> >
> >If I have the index for the primary key, is it needed to have indexes
> >for each foreign key individually?
>
> That depends a bit on the database and the used indexing techniques.
Usually
> with B-trees and sorted indexes databases know that they can use an index
on
> (A, B, C) as if it was an index on (A, B) or (A). So if you already have a
> primary key (A, B) then you only need an extra index on (B).
>
> -- Jan Hidders
>
>
Received on Fri Aug 09 2002 - 14:55:38 CEST

Original text of this message