MySQL Forums
Forum List  »  Performance

Re: Optimizing WHERE computations
Posted by: KimSeong Loh
Date: May 30, 2005 06:52PM

Run an EXPLAIN SELECT * FROM news
WHERE time > SUBDATE(NOW(), INTERVAL 1 DAY);

If you have an index on the time column, MySQL should be able to use it in this SELECT statement, since the SUBDATE(...) will evaluates to a constant.

Options: ReplyQuote


Subject
Views
Written By
Posted
2246
May 30, 2005 11:48AM
Re: Optimizing WHERE computations
1560
May 30, 2005 06:52PM
1626
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.