Thanks Tor, Looks good. Approved.
See below for one question:
On 12/10/2010 04:00 PM, Tor Didriksen wrote:
> #At file:///export/home/didrik/repo/next-mr-opt-team-wl1393-merge/ based on
> revid:tor.didriksen@stripped
>
> 3258 Tor Didriksen 2010-12-10
> Bug #58782 Missing rows with SELECT .. WHERE .. IN subquery with full GROUP BY
> and no aggr
>
> The missing results were caused by a 'group by' which was transformed to an
> 'order by'.
> @ mysql-test/r/explain.result
> New explain result, the group by can be eliminated.
> @ mysql-test/r/group_by.result
> New test case.
> @ mysql-test/r/myisam_mrr.result
> New explain result, the group by can be eliminated.
> @ mysql-test/r/myisam_mrr_cost.result
> New explain result, the group by can be eliminated.
> @ mysql-test/r/myisam_mrr_cost_icp.result
> New explain result, the group by can be eliminated.
> @ mysql-test/r/myisam_mrr_icp.result
> New explain result, the group by can be eliminated.
> @ mysql-test/r/myisam_mrr_none.result
> New explain result, the group by can be eliminated.
> @ mysql-test/r/order_by_icp_mrr.result
> New (correct) result.
> @ mysql-test/r/order_by_none.result
> New (correct) result.
> @ mysql-test/t/group_by.test
> New test case.
> @ sql/sql_select.cc
> If the query as a GROUP BY, which can be converted to an ORDER BY,
> we can eliminate it for subqueries.
...
> === modified file 'mysql-test/r/myisam_mrr_cost_icp.result'
> --- a/mysql-test/r/myisam_mrr_cost_icp.result 2010-12-06 13:10:10 +0000
> +++ b/mysql-test/r/myisam_mrr_cost_icp.result 2010-12-10 15:00:25 +0000
> @@ -347,7 +347,7 @@ GROUP BY t2.pk
> );
> id select_type table type possible_keys key key_len ref rows filtered Extra
> 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
> -2 SUBQUERY t2 ref int_key int_key 5 const 1 100.00 Using index condition; Using
> where; Using filesort
> +2 SUBQUERY t2 ref int_key int_key 5 const 1 100.00 Using index condition
> Warnings:
> Note 1003 select min(`test`.`t1`.`pk`) AS `MIN(t1.pk)` from `test`.`t1` where 0
> DROP TABLE t1, t2;
For this query, if I replace GROUP BY with ORDER BY, "Using filesort" is
still there. Is that a reason for concern?
--
Øystein