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 -> How Oracle use an INDEX?

How Oracle use an INDEX?

From: Nadeem Kafi <kafis_at_super.net.pk>
Date: 15 Aug 2001 06:17:49 -0700
Message-ID: <f1698545.0108150517.26eb0866@posting.google.com>


Hello All,

Suppose there is an index on table policy as

create unique index on policy as (companycode,org_brachcode,branchcode,

   polseq,endcount);

Now do I write like this

select * from policy
where companycode = 'T'
and org_branchcode = '01'
and branchcode = '02'
and polseqnos = 134234
and endcount = 0;

OR

select * from policy
where endcount = 0
and polseqnos = 134234
and branchcode = '02'
and org_branchcode = '01'
and companycode = 'T';

I think both will use the index...so do the explain plan show using TOAD. Oracle do a full table scan it first index column is not used.

Could GURUs here please comment.

TIA and Best Regards,
Nadeem Kafi. Received on Wed Aug 15 2001 - 08:17:49 CDT

Original text of this message

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