Why does not the mysql developer team to do this optimization? --- 12年4月20日,周五, Reindl Harald <h.rei...@thelounge.net> 写道:
> 发件人: Reindl Harald <h.rei...@thelounge.net> > 主题: Re: Why does the limit use the early row lookup. > 收件人: mysql@lists.mysql.com > 日期: 2012年4月20日,周五,下午3:50 > > > Am 20.04.2012 04:29, schrieb 张志刚: > > My point is that the limit can use late row lookup: > lookup rows after > > checking indexes to optimize the select speed. > > > > But the mysql optimizer do it with the early row > lookup: lookup all rows > > before checking indexes when the one fetch column is > not in the indexes. > > > > Tell me why? > > 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 :-) > > -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql