Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: index fast full scan vs index range scan
Please ignore this message if this is a duplicate. I sent this
immediately right after posting my message, but didnt make it i guess.
>>
Sorry...i just realized that i missed some relevant information.
Environment: 9.2.0.1, Solaris 8. i am using the default values for the init parameters, nothing really changed.
This table has got 1 million rows. The query in question uses a couple of other tables. It returns ~100 rows for a given value from this table. >>
Senthil Ramanujam wrote:
>
> List,
>
> I may need a little help here understanding Oracle optimization. How
> will the following code be treated in Oracle optimizer?
>
> table has a column called "code". code is (not null) varchar2(24). it
> has a regular index on this column. :b1 would have any valid value.
>
> * exec :b1 := 'xxx';
> ...
> select ... from ... where code like :b1 || '%'*
>
> the above code lets the optimizer to choose "index fast full scan".
> but changing the code slightly as given below:
>
> * exec :b1 := 'xxx' || '%';
> ...
> select ... from ... where code like :b1*
>
> lets the optimizer to choose "index range scan". obviously, the second
> method runs much faster.
>
> Any thoughts or inputs are much appreciated.
>
> thanks.
>
> senthil
> ----------------------------------------------------------------
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> ----------------------------------------------------------------
> To unsubscribe send email to: oracle-l-request_at_freelists.org
> put 'unsubscribe' in the subject line.
> --
> Archives are at http://www.freelists.org/archives/oracle-l/
> FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
> -----------------------------------------------------------------
>
-- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html -----------------------------------------------------------------Received on Sun Mar 21 2004 - 20:28:44 CST
![]() |
![]() |