List:Internals« Previous MessageNext Message »
From:Michael Widenius Date:January 16 2002 2:06am
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.

Just a note about this; There is a chance that MySQL 4.0.2 will fix
that (I just pushed code that fixes some ORDER BY ... DESC
optimizations)


Regards,
Monty

-- 
For technical support contracts, goto https://order.mysql.com/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Mr. Michael Widenius <monty@stripped>
 / /|_/ / // /\ \/ /_/ / /__   MySQL AB, CTO
/_/  /_/\_, /___/\___\_\___/   Helsinki, Finland
       <___/   www.mysql.com
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