MySQL Forums
Forum List  »  Optimizer & Parser

Re: help~the statement don't use index
Posted by: Øystein Grøvlen
Date: November 08, 2011 09:31AM

If MySQL uses the index to execute this query, it will have to do look-ups into the table for every row where StartDate is within the specified dates. If the Optimizer estimates that there will be very many rows within those dates, it will use a table scan instead. This is because, at least in a traditional disk-bound database, sequential access is much cheaper than random look-ups.

If you create an index (StartDate, Result, RoundSerial), the query could be executed without table look-ups since all relevant columns will be part of the query.

Øystein Grøvlen,
Senior Principal Software Engineer,
MySQL Group, Oracle,
Trondheim, Norway

Options: ReplyQuote

Written By
November 08, 2011 01:54AM
Re: help~the statement don't use index
November 08, 2011 09:31AM
November 08, 2011 09:11PM

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.