Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle not using indexes on char/varchar columns
Kamil Okac wrote:
> Howard J. Rogers wrote:
>> create table TEST... >> insert rows... >> exec dbms_stats.gather_table_stats('<schema_name>,'TEST') >> explain plan for select * from test where col1=1 >> >> My bet is that the computation of the statistics will mean the explain >> plan will report an index scan first time. >>
So, sorry Kamil... but what's the question now?
The full table scans have disappeared, and index usage is consistent. Or is it the varying cost that's bothering you? I wouldn't worry about it, largely because (from memory) costs take account of index pre-fetching and caching... so you first cost is higher than subsequent ones, because (I'd imagine) it realises the index nodes will have to be physically fetched the first time, and will be in the cache the second and subsequent times.
Not sure why you threw a select from dual in there, either.
Regards
HJR
-- -------------------------------------------- See my brand new website, soon to be full of new articles: www.dizwell.com. Nothing much there yet, but give it time!! --------------------------------------------Received on Wed Oct 08 2003 - 06:38:55 CDT