MySQL Forums
Forum List  »  Optimizer & Parser

Re: Not using index optimal
Posted by: Jørgen Løland
Date: May 15, 2011 01:57PM

Hi Per,

You are right to be suspicions about this. Unfortunately, the EXPLAIN output is wrong for this query. MySQL does as you want it to, i.e., it reads 100 rows, returns them and nothing more.

"Using where" means that MySQL matches the content in the index with the conditions you provided. Take a look here for more info: http://dev.mysql.com/doc/refman/5.5/en/explain-output.html

But why do you have a table with 25000 rows in which all rows have the same values for column a and b? And if that's strictly necessary: why do you have "a=... AND b=..." in the query when you know that all rows will match this condition?

Hope this helps,
Jørgen Løland
Software Engineer, MySQL, Oracle
jorgenloland.blogspot.com

Options: ReplyQuote


Subject
Views
Written By
Posted
4054
May 14, 2011 01:02PM
1101
May 14, 2011 01:33PM
Re: Not using index optimal
1235
May 15, 2011 01:57PM
1136
May 16, 2011 03:23AM
1238
May 16, 2011 06:41AM
1125
May 15, 2011 11:25PM
1091
May 16, 2011 03:18AM


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.