diff options
author | unknown <timour@askmonty.org> | 2013-08-21 10:51:08 +0300 |
---|---|---|
committer | unknown <timour@askmonty.org> | 2013-08-21 10:51:08 +0300 |
commit | 33c66eb7fbcddb09217820708e8ce9324e65db11 (patch) | |
tree | d47664559ef685ddf59455191e4859959cd4581e /mysql-test/r/distinct.result | |
parent | 3c75146052711bcc829ede488536f70782a34ab0 (diff) | |
download | mariadb-git-33c66eb7fbcddb09217820708e8ce9324e65db11.tar.gz |
MDEV-4120: UNIQUE indexes should not be considered for loose index scan
Currently the loose scan code in opt_range.cc considers all indexes as
possible for the access method. Due to inexact statistics it may happen
that a loose scan is selected over a unique index.
This is clearly wrong since a "loose scan" over a unique index will read
the same keys as a direct index scan, but the loose scan has more overhead.
This task adds a rule to skip unique indexes for loose scan.
Diffstat (limited to 'mysql-test/r/distinct.result')
-rw-r--r-- | mysql-test/r/distinct.result | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mysql-test/r/distinct.result b/mysql-test/r/distinct.result index 459ece978fd..d23a6706e04 100644 --- a/mysql-test/r/distinct.result +++ b/mysql-test/r/distinct.result @@ -756,7 +756,7 @@ INSERT INTO t1(a, b, c) VALUES (1, 1, 1), (1, 2, 3); EXPLAIN SELECT DISTINCT a, b, d, c FROM t1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range NULL PRIMARY 16 NULL 7 Using index for group-by; Using temporary +1 SIMPLE t1 range NULL a 16 NULL 7 Using index for group-by SELECT DISTINCT a, b, d, c FROM t1; a b d c 1 1 0 1 |