Dave Dyer <[EMAIL PROTECTED]> wrote:

> Before I post it as a bug, perhaps someone can explain why
> this query is not optimized to use the index (it has to examine all 287k rows).
> 
> mysql> explain SELECT MAX(changed) FROM archived_stats where changed>0;
> | table          | type  | possible_keys | key     | key_len | ref  | rows    | 
> Extra                    |
> | archived_stats | range | changed       | changed |       4 | NULL | 2878820 | 
> Using where; Using index |

There are 2.878k rows, not 287k. 

And it's optimized as much as possible, the key is used. 





-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to