MySQL Forums
Forum List  »  Performance

Re: Optimizing WHERE computations
Posted by: KimSeong Loh
Date: May 31, 2005 07:19PM

This should be simlpe enough

SELECT id FROM foo
WHERE dt >= CURDATE() AND dt < CURDATE() + interval 1 day

Make sure the left hand side of the comparison conatain only the fieldname, dt, if you use a function, like date(dt), the index cannot be used anymore, as shown in the previous example by Felix

Options: ReplyQuote


Subject
Views
Written By
Posted
2234
May 30, 2005 11:48AM
Re: Optimizing WHERE computations
1851
May 31, 2005 07:19PM
1620
June 02, 2005 06:41PM


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.