| List: | General Discussion | « Previous MessageNext Message » | |
| From: | Egor Egorov | Date: | September 6 2004 10:02am |
| Subject: | Re: please explain why this query isn't optimized | ||
| View as plain text | |||
Dave Dyer <ddyer@stripped> 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 / /|_/ / // /\ \/ /_/ / /__ Egor.Egorov@stripped /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net <___/ www.mysql.com
| Thread | ||
|---|---|---|
| • please explain why this query isn't optimized | Dave Dyer | 4 Sep |
| • RE: please explain why this query isn't optimized | Donny Simonton | 4 Sep |
| • Re: please explain why this query isn't optimized | Eric Bergen | 4 Sep |
| • RE: please explain why this query isn't optimized | Dave Dyer | 4 Sep |
| • Re: please explain why this query isn't optimized | Dan Nelson | 4 Sep |
| • Re: please explain why this query isn't optimized | Dave Dyer | 4 Sep |
| • RE: please explain why this query isn't optimized | Donny Simonton | 4 Sep |
| • Re: please explain why this query isn't optimized | Egor Egorov | 6 Sep |
| • Re: please explain why this query isn't optimized | Bill Easton | 6 Sep |
| • Re: please explain why this query isn't optimized | David T-G | 7 Sep |
| • Re: please explain why this query isn't optimized | Egor Egorov | 7 Sep |
| • Re: please explain why this query isn't optimized | Egor Egorov | 7 Sep |
