summaryrefslogtreecommitdiff
path: root/mysql-test/r/distinct.result
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/r/distinct.result')
-rw-r--r--mysql-test/r/distinct.result24
1 files changed, 24 insertions, 0 deletions
diff --git a/mysql-test/r/distinct.result b/mysql-test/r/distinct.result
index fec5ece8ddf..809eb22f987 100644
--- a/mysql-test/r/distinct.result
+++ b/mysql-test/r/distinct.result
@@ -198,6 +198,30 @@ a
select distinct 1 from t1,t3 where t1.a=t3.a;
1
1
+explain SELECT distinct t1.a from t1;
+table type possible_keys key key_len ref rows Extra
+t1 index NULL PRIMARY 4 NULL 2 Using index
+explain SELECT distinct t1.a from t1 order by a desc;
+table type possible_keys key key_len ref rows Extra
+t1 index NULL PRIMARY 4 NULL 2 Using index
+explain SELECT t1.a from t1 group by a order by a desc;
+table type possible_keys key key_len ref rows Extra
+t1 index NULL PRIMARY 4 NULL 2 Using index
+explain SELECT distinct t1.a from t1 order by a desc limit 1;
+table type possible_keys key key_len ref rows Extra
+t1 index NULL PRIMARY 4 NULL 2 Using index
+explain SELECT distinct a from t3 order by a desc limit 2;
+table type possible_keys key key_len ref rows Extra
+t3 index NULL a 5 NULL 204 Using index
+explain SELECT distinct a,b from t3 order by a+1;
+table type possible_keys key key_len ref rows Extra
+t3 ALL NULL NULL NULL NULL 204 Using temporary; Using filesort
+explain SELECT distinct a,b from t3 order by a limit 10;
+table type possible_keys key key_len ref rows Extra
+t3 index NULL a 5 NULL 204 Using temporary
+explain SELECT a,b from t3 group by a,b order by a+1;
+table type possible_keys key key_len ref rows Extra
+t3 ALL NULL NULL NULL NULL 204 Using temporary; Using filesort
drop table t1,t2,t3,t4;
CREATE TABLE t1 (name varchar(255));
INSERT INTO t1 VALUES ('aa'),('ab'),('ac'),('ad'),('ae');