Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> How Oracle use an INDEX?
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
![]() |
![]() |