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
4042
May 14, 2011 01:02PM
1092
May 14, 2011 01:33PM
Re: Not using index optimal
1226
May 15, 2011 01:57PM
1127
May 16, 2011 03:23AM
1230
May 16, 2011 06:41AM
1119
May 15, 2011 11:25PM
1086
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.