MySQL Forums
Forum List  »  Optimizer & Parser

Re: Select last row that is less than or equal to a date
Posted by: Rick James
Date: January 24, 2013 10:27PM

EXPLAIN is estimating, based on statistics it gathered. EXPLAIN does not really take into account the LIMIT clause.

The way to check things is:
SHOW SESSION STATUS LIKE 'Handler%';
SELECT ...
SHOW SESSION STATUS LIKE 'Handler%';
Then look at the differences in various Handler counters.

This is clearly the best index for all of those SELECTs:
index PlayerDate ( HistoryPlayer, HistoryDate )

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Select last row that is less than or equal to a date
2127
January 24, 2013 10:27PM


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.