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: Using indexes

Re: Using indexes

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Thu, 24 Aug 2006 10:48:21 +0200
Message-ID: <snpqe292cjjtt65218u4a4gp036n602750@4ax.com>


On 24 Aug 2006 01:25:54 -0700, devjnr_at_gmail.com wrote:

>I have sql server backgrounds and I remember that (in a case
>insensitive environment) a query like this:
>
>where car = 'red' also select value like 'RED' or 'Red'
>
>In Oracle I'm seeing that it doesn't work this way.
>
>It can be simple to do something like this:
>
>where lower(car) = 'red'
>
>but I remember that this way in sql server indexes are not used, so a
>table scan is performed.
>
>What is the actual behavior of Oracle?
>
>Thx to all.

The behavior is version dependent.
In Oracle 9i there is no case insensitive sort. In Oracle 10g there is.

Independent of version any clause like
where <function>(<parameter>)=<constant> will NOT use an *ordinary* index.
It will use a Function Based Index, provided you create it first (and use the Cost Based Optimizer, and gather index stats on that index)

--
Sybrand Bakker, Senior Oracle DBA
Received on Thu Aug 24 2006 - 03:48:21 CDT

Original text of this message

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