List:General Discussion« Previous MessageNext Message »
From:shawn green Date:April 23 2012 12:51pm
Subject:Re: Why does the limit use the early row lookup.
View as plain text  
On 4/22/2012 11:18 PM, Zhangzhigang wrote:
> Why does not the mysql developer team to do this optimization?
> 
> --- 12年4月20日,周五, Reindl Harald<h.reindl@stripped>  写道:
> 
>> ...
>>
>> because the mysql optimizer until now is really
>> bad in many situations - order by rand() makes a
>> temporary table wil ALL data as example even with limit
>>
>> select * from table order by rand() limit 10;
>> reads and writes the whole table to disk
>> have fun with large tables :-)
>>
>>
> 

When the Optimizer is told to sort a result set in the order determined
by a random value created only at the time of the query, what better
technique could they use than to materialize the table, sort the data,
then return the results?

If you can think of a better way of sorting random numbers, please tell
us. MySQL has and still does accept solutions from the community. I do
admit that at times in our past we have been very slow about processing
those submissions but recently we have made great improvements in how we
handle those.

Also, we have made significant strides in improving our Optimizer in 5.5
and more improvements will be coming in 5.6.  Please check out our newer
versions to see if we have solved or improved any particular scalability
problems you may be having.

Regards,
-- 
Shawn Green
MySQL Principal Technical Support Engineer
Oracle USA, Inc. - Hardware and Software, Engineered to Work Together.
Office: Blountville, TN
Thread
Why does the limit use the early row lookup.张志刚20 Apr
  • Re: Why does the limit use the early row lookup.Reindl Harald20 Apr
    • RE: Why does the limit use the early row lookup.Rick James20 Apr
      • Re: Why does the limit use the early row lookup.Reindl Harald20 Apr
    • Re: Why does the limit use the early row lookup.Zhangzhigang23 Apr
      • Re: Why does the limit use the early row lookup.shawn green23 Apr
        • RE: Why does the limit use the early row lookup.Rick James23 Apr
  • RE: Why does the limit use the early row lookup.Rick James23 Apr
    • RE: Why does the limit use the early row lookup.Zhangzhigang24 Apr
      • RE: Why does the limit use the early row lookup.Rick James24 Apr
Re: Why does the limit use the early row lookup.Jan Steinman25 Apr