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

Home -> Community -> Mailing Lists -> Oracle-L -> index ??

index ??

From: AK <oramagic_at_hotmail.com>
Date: Mon, 31 Mar 2003 09:08:38 -0800
Message-ID: <F001.00576585.20030331090838@fatcity.com>


I have a table X with unix index on column A ,B and non unique index on A,C,D . The query give below doesn't use any index .

I thought its due to function nvl being used here , so made a change in query to replace

B = NVL(:b2,B) with (B=:b2 or :b2 is null ) , but this one also not using index . Why if I put an or condition it doesn't use index while if I put and condition it will used ?

IS there any way I can change query or index so that it starts using index ( in a better way )

Thanks,

-ak

SELECT z

FROM X

WHERE A = :b1 AND

B = NVL(:b2,B) AND

C= nvl(:b3,C) And

D=nvl(:b4,D)

--

Please see the official ORACLE-L FAQ: http://www.orafaq.net
--

Author: AK
  INET: oramagic_at_hotmail.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 Mon Mar 31 2003 - 11:08:38 CST

Original text of this message

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