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) ANDC= nvl(:b3,C) And D=nvl(:b4,D)
|
- Re: index ?? AK
- Re: index ?? Wolfgang Breitling
- Re: index ?? AK
- Re: index ?? Wolfgang Breitling
- Re: index ?? AK