Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> index selection!
I have a table with a field which value must be 'T' ,'F'
the table has about 70,000 records.(about less than 100 records have
the value 'F');
I have create a bitmap index on it.
the problem is :
when I execute 'select count(*) from tabname where fieldname='F',it
uses the bitmap index.
the execution plan:
1.28 SELECT STATEMENT Optimizer =CHOOSE Cost=28
2.1 SORT AGGREGATE
3.1 BITMAP CONVERSION COUNT
4.1 BITMAP INDEX SINGLE VALUE IDX_BIT_INCARD_IF_CHK
It runs fast.
when I execute 'select * from tabname where fieldname='F' '
or 'select sum(fields1) from tabname where fieldname='F' ,it uses full access table
when I execute 'select /*+ index(incard idx_bit_incard_if_chk) */
I think that oracle should automatic select the best execute plan (uses
the correct index).
otherwise I should change every sql statement(using the table) in the
program.
How should I do?
Any suggestions are appreciated.
wy.
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Thu Sep 07 2000 - 21:17:55 CDT
![]() |
![]() |