List:General Discussion« Previous MessageNext Message »
From:Baron Schwartz Date:March 12 2009 9:32pm
Subject:Re: Query from HPM book to limit rows scanned doesn't appear to work
as described
View as plain text  
>> But EXPLAIN is only a prediction.  If you look at the changes in the
>> Handler status variables, you'll see the second one reads fewer rows.
>>
>>
>
> Ok, I think I get it.  I first changed both of my queries to add
> "sql_no_cache" because without that, the Handler_read_rnd_next variable was
> zero in both cases.
>
> Before running each query, I ran "flush status", then the query, then "show
> session status like 'Handler%'".  The first one had a value of 207 for
> "Handler_read_rnd_next" and the second one had a value of 1.

Yes, that's it exactly.  The LIMIT stops the work as soon as you find
the first row.
Thread
Query from HPM book to limit rows scanned doesn't appear to workas describedDavid M. Karr12 Mar
  • Re: Query from HPM book to limit rows scanned doesn't appear to work as describedBaron Schwartz12 Mar
    • Re: Query from HPM book to limit rows scanned doesn't appear to workas describedDavid M. Karr12 Mar
      • Re: Query from HPM book to limit rows scanned doesn't appear to work as describedBaron Schwartz12 Mar