Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: NVL and index usage

RE: NVL and index usage

From: Jamadagni, Rajendra <Rajendra.Jamadagni_at_espn.com>
Date: Thu, 02 Jan 2003 11:11:14 -0800
Message-ID: <F001.00525EC9.20030102111114@fatcity.com>


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-----
Sent: Thursday, January 02, 2003 1:51 PM To: Multiple recipients of list ORACLE-L

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


-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Jamadagni, Rajendra
  INET: Rajendra.Jamadagni_at_espn.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Received on Thu Jan 02 2003 - 13:11:14 CST

Original text of this message

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