diff options
author | unknown <timour@mysql.com> | 2004-08-27 16:37:13 +0300 |
---|---|---|
committer | unknown <timour@mysql.com> | 2004-08-27 16:37:13 +0300 |
commit | d9450332927128073e353f11269eba5f0e4ad941 (patch) | |
tree | 7af5a09192d2042b9d236d1b98634b8b14be9601 /mysql-test/r/distinct.result | |
parent | 7bba8128ed65a5d841679fceb8c6c8dd5cac008c (diff) | |
download | mariadb-git-d9450332927128073e353f11269eba5f0e4ad941.tar.gz |
WL#1724 "Min/Max Optimization for Queries with Group By Clause"
- after-review changes
- merged with the source tree from 204-08-27
mysql-test/r/distinct.result:
Different plans due to group-by optimization.
sql/ha_myisam.cc:
More general interface to key_copy.
sql/handler.cc:
More general interface to key_copy.
sql/item.cc:
New method to collect all Item_field objects. Used by Item::walk.
sql/item.h:
Several methods to collect different kinds of items from expression trees.
Used by Item::walk.
sql/item_sum.cc:
Added helper to collect Item_sum objects.
sql/item_sum.h:
Methods to collect and test Item_sum objects.
sql/key.cc:
More general interface to key_copy and key_restore.
sql/mysql_priv.h:
More general interface to key_copy and key_restore.
sql/opt_range.cc:
Complete implementaion of WL#1724 "Min/Max Optimization for Queries with Group By Clause".
sql/opt_range.h:
Complete implementaion of WL#1724 "Min/Max Optimization for Queries with Group By Clause".
sql/opt_sum.cc:
simple_pred is re-used in opt_range.cc
sql/sql_acl.cc:
More general interface to key_copy and key_restore.
sql/sql_handler.cc:
More general interface to key_copy.
sql/sql_insert.cc:
More general interface to key_copy.
sql/sql_select.cc:
Changes to hook the new QUICK_GROUP_MIN_MAX_SELECT due to two differences from all other
quick selects:
1)
This quick select may be created (and used) even if there is no WHERE clause.
Several places assumed that a QUICK_SELECT is constructed only if there is a WHERE clause,
which had to be changed so that QUICK_GROUP_MIN_MAX can be used.
2)
Unlike all other quick selects, this QUICK_GROUP_MIN_MAX_SELECT operates for GROUP BY queries.
Since for the caller the quick select already produces one result tuple per group, there is
no need to call end_send_group, instead we have to call end_send as for a regular quick select.
sql/sql_select.h:
simple_pred is re-used in opt_range.cc
Diffstat (limited to 'mysql-test/r/distinct.result')
-rw-r--r-- | mysql-test/r/distinct.result | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/mysql-test/r/distinct.result b/mysql-test/r/distinct.result index 290cb9361f1..3d0252b7cd8 100644 --- a/mysql-test/r/distinct.result +++ b/mysql-test/r/distinct.result @@ -200,19 +200,19 @@ select distinct 1 from t1,t3 where t1.a=t3.a; 1 explain SELECT distinct t1.a from t1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index NULL PRIMARY 4 NULL 4 Using index +1 SIMPLE t1 range NULL PRIMARY 4 NULL 5 Using index for group-by explain SELECT distinct t1.a from t1 order by a desc; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index NULL PRIMARY 4 NULL 4 Using index +1 SIMPLE t1 range NULL PRIMARY 4 NULL 5 Using index for group-by; Using temporary; Using filesort explain SELECT t1.a from t1 group by a order by a desc; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index NULL PRIMARY 4 NULL 4 Using index +1 SIMPLE t1 range NULL PRIMARY 4 NULL 5 Using index for group-by; Using temporary; Using filesort explain SELECT distinct t1.a from t1 order by a desc limit 1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index NULL PRIMARY 4 NULL 4 Using index +1 SIMPLE t1 index NULL PRIMARY 4 NULL 5 Using index explain SELECT distinct a from t3 order by a desc limit 2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t3 index NULL a 5 NULL 204 Using index +1 SIMPLE t3 index NULL a 5 NULL 10 Using index explain SELECT distinct a,b from t3 order by a+1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t3 ALL NULL NULL NULL NULL 204 Using temporary; Using filesort |