Re: Query from HPM book to limit rows scanned doesn't appear to work as described

2009-03-12 Thread Baron Schwartz
>> 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 >

Re: Query from HPM book to limit rows scanned doesn't appear to work as described

2009-03-12 Thread David M. Karr
Baron Schwartz wrote: Hi! On Wed, Mar 11, 2009 at 8:20 PM, David M. Karr wrote: Using 5.0.67-0ubuntu6 on Ubuntu 8.10. I'm going through the "High Performance MySQL" book. I was reading section 4.4.1.8, titled "MIN() and MAX()". The point of this is that MySQL doesn't optimize MIN()/MAX()

Re: Query from HPM book to limit rows scanned doesn't appear to work as described

2009-03-11 Thread Baron Schwartz
Hi! On Wed, Mar 11, 2009 at 8:20 PM, David M. Karr wrote: > Using 5.0.67-0ubuntu6 on Ubuntu 8.10. > > I'm going through the "High Performance MySQL" book.  I was reading section > 4.4.1.8, titled "MIN() and MAX()".  The point of this is that MySQL doesn't > optimize MIN()/MAX() very well, but it

Query from HPM book to limit rows scanned doesn't appear to work as described

2009-03-11 Thread David M. Karr
Using 5.0.67-0ubuntu6 on Ubuntu 8.10. I'm going through the "High Performance MySQL" book. I was reading section 4.4.1.8, titled "MIN() and MAX()". The point of this is that MySQL doesn't optimize MIN()/MAX() very well, but it showed a supposed workaround for this. The first sample query w