MySQL Forums
Forum List  »  Optimizer & Parser

select + order by + limit 0,1
Posted by: Markus Doppelbauer
Date: May 11, 2007 01:10AM

Hi,

A big table, with a datetime field "created". I want to know the first record after a given date.

The current query is very slow ("created" has an index):

select * from table where created > '2007-04-01 10:10:10' order by created limit 0,1

Is there a faster way to select the first record after '2007-04-01 10:10:10'?

Thank you very much for your help
Markus Doppelbauer

Options: ReplyQuote


Subject
Views
Written By
Posted
select + order by + limit 0,1
7081
May 11, 2007 01:10AM


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.