List:Internals« Previous MessageNext Message »
From:Michael Widenius Date:September 7 2001 12:21am
Subject:Re: ORDER BY ... DESC LIMIT 1 optimization ?
View as plain text  
Hi!

>>>>> "Timothy" == Timothy Smith <tim@stripped> writes:

Timothy> On 2001 Sep 06, Fournier Jocelyn [Presence-PC] <joc@stripped>
> wrote:
>> It doesn't change anything, the query is still slow.

Timothy> OK, I believe that the optimization is not being done because
Timothy> MySQL doesn't realize that the ORDER BY is on the second part
Timothy> of the same key that is used for the WHERE clause.

Timothy> This might not be easy to fix in a general way, but we will
Timothy> look into it.

When doing an ordinary ORDER BY (ASC), MySQL can optimize this case.
It should not be hard to do the same thing when using DESC.

As Tim said, we will look at this shortly.
(I want to first get 4.0 out before looking deeply into this)

Regards,
Monty
Thread
ORDER BY ... DESC LIMIT 1 optimization ?Fournier Jocelyn [Presence-PC]5 Sep
  • Re: ORDER BY ... DESC LIMIT 1 optimization ?Timothy Smith6 Sep
  • Re: ORDER BY ... DESC LIMIT 1 optimization ?Fournier Jocelyn [Presence-PC]6 Sep
  • Re: ORDER BY ... DESC LIMIT 1 optimization ?Fournier Jocelyn [Presence-PC]6 Sep
  • ORDER BY ... DESC LIMIT 1 optimization ?Michael Widenius6 Sep
  • Re: ORDER BY ... DESC LIMIT 1 optimization ?Paul Cadach6 Sep
  • Re: ORDER BY ... DESC LIMIT 1 optimization ?Fournier Jocelyn [Presence-PC]6 Sep
  • Re: ORDER BY ... DESC LIMIT 1 optimization ?Paul Cadach6 Sep
  • Re: ORDER BY ... DESC LIMIT 1 optimization ?Fournier Jocelyn [Presence-PC]6 Sep
    • Re: ORDER BY ... DESC LIMIT 1 optimization ?Timothy Smith6 Sep
      • Re: ORDER BY ... DESC LIMIT 1 optimization ?Michael Widenius6 Sep
      • Re: ORDER BY ... DESC LIMIT 1 optimization ?Michael Widenius16 Jan
  • Re: ORDER BY ... DESC LIMIT 1 optimization ?Paul Cadach6 Sep