Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: question about indexes
Ty O'Kelly wrote:
>
> hello all,
>
> i have a question about how indexes work. lets say i have a table
> called transaction with fields:
>
> transaction (primary key)
> costctr
> chart
> account
> subacct
> amount
>
> there is already an index called transactioni1 created on the following
> columns (it is a foreign key):
>
> costctr
> chart
> account
> subacct
>
> my question is this: if i do a select on costctr and account will oracle
> make use of the existing index or should i create a new index made up of
> the two columns being queried on?
>
> thanks for the help.
>
> ty
>
> --
> Ty O'Kelly
> tokelly_at_openplus.com
Oracle can use leading columns in index selection, so it may choose to take advantage of the costctr (dependent on its cardinality)...
HTH
--
"Some days you're the pigeon, and some days you're the statue." Received on Mon Jul 19 1999 - 09:19:20 CDT