Title: RE: NVL and index usage

Thanks Tom and everyone ...

as I mentioned they plan to use it as follows ...

and nvl(new_column,'A') = nvl(some_value,'A')

So I asked them to see the possibility of creating the column with a DEFAULT VALUE of 'A' so the where clause can be written as

and new_column = nvl(some_value, 'A')

which I think is better and based on all your input, I am sure it will be. Finally it will be their call. When apps stop using indexes, they will call us though (with the standard question 'Did we run stats collection today?')

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!

-----Original Message-----
From: Mercadante, Thomas F [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 02, 2003 1:51 PM
To: Multiple recipients of list ORACLE-L
Subject: RE: 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

********************************************************************This e-mail 
message is confidential, intended only for the named recipient(s) above and may 
contain information that is privileged, attorney work product or exempt from 
disclosure under applicable law. If you have received this message in error, or are 
not the named recipient(s), please immediately notify corporate MIS at (860) 766-2000 
and delete this e-mail message from your computer, Thank 
you.*********************************************************************2


Reply via email to