List:General Discussion« Previous MessageNext Message »
From:Michael Stassen Date:October 24 2005 3:50am
Subject:Re: implicit cast forces table scan?
View as plain text  
Gleb Paharenko wrote:
> Dear, Michael!
> 
>>Did you read my earlier reply?  This is neither an optimizer nor > >
>>version issue.
> 
> I've sent my e-mail before I've read your. The problem is that I was
> testing my guessing on the table with a bit different structure than
> your (mine didn't have a primary key field 'id'). And optimizer has
> shown that it uses indexes! There is a verified bug:
> 
>   http://bugs.mysql.com/?id=14220
> 
> Thank you for good explanations!

I've added a comment to bug 14220 explaining why I do not believe this is a bug. 
  The short version is that without the id column, "SELECT *" is the same as 
"SELECT vcf".  In that case, the index on vcf is a covering index, so mysql 
reads the data from the index, rather than the table.  You will note in the 
EXPLAIN output that it is still doing a full scan.  It's just that it's a full 
index scan rather than a full table scan.

Michael
Thread
implicit cast forces table scan?Olaf Faaland19 Oct
  • Re: implicit cast forces table scan?Jeff Smelser19 Oct
  • Re: implicit cast forces table scan?Michael Stassen21 Oct
  • Re: implicit cast forces table scan?Gleb Paharenko21 Oct
    • Re: implicit cast forces table scan?Michael Stassen21 Oct
      • Re: implicit cast forces table scan?Gleb Paharenko23 Oct
        • Re: implicit cast forces table scan?Michael Stassen24 Oct
RE: implicit cast forces table scan?Olaf Faaland21 Oct