mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug25602 sql/sql_select.cc: Auto merged
This commit is contained in:
@ -2286,3 +2286,24 @@ Variable_name Value
|
||||
Handler_read_key 8
|
||||
Handler_read_next 1
|
||||
DROP TABLE t1,t2,t3;
|
||||
CREATE TABLE t1 (a int, INDEX idx(a));
|
||||
INSERT INTO t1 VALUES
|
||||
(4), (2), (1), (2), (4), (2), (1), (4),
|
||||
(4), (2), (1), (2), (2), (4), (1), (4);
|
||||
EXPLAIN SELECT DISTINCT(a) FROM t1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range NULL idx 5 NULL 9 Using index for group-by
|
||||
SELECT DISTINCT(a) FROM t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
4
|
||||
EXPLAIN SELECT SQL_BIG_RESULT DISTINCT(a) FROM t1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range NULL idx 5 NULL 9 Using index for group-by
|
||||
SELECT SQL_BIG_RESULT DISTINCT(a) FROM t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
4
|
||||
DROP TABLE t1;
|
||||
|
@ -870,3 +870,25 @@ DELETE FROM t3 WHERE (SELECT (SELECT MAX(b) FROM t1 GROUP BY a HAVING a < 2) x
|
||||
SHOW STATUS LIKE 'handler_read__e%';
|
||||
|
||||
DROP TABLE t1,t2,t3;
|
||||
|
||||
#
|
||||
# Bug#25602: queries with DISTINCT and SQL_BIG_RESULT hint
|
||||
# for which loose scan optimization is applied
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (a int, INDEX idx(a));
|
||||
INSERT INTO t1 VALUES
|
||||
(4), (2), (1), (2), (4), (2), (1), (4),
|
||||
(4), (2), (1), (2), (2), (4), (1), (4);
|
||||
|
||||
EXPLAIN SELECT DISTINCT(a) FROM t1;
|
||||
SELECT DISTINCT(a) FROM t1;
|
||||
EXPLAIN SELECT SQL_BIG_RESULT DISTINCT(a) FROM t1;
|
||||
SELECT SQL_BIG_RESULT DISTINCT(a) FROM t1;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user