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: Mark Richard <mrichard_at_transurban.com.au>
Date: Thu, 02 Jan 2003 13:23:51 -0800
Message-ID: <F001.005261BA.20030102132351@fatcity.com>


Raj,

If they think that stats need to be collected every day for indexes to work then they obviously don't know much about Oracle... Either that or you have some incredibly volatile tables like a fully refreshed DSS or something. Ideally you should ask the developers which tables should be analyzed and how often. They should understand the movement of data although it sounds like they might not understand Oracle enough anyway. At least they have you looking out for them.

Regards,

     Mark.

PS: Since the column is being added to an existing table remember that you will have to update existing rows as well as adding the default clause.

                                                                                                                        
                    "Jamadagni,                                                                                         
                    Rajendra"                 To:     Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com>       
                    <Rajendra.Jamadagni       cc:                                                                       
                    @espn.com>                Subject:     RE: NVL and index usage                                      
                    Sent by:                                                                                            
                    root_at_fatcity.com                                                                                    
                                                                                                                        
                                                                                                                        
                    03/01/2003 06:11                                                                                    
                    Please respond to                                                                                   
                    ORACLE-L                                                                                            
                                                                                                                        
                                                                                                                        




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 (See attached file: ESPN_Disclaimer.txt)

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<---->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

   Privileged/Confidential information may be contained in this message.

          If you are not the addressee indicated in this message
       (or responsible for delivery of the message to such person),
            you may not copy or deliver this message to anyone.
In such case, you should destroy this message and kindly notify the sender
           by reply e-mail or by telephone on (61 3) 9612-6999.
   Please advise immediately if you or your employer does not consent to
                Internet e-mail for messages of this kind.
        Opinions, conclusions and other information in this message
              that do not relate to the official business of
                         Transurban City Link Ltd
         shall be understood as neither given nor endorsed by it.
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<---->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Mark Richard
  INET: mrichard_at_transurban.com.au

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 - 15:23:51 CST

Original text of this message

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