List:General Discussion« Previous MessageNext Message »
From:Donny Simonton Date:September 4 2004 12:59pm
Subject:RE: please explain why this query isn't optimized
View as plain text  
The other simple solution is to do something like this.

Select changed FROM archived_stats order by changed DESC limit 0,1

I haven't actually tried it, it may be just as slow.

If you always know that you have dates in the changed for the past week or
past day, this may be an even better solution for you.

Select changed from archived_stats where changed > DATE_SUB(NOW(), INTERVAL
1 DAY) order by changed DESC limit 0,1

Hope this helps.

Donny

> -----Original Message-----
> From: Dave Dyer [mailto:ddyer@stripped]
> Sent: Saturday, September 04, 2004 2:58 AM
> To: Dan Nelson
> Cc: Donny Simonton; mysql@stripped
> Subject: Re: please explain why this query isn't optimized
> 
> 
> >
> >> Getting the same answer, from a simpler query, in infinitely
> >> less time, just seems wrong to me.
> >
> >Makes perfect sense.  Simpler queries *are* easier to optimize, you
> >know :)
> 
> 
> Makes perfect sense. Thanks, I think the relevant points
> have been covered.
> 



Thread
please explain why this query isn't optimizedDave Dyer4 Sep
  • RE: please explain why this query isn't optimizedDonny Simonton4 Sep
    • Re: please explain why this query isn't optimizedEric Bergen4 Sep
    • RE: please explain why this query isn't optimizedDave Dyer4 Sep
      • Re: please explain why this query isn't optimizedDan Nelson4 Sep
        • Re: please explain why this query isn't optimizedDave Dyer4 Sep
          • RE: please explain why this query isn't optimizedDonny Simonton4 Sep
  • Re: please explain why this query isn't optimizedEgor Egorov6 Sep
Re: please explain why this query isn't optimizedBill Easton6 Sep
  • Re: please explain why this query isn't optimizedDavid T-G7 Sep
    • Re: please explain why this query isn't optimizedEgor Egorov7 Sep
  • Re: please explain why this query isn't optimizedEgor Egorov7 Sep