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 -> Re: full table scan cheaper than index??

Re: full table scan cheaper than index??

From: Keith Boulton <kboulton_at_ntlworldgoaway.com>
Date: Sat, 14 Jul 2001 10:38:51 GMT
Message-ID: <_iV37.1$lhj.2228252@news.randori.com>

>
> select id, timestamp
> from my_table
> where timestamp > to_date('20010701','YYYYMMDD');
>
> The table "my_table" has an index, let's call it "my_index", on the column
> "timestamp".
>

This query may run slowly because oracle assumes that many rows will be returned. Try a first_rows hint:

select /*+ first_rows */ id, timestamp
from my_table
where timestamp > to_date('20010701','YYYYMMDD'); Received on Sat Jul 14 2001 - 05:38:51 CDT

Original text of this message

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