mariadb/storage/tokudb/mysql-test/tokudb_bugs/r/3083.result
Sergei Golubchik 642aa4366d clustering == covering
tell the optimizer that every TokuDB "clustering" index is the "covering" index
in the MariaDB optimizer sense.
2013-09-09 14:00:06 +02:00

23 lines
1.1 KiB
Text

SET DEFAULT_STORAGE_ENGINE = 'tokudb';
DROP TABLE IF EXISTS foo;
set session tokudb_prelock_empty=0;
create table foo (a int, b int, c int, primary key (a), key (b) clustering=yes);
insert into foo values (1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5);
# Both explains should use primary key;
explain select * from foo;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo index NULL b 5 NULL 5 Using index
explain select a from foo;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo index NULL PRIMARY 4 NULL 5 Using index
DROP table foo;
create table foo (a int, b int, c int, key (b) clustering=yes, primary key (a));
insert into foo values (1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5);
# Both explains should use primary key;
explain select * from foo;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo index NULL b 5 NULL 5 Using index
explain select a from foo;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo index NULL PRIMARY 4 NULL 5 Using index
DROP TABLE foo;