MySQL Forums
Forum List  »  Performance

Re: optimizing/indexing date column
Posted by: Mark Daly
Date: November 15, 2011 11:56PM

No problem. Case 2 (http://hackmysql.com/case2) has some data that's relevant to you as well.

In your explain, the "Type: All" tells you that a full tablescan is going on, even with the indices. If you don't have time to make it through the cases, the short answer is...

Better:
CREATE INDEX arr_dep ON history (arrival, departure);

Best:
CREATE INDEX arr_dep ON history (arrival, departure, ...the columns in your select statement...);

Options: ReplyQuote


Subject
Views
Written By
Posted
41717
November 15, 2011 10:06PM
18048
November 15, 2011 10:19PM
12837
November 15, 2011 10:30PM
Re: optimizing/indexing date column
11757
November 15, 2011 11:56PM
9767
November 17, 2011 01:46AM
8104
November 17, 2011 10:14PM
6151
November 18, 2011 12:21AM


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.