MySQL Forums
Forum List  »  Optimizer & Parser

Re: Query taking a lot of time if there is no record in table
Posted by: Rick James
Date: May 04, 2009 07:19PM

The way to get that to use the index is slightly complicated:
  AND RATE_TIME >= ?
  AND RATE_TIME <  DATE_ADD(?, INTERVAL 1 DAY)
Substitute the date (eg, '2008-11-01') for both the '?'.
The inequalities are designed to correctly handle midnight.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Query taking a lot of time if there is no record in table
2317
May 04, 2009 07:19PM


Sorry, you can't reply to this topic. It has been closed.
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.

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.