| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Index creation
On 8 Aug 2002 16:25:41 -0700, flaviorm_at_portoweb.com.br
(=?ISO-8859-1?Q?Fl=E1vio_Maciel?=) 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?
I think with the most of the common DBMSes, you won't need three indices. Say the foreign keys are A and B, you have the primary key index (A, B). Then you only need another index on B, since the primary key index can be used for matching A alone, too.
hth,
Heinz
Received on Fri Aug 09 2002 - 00:33:31 CDT
![]() |
![]() |