MySQL Forums
Forum List  »  UDF

Re: I need an alternative to make an index work
Posted by: Adnan Raza
Date: September 12, 2012 11:06PM

I have found a solution for above problem to keep the index working with similar condition of ifnull.



explain select * from temp_table
where
(dt1 > '2012-01-01')
or
(dt1 is null and dt2 > '2012-01-01');

and now it will only check from dt2 when dt1 is null and that is what I was trying to do by using ifnull.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: I need an alternative to make an index work
1789
September 12, 2012 11:06PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.