summaryrefslogtreecommitdiff
path: root/mysql-test/t/group_min_max.test
diff options
context:
space:
mode:
authorunknown <timour@mysql.com>2004-09-10 04:45:15 +0300
committerunknown <timour@mysql.com>2004-09-10 04:45:15 +0300
commit4f1d7b7dae6c8df9f336b0b00429da2f759afdc2 (patch)
tree318c6766b760f52a124018a2ca9492d097590b09 /mysql-test/t/group_min_max.test
parentd9450332927128073e353f11269eba5f0e4ad941 (diff)
downloadmariadb-git-4f1d7b7dae6c8df9f336b0b00429da2f759afdc2.tar.gz
Implementation of the last review comments for WL#1724
"Min/Max Optimization for Queries with Group By Clause" mysql-test/r/group_min_max.result: Added new test mysql-test/t/group_min_max.test: Added new test & comments sql/item.h: Remove processor methods that are no longer used. sql/item_sum.cc: Remove processor methods that are no longer used. sql/item_sum.h: Remove processor methods that are no longer used. sql/opt_range.cc: - the test procedure no longer needs to build lists and to traverse the expression trees - all usable indexes are tested and the bes one is chosen - added/edited function comments sql/sql_select.cc: Modified make_sum_func_list() so it can be reused in the test for MIN/MAX optimization. sql/sql_select.h: Modified make_sum_func_list() so it can be reused in the test for MIN/MAX optimization.
Diffstat (limited to 'mysql-test/t/group_min_max.test')
-rw-r--r--mysql-test/t/group_min_max.test16
1 files changed, 11 insertions, 5 deletions
diff --git a/mysql-test/t/group_min_max.test b/mysql-test/t/group_min_max.test
index 7bc2a4b7d17..34e915b8f6b 100644
--- a/mysql-test/t/group_min_max.test
+++ b/mysql-test/t/group_min_max.test
@@ -3,6 +3,12 @@
# The queries in this file test query execution via QUICK_GROUP_MIN_MAX_SELECT.
#
+#
+# TODO:
+# Add queries with:
+# - C != const
+# - C IS NOT NULL
+# - HAVING clause
--disable_warnings
drop table if exists t1;
@@ -175,8 +181,6 @@ explain select a1, b, min(c), a1, max(c), b, a2, max(c), max(c) from t1 group by
explain select min(a2) from t1 group by a1;
explain select a2, min(c), max(c) from t1 group by a1,a2,b;
--- TODO: Queries with HAVING
-
-- queries
select a1, min(a2) from t1 group by a1;
select a1, max(a2) from t1 group by a1;
@@ -190,8 +194,6 @@ select a1, b, min(c), a1, max(c), b, a2, max(c), max(c) from t1 group by a1, a2,
select min(a2) from t1 group by a1;
select a2, min(c), max(c) from t1 group by a1,a2,b;
--- TODO: Queries with HAVING
-
--
-- Queries with a where clause
--
@@ -300,7 +302,6 @@ select a1,a2,b,min(c) from t2 where b is NULL group by a1,a2;
select a1,a2,b,max(c) from t2 where b is NULL group by a1,a2;
select a1,a2,b,min(c),max(c) from t2 where b is NULL group by a1,a2;
select a1,a2,b,min(c),max(c) from t2 where b is NULL group by a1,a2;
--- TODO: IS NOT NULL ?
-- C) Range predicates for the MIN/MAX attribute
-- plans
@@ -553,6 +554,11 @@ where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (d > 'xy
explain select a1,a2,b,max(c),min(c) from t2 where (a2 = 'a') and (b = 'b') or (b < 'b') group by a1;
explain select a1,a2,b from t1 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (c > 'a111') group by a1,a2,b;
+-- non-group field with an equality predicate that references a keypart after the
+-- MIN/MAX argument
+explain select a1,a2,min(b),c from t2 where (a2 = 'a') and (c = 'a111') group by a1;
+select a1,a2,min(b),c from t2 where (a2 = 'a') and (c = 'a111') group by a1;
+
-- disjunction for a non-group select attribute
explain select a1,a2,b,max(c),min(c) from t2 where (a2 = 'a') and (b = 'b') or (b = 'a') group by a1;