Title: NVL and index usage
Raj,
 
the index will not be used.
 
think about it. 
 
for those records that do not have a value (are null) for the indexed column - there is not an entry in the index - so they can not be evaluated to return a row.
 
secondly, even if all rows were represented in the index - why perform two queries - one for the index, and then one for the table - to evaluate whether to use the row in the query?
 
either way, it would not work properly.
 
that's why Oracle gave us function based indexes - so that we could use a function and get fast results from a large table.
 
hope this helps.
 

Tom Mercadante
Oracle Certified Professional

-----Original Message-----
From: Shaleen [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 02, 2003 1:22 PM
To: Multiple recipients of list ORACLE-L
Subject: Re: NVL and index usage

In a quick test on 9013 it changed the index which it was using and went from Range scan to fast full scan.
 
----- Original Message -----
Sent: Thursday, January 02, 2003 9:48 AM
Subject: NVL and index usage

Does anyone know off hand if using NVL on an indexed column negate use of an index in CBO? This is 9202 ... and the column will be a varchar2(1).

Raj
______________________________________________________
Rajendra Jamadagni              MIS, ESPN Inc.
Rajendra dot Jamadagni at ESPN dot com
Any opinion expressed here is personal and doesn't reflect that of ESPN Inc.
QOTD: Any clod can have facts, but having an opinion is an art!

Reply via email to