From 642aa4366d5f14f2256da9a087f5b392a53adb61 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 9 Sep 2013 14:00:06 +0200 Subject: [PATCH] clustering == covering tell the optimizer that every TokuDB "clustering" index is the "covering" index in the MariaDB optimizer sense. --- storage/tokudb/ha_tokudb.cc | 8 +++++ .../mysql-test/tokudb/r/cluster_1829.result | 4 +-- .../mysql-test/tokudb/r/cluster_2968-0.result | 4 +-- .../mysql-test/tokudb/r/cluster_2968-1.result | 12 +++---- .../mysql-test/tokudb/r/cluster_2968-2.result | 4 +-- .../mysql-test/tokudb/r/cluster_2968-3.result | 6 ++-- .../mysql-test/tokudb/r/cluster_delete.result | 12 +++---- .../tokudb/r/cluster_delete2.result | 24 ++++++------- .../mysql-test/tokudb/r/cluster_filter.result | 22 ++++++------ .../tokudb/r/cluster_filter_hidden.result | 24 ++++++------- .../r/cluster_filter_unpack_varchar.result | 22 ++++++------ ...ilter_unpack_varchar_and_int_hidden.result | 24 ++++++------- ...luster_filter_unpack_varchar_hidden.result | 24 ++++++------- .../mysql-test/tokudb/r/cluster_key.result | 8 ++--- .../tokudb/r/cluster_query_plan.result | 4 +-- .../mysql-test/tokudb/r/cluster_update.result | 20 +++++------ .../tokudb/r/cluster_update2.result | 36 +++++++++---------- .../r/hcad_with_lock_sps.result | 28 +++++++-------- .../tokudb_alter_table/r/hcr3.result | 4 +-- .../mysql-test/tokudb_bugs/r/1684.result | 2 +- .../mysql-test/tokudb_bugs/r/1711.result | 2 +- .../mysql-test/tokudb_bugs/r/2458.result | 4 +-- .../mysql-test/tokudb_bugs/r/2548.result | 8 ++--- .../mysql-test/tokudb_bugs/r/3015.result | 24 ++++++------- .../mysql-test/tokudb_bugs/r/3083.result | 4 +-- .../tokudb_bugs/r/bulk_fetch.result | 2 +- .../tokudb_bugs/r/index_read.result | 12 +++---- .../tokudb_mariadb/r/clustering.result | 2 +- 28 files changed, 179 insertions(+), 171 deletions(-) diff --git a/storage/tokudb/ha_tokudb.cc b/storage/tokudb/ha_tokudb.cc index f7efe22ea9d..37d520ead39 100644 --- a/storage/tokudb/ha_tokudb.cc +++ b/storage/tokudb/ha_tokudb.cc @@ -4612,6 +4612,9 @@ int ha_tokudb::index_init(uint keynr, bool sorted) { keynr = primary_key; } tokudb_active_index = keynr; + + if (keynr < table->s->keys && table->key_info[keynr].option_struct->clustering) + key_read = false; last_cursor_error = 0; range_lock_grabbed = false; @@ -5937,6 +5940,11 @@ int ha_tokudb::info(uint flag) { DB_TXN* txn = NULL; uint curr_num_DBs = table->s->keys + test(hidden_primary_key); DB_BTREE_STAT64 dict_stats; + + for (uint i=0; i < table->s->keys; i++) + if (table->key_info[i].option_struct->clustering) + table->covering_keys.set_bit(i); + if (flag & HA_STATUS_VARIABLE) { // Just to get optimizations right stats.records = share->rows + share->rows_from_locked_table; diff --git a/storage/tokudb/mysql-test/tokudb/r/cluster_1829.result b/storage/tokudb/mysql-test/tokudb/r/cluster_1829.result index 6fa3c610a67..a29cebd8d45 100644 --- a/storage/tokudb/mysql-test/tokudb/r/cluster_1829.result +++ b/storage/tokudb/mysql-test/tokudb/r/cluster_1829.result @@ -5,7 +5,7 @@ create table z1 (a int, b int, c int, d int, e int, key (a) clustering=yes); insert into z1 values (1,1,1,1,1),(7,7,7,7,7),(4,4,4,4,4),(3,3,3,3,3),(5,5,5,5,5),(2,2,2,2,2),(6,6,6,6,6); explain select * From z1 order by a; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE z1 index NULL a 5 NULL 7 +1 SIMPLE z1 index NULL a 5 NULL 7 Using index select * from z1 order by a; a b c d e 1 1 1 1 1 @@ -17,7 +17,7 @@ a b c d e 7 7 7 7 7 explain select * From z1 order by a desc; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE z1 index NULL a 5 NULL 7 +1 SIMPLE z1 index NULL a 5 NULL 7 Using index select * from z1 order by a desc; a b c d e 7 7 7 7 7 diff --git a/storage/tokudb/mysql-test/tokudb/r/cluster_2968-0.result b/storage/tokudb/mysql-test/tokudb/r/cluster_2968-0.result index f549d02960b..1e0935543dc 100644 --- a/storage/tokudb/mysql-test/tokudb/r/cluster_2968-0.result +++ b/storage/tokudb/mysql-test/tokudb/r/cluster_2968-0.result @@ -1041,6 +1041,6 @@ t CREATE TABLE `t` ( ) ENGINE=TokuDB DEFAULT CHARSET=latin1 explain select straight_join * from s,t where s.b = t.b; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE s index b b 5 NULL 1000 Using where -1 SIMPLE t ref b b 5 test.s.b 11 +1 SIMPLE s index b b 5 NULL 1000 Using where; Using index +1 SIMPLE t ref b b 5 test.s.b 11 Using index drop table s,t; diff --git a/storage/tokudb/mysql-test/tokudb/r/cluster_2968-1.result b/storage/tokudb/mysql-test/tokudb/r/cluster_2968-1.result index 829ad9ad479..5b75816e813 100644 --- a/storage/tokudb/mysql-test/tokudb/r/cluster_2968-1.result +++ b/storage/tokudb/mysql-test/tokudb/r/cluster_2968-1.result @@ -1065,8 +1065,8 @@ t CREATE TABLE `t` ( ) ENGINE=TokuDB DEFAULT CHARSET=latin1 explain select straight_join * from s,t where s.b = t.b; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE s index b,b_2 b_2 5 NULL 1000 Using where -1 SIMPLE t ref b,b_2 b_2 5 test.s.b 11 +1 SIMPLE s index b,b_2 b_2 5 NULL 1000 Using where; Using index +1 SIMPLE t ref b,b_2 b_2 5 test.s.b 11 Using index alter table s drop key b; alter table t drop key b; show create table s; @@ -1087,8 +1087,8 @@ t CREATE TABLE `t` ( ) ENGINE=TokuDB DEFAULT CHARSET=latin1 explain select straight_join * from s,t where s.b = t.b; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE s index b_2 b_2 5 NULL 1000 Using where -1 SIMPLE t ref b_2 b_2 5 test.s.b 11 +1 SIMPLE s index b_2 b_2 5 NULL 1000 Using where; Using index +1 SIMPLE t ref b_2 b_2 5 test.s.b 11 Using index alter table s add key(b); alter table t add key(b); show create table s; @@ -1111,6 +1111,6 @@ t CREATE TABLE `t` ( ) ENGINE=TokuDB DEFAULT CHARSET=latin1 explain select straight_join * from s,t where s.b = t.b; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE s index b_2,b b_2 5 NULL 1000 Using where -1 SIMPLE t ref b_2,b b_2 5 test.s.b 11 +1 SIMPLE s index b_2,b b_2 5 NULL 1000 Using where; Using index +1 SIMPLE t ref b_2,b b_2 5 test.s.b 11 Using index drop table s,t; diff --git a/storage/tokudb/mysql-test/tokudb/r/cluster_2968-2.result b/storage/tokudb/mysql-test/tokudb/r/cluster_2968-2.result index d2290915621..472faa1e3a1 100644 --- a/storage/tokudb/mysql-test/tokudb/r/cluster_2968-2.result +++ b/storage/tokudb/mysql-test/tokudb/r/cluster_2968-2.result @@ -1115,6 +1115,6 @@ t CREATE TABLE `t` ( ) ENGINE=TokuDB DEFAULT CHARSET=latin1 explain select straight_join s.a,t.a from s,t where s.b = t.b; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE s index b,b_3 b_3 5 NULL 1000 Using where -1 SIMPLE t ref b,b_3 b_3 5 test.s.b 11 +1 SIMPLE s index b,b_3 b_3 5 NULL 1000 Using where; Using index +1 SIMPLE t ref b,b_3 b_3 5 test.s.b 11 Using index drop table s,t; diff --git a/storage/tokudb/mysql-test/tokudb/r/cluster_2968-3.result b/storage/tokudb/mysql-test/tokudb/r/cluster_2968-3.result index 8b5ebc7ed01..53fe2f7af8d 100644 --- a/storage/tokudb/mysql-test/tokudb/r/cluster_2968-3.result +++ b/storage/tokudb/mysql-test/tokudb/r/cluster_2968-3.result @@ -1096,7 +1096,7 @@ u CREATE TABLE `u` ( ) ENGINE=TokuDB DEFAULT CHARSET=latin1 explain select straight_join * from s,t,u where s.b = t.b and s.c = u.c; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE s index b,b_2 b_2 5 NULL 1000 Using where -1 SIMPLE t ref b,b_2 b_2 5 test.s.b 11 -1 SIMPLE u ref c,c_2 c_2 5 test.s.c 11 +1 SIMPLE s ALL b,b_2 NULL NULL NULL 1000 Using where +1 SIMPLE t ref b,b_2 b_2 5 test.s.b 11 Using index +1 SIMPLE u ref c,c_2 c_2 5 test.s.c 11 Using index drop table s,t,u; diff --git a/storage/tokudb/mysql-test/tokudb/r/cluster_delete.result b/storage/tokudb/mysql-test/tokudb/r/cluster_delete.result index 51ff1de44f7..0c6c03972c7 100644 --- a/storage/tokudb/mysql-test/tokudb/r/cluster_delete.result +++ b/storage/tokudb/mysql-test/tokudb/r/cluster_delete.result @@ -13,7 +13,7 @@ a b c d 9 90 900 9000 explain select * from t1 where b > 30; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b 5 NULL NULL; Using where +1 SIMPLE t1 range b b 5 NULL NULL; Using where; Using index select * from t1 where b > 30; a b c d 4 40 400 4000 @@ -74,7 +74,7 @@ a b c d 9 90 900 9000 explain select * from t1 where b > 30; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b 5 NULL NULL; Using where +1 SIMPLE t1 range b b 5 NULL NULL; Using where; Using index select * from t1 where b > 30; a b c d 6 60 600 6000 @@ -122,7 +122,7 @@ a b c d 9 90 900 9000 explain select * from t1 where b > 30; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b 5 NULL NULL; Using where +1 SIMPLE t1 range b b 5 NULL NULL; Using where; Using index select * from t1 where b > 30; a b c d 6 60 600 6000 @@ -147,7 +147,7 @@ a 9 explain select a,b from t1 where b > 30; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b 5 NULL NULL; Using where +1 SIMPLE t1 range b b 5 NULL NULL; Using where; Using index select a,b from t1 where b > 30; a b 6 60 @@ -174,7 +174,7 @@ a b c d 9 90 900 9000 explain select * from t1 where b > 30; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b 5 NULL NULL; Using where +1 SIMPLE t1 range b b 5 NULL NULL; Using where; Using index select * from t1 where b > 30; a b c d 9 90 900 9000 @@ -192,7 +192,7 @@ a 9 explain select a,b from t1 where b > 30; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b 5 NULL NULL; Using where +1 SIMPLE t1 range b b 5 NULL NULL; Using where; Using index select a,b from t1 where b > 30; a b 9 90 diff --git a/storage/tokudb/mysql-test/tokudb/r/cluster_delete2.result b/storage/tokudb/mysql-test/tokudb/r/cluster_delete2.result index 896f840a679..7069c2fdc74 100644 --- a/storage/tokudb/mysql-test/tokudb/r/cluster_delete2.result +++ b/storage/tokudb/mysql-test/tokudb/r/cluster_delete2.result @@ -26,7 +26,7 @@ a b c d 8 80 800 8000 explain select * From t1 where b > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b 5 NULL NULL; Using where +1 SIMPLE t1 range b b 5 NULL NULL; Using where; Using index select * From t1 where b > 0; a b c d 1 10 100 1000 @@ -49,7 +49,7 @@ a b c d 7 70 700 7000 explain select * From t1 where b > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b 5 NULL NULL; Using where +1 SIMPLE t1 range b b 5 NULL NULL; Using where; Using index select * From t1 where b > 0; a b c d 1 10 100 1000 @@ -67,7 +67,7 @@ a b c d 3 30 300 3000 explain select * From t1 where b > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b 5 NULL NULL; Using where +1 SIMPLE t1 index b b 5 NULL NULL; Using where; Using index select * From t1 where b > 0; a b c d 1 10 100 1000 @@ -78,29 +78,29 @@ create table t1(a int, b int, c int, d int, key(b) clustering=yes)engine=tokudb; insert into t1 values (2,20,200,2000),(4,40,400,4000),(1,10,100,1000),(5,50,500,5000),(6,60,600,6000),(7,70,700,7000),(8,80,800,8000),(3,30,300,3000),(9,90,900,9000); select * from t1; a b c d -2 20 200 2000 -4 40 400 4000 1 10 100 1000 +2 20 200 2000 +3 30 300 3000 +4 40 400 4000 5 50 500 5000 6 60 600 6000 7 70 700 7000 8 80 800 8000 -3 30 300 3000 9 90 900 9000 delete from t1 where d > 8000; select * from t1; a b c d -2 20 200 2000 -4 40 400 4000 1 10 100 1000 +2 20 200 2000 +3 30 300 3000 +4 40 400 4000 5 50 500 5000 6 60 600 6000 7 70 700 7000 8 80 800 8000 -3 30 300 3000 explain select * From t1 where b > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b 5 NULL NULL; Using where +1 SIMPLE t1 range b b 5 NULL NULL; Using where; Using index select * From t1 where b > 0; a b c d 1 10 100 1000 @@ -114,12 +114,12 @@ a b c d delete from t1 where b > 30; select * from t1; a b c d -2 20 200 2000 1 10 100 1000 +2 20 200 2000 3 30 300 3000 explain select * From t1 where b > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b 5 NULL NULL; Using where +1 SIMPLE t1 index b b 5 NULL NULL; Using where; Using index select * From t1 where b > 0; a b c d 1 10 100 1000 diff --git a/storage/tokudb/mysql-test/tokudb/r/cluster_filter.result b/storage/tokudb/mysql-test/tokudb/r/cluster_filter.result index 54e37d6d964..234cf78d1e0 100644 --- a/storage/tokudb/mysql-test/tokudb/r/cluster_filter.result +++ b/storage/tokudb/mysql-test/tokudb/r/cluster_filter.result @@ -9,7 +9,7 @@ insert into t1 values (4,40,400,4000,40000,400000); insert into t1 values (5,50,500,5000,50000,500000); explain select * from t1 where c > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range PRIMARY PRIMARY NULL NULL NULL; Using where +1 SIMPLE t1 index PRIMARY b NULL NULL NULL; Using where; Using index select * from t1 where c > 0; a b c d e f 1 10 100 1000 10000 100000 @@ -19,7 +19,7 @@ a b c d e f 5 50 500 5000 50000 500000 explain select * from t1 where b > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b NULL NULL NULL; Using where +1 SIMPLE t1 index b b NULL NULL NULL; Using where; Using index select * from t1 where b > 0; a b c d e f 1 10 100 1000 10000 100000 @@ -29,7 +29,7 @@ a b c d e f 5 50 500 5000 50000 500000 explain select * from t1 where d > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range d d NULL NULL NULL; Using where +1 SIMPLE t1 index d d NULL NULL NULL; Using where; Using index select * from t1 where d > 0; a b c d e f 1 10 100 1000 10000 100000 @@ -71,7 +71,7 @@ e f update t1 set a = a+1, b = b+10; explain select * from t1 where c > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range PRIMARY PRIMARY NULL NULL NULL; Using where +1 SIMPLE t1 index PRIMARY b NULL NULL NULL; Using where; Using index select * from t1 where c > 0; a b c d e f 2 20 100 1000 10000 100000 @@ -81,7 +81,7 @@ a b c d e f 6 60 500 5000 50000 500000 explain select * from t1 where b > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b NULL NULL NULL; Using where +1 SIMPLE t1 index b b NULL NULL NULL; Using where; Using index select * from t1 where b > 0; a b c d e f 2 20 100 1000 10000 100000 @@ -91,7 +91,7 @@ a b c d e f 6 60 500 5000 50000 500000 explain select * from t1 where d > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range d d NULL NULL NULL; Using where +1 SIMPLE t1 index d d NULL NULL NULL; Using where; Using index select * from t1 where d > 0; a b c d e f 2 20 100 1000 10000 100000 @@ -140,14 +140,14 @@ a b c d e f 3 30 200 2000 20000 200000 explain select * from t1 where b > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b NULL NULL NULL; Using where +1 SIMPLE t1 index b b NULL NULL NULL; Using where; Using index select * from t1 where b > 0; a b c d e f 2 20 100 1000 10000 100000 3 30 200 2000 20000 200000 explain select * from t1 where d > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range d d NULL NULL NULL; Using where +1 SIMPLE t1 index d d NULL NULL NULL; Using where; Using index select * from t1 where d > 0; a b c d e f 2 20 100 1000 10000 100000 @@ -175,21 +175,21 @@ alter table t1 drop index b, drop index d; alter table t1 add key d(d,a) clustering=yes, add key b(b) clustering=yes; explain select * from t1 where c > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range PRIMARY PRIMARY NULL NULL NULL; Using where +1 SIMPLE t1 index PRIMARY d NULL NULL NULL; Using where; Using index select * from t1 where c > 0; a b c d e f 2 20 100 1000 10000 100000 3 30 200 2000 20000 200000 explain select * from t1 where b > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b NULL NULL NULL; Using where +1 SIMPLE t1 index b b NULL NULL NULL; Using where; Using index select * from t1 where b > 0; a b c d e f 2 20 100 1000 10000 100000 3 30 200 2000 20000 200000 explain select * from t1 where d > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range d d NULL NULL NULL; Using where +1 SIMPLE t1 index d d NULL NULL NULL; Using where; Using index select * from t1 where d > 0; a b c d e f 2 20 100 1000 10000 100000 diff --git a/storage/tokudb/mysql-test/tokudb/r/cluster_filter_hidden.result b/storage/tokudb/mysql-test/tokudb/r/cluster_filter_hidden.result index 782be3c6315..7e92604d0f5 100644 --- a/storage/tokudb/mysql-test/tokudb/r/cluster_filter_hidden.result +++ b/storage/tokudb/mysql-test/tokudb/r/cluster_filter_hidden.result @@ -9,7 +9,7 @@ insert into t1 values (4,40,400,4000,40000,400000); insert into t1 values (5,50,500,5000,50000,500000); explain select * from t1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL NULL; +1 SIMPLE t1 index NULL b NULL NULL NULL; Using index select * from t1; a b c d e f 1 10 100 1000 10000 100000 @@ -19,7 +19,7 @@ a b c d e f 5 50 500 5000 50000 500000 explain select * from t1 where b > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b NULL NULL NULL; Using where +1 SIMPLE t1 index b b NULL NULL NULL; Using where; Using index select * from t1 where b > 0; a b c d e f 1 10 100 1000 10000 100000 @@ -29,7 +29,7 @@ a b c d e f 5 50 500 5000 50000 500000 explain select * from t1 where d > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range d d NULL NULL NULL; Using where +1 SIMPLE t1 index d d NULL NULL NULL; Using where; Using index select * from t1 where d > 0; a b c d e f 1 10 100 1000 10000 100000 @@ -71,7 +71,7 @@ e f update t1 set a = a+1, b = b+10; explain select * from t1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL NULL; +1 SIMPLE t1 index NULL b NULL NULL NULL; Using index select * from t1; a b c d e f 2 20 100 1000 10000 100000 @@ -81,7 +81,7 @@ a b c d e f 6 60 500 5000 50000 500000 explain select * from t1 where b > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b NULL NULL NULL; Using where +1 SIMPLE t1 index b b NULL NULL NULL; Using where; Using index select * from t1 where b > 0; a b c d e f 2 20 100 1000 10000 100000 @@ -91,7 +91,7 @@ a b c d e f 6 60 500 5000 50000 500000 explain select * from t1 where d > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range d d NULL NULL NULL; Using where +1 SIMPLE t1 index d d NULL NULL NULL; Using where; Using index select * from t1 where d > 0; a b c d e f 2 20 100 1000 10000 100000 @@ -133,21 +133,21 @@ e f delete from t1 where b > 35; explain select * from t1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL NULL; +1 SIMPLE t1 index NULL b NULL NULL NULL; Using index select * from t1; a b c d e f 2 20 100 1000 10000 100000 3 30 200 2000 20000 200000 explain select * from t1 where b > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b NULL NULL NULL; Using where +1 SIMPLE t1 index b b NULL NULL NULL; Using where; Using index select * from t1 where b > 0; a b c d e f 2 20 100 1000 10000 100000 3 30 200 2000 20000 200000 explain select * from t1 where d > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range d d NULL NULL NULL; Using where +1 SIMPLE t1 index d d NULL NULL NULL; Using where; Using index select * from t1 where d > 0; a b c d e f 2 20 100 1000 10000 100000 @@ -175,21 +175,21 @@ alter table t1 drop index b, drop index d; alter table t1 add key b(b) clustering=yes, add index d(d,a) clustering=yes; explain select * from t1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL NULL; +1 SIMPLE t1 index NULL b NULL NULL NULL; Using index select * from t1; a b c d e f 2 20 100 1000 10000 100000 3 30 200 2000 20000 200000 explain select * from t1 where b > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b NULL NULL NULL; Using where +1 SIMPLE t1 index b b NULL NULL NULL; Using where; Using index select * from t1 where b > 0; a b c d e f 2 20 100 1000 10000 100000 3 30 200 2000 20000 200000 explain select * from t1 where d > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range d d NULL NULL NULL; Using where +1 SIMPLE t1 index d d NULL NULL NULL; Using where; Using index select * from t1 where d > 0; a b c d e f 2 20 100 1000 10000 100000 diff --git a/storage/tokudb/mysql-test/tokudb/r/cluster_filter_unpack_varchar.result b/storage/tokudb/mysql-test/tokudb/r/cluster_filter_unpack_varchar.result index b8a705984c7..898e5a59773 100644 --- a/storage/tokudb/mysql-test/tokudb/r/cluster_filter_unpack_varchar.result +++ b/storage/tokudb/mysql-test/tokudb/r/cluster_filter_unpack_varchar.result @@ -9,7 +9,7 @@ insert into t1 values ("4","40","400","4000","40000","400000"); insert into t1 values ("5","50","500","5000","50000","500000"); explain select * from t1 where c > "0"; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range PRIMARY PRIMARY NULL NULL NULL; Using where +1 SIMPLE t1 index PRIMARY b NULL NULL NULL; Using where; Using index select * from t1; a b c d e f 1 10 100 1000 10000 100000 @@ -19,7 +19,7 @@ a b c d e f 5 50 500 5000 50000 500000 explain select * from t1 where b > "0"; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b NULL NULL NULL; Using where +1 SIMPLE t1 index b b NULL NULL NULL; Using where; Using index select * from t1 where b > "0"; a b c d e f 1 10 100 1000 10000 100000 @@ -29,7 +29,7 @@ a b c d e f 5 50 500 5000 50000 500000 explain select * from t1 where d > "0"; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range d d NULL NULL NULL; Using where +1 SIMPLE t1 index d d NULL NULL NULL; Using where; Using index select * from t1 where d > "0"; a b c d e f 1 10 100 1000 10000 100000 @@ -71,7 +71,7 @@ e f update t1 set a = a+1, b = b+10; explain select * from t1 where c > "0"; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range PRIMARY PRIMARY NULL NULL NULL; Using where +1 SIMPLE t1 index PRIMARY b NULL NULL NULL; Using where; Using index select * from t1 where c > "0"; a b c d e f 2 20 100 1000 10000 100000 @@ -81,7 +81,7 @@ a b c d e f 6 60 500 5000 50000 500000 explain select * from t1 where b > "0"; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b NULL NULL NULL; Using where +1 SIMPLE t1 index b b NULL NULL NULL; Using where; Using index select * from t1 where b > "0"; a b c d e f 2 20 100 1000 10000 100000 @@ -91,7 +91,7 @@ a b c d e f 6 60 500 5000 50000 500000 explain select * from t1 where d > "0"; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range d d NULL NULL NULL; Using where +1 SIMPLE t1 index d d NULL NULL NULL; Using where; Using index select * from t1 where d > "0"; a b c d e f 2 20 100 1000 10000 100000 @@ -140,14 +140,14 @@ a b c d e f 3 30 200 2000 20000 200000 explain select * from t1 where b > "0"; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b NULL NULL NULL; Using where +1 SIMPLE t1 index b b NULL NULL NULL; Using where; Using index select * from t1 where b > "0"; a b c d e f 2 20 100 1000 10000 100000 3 30 200 2000 20000 200000 explain select * from t1 where d > "0"; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range d d NULL NULL NULL; Using where +1 SIMPLE t1 index d d NULL NULL NULL; Using where; Using index select * from t1 where d > "0"; a b c d e f 2 20 100 1000 10000 100000 @@ -175,21 +175,21 @@ alter table t1 drop index b, drop index d; alter table t1 add key d(d,a) clustering=yes, add key b(b) clustering=yes; explain select * from t1 where c > "0"; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range PRIMARY PRIMARY NULL NULL NULL; Using where +1 SIMPLE t1 index PRIMARY d NULL NULL NULL; Using where; Using index select * from t1 where c > "0"; a b c d e f 2 20 100 1000 10000 100000 3 30 200 2000 20000 200000 explain select * from t1 where b > "0"; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b NULL NULL NULL; Using where +1 SIMPLE t1 index b b NULL NULL NULL; Using where; Using index select * from t1 where b > "0"; a b c d e f 2 20 100 1000 10000 100000 3 30 200 2000 20000 200000 explain select * from t1 where d > "0"; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range d d NULL NULL NULL; Using where +1 SIMPLE t1 index d d NULL NULL NULL; Using where; Using index select * from t1 where d > "0"; a b c d e f 2 20 100 1000 10000 100000 diff --git a/storage/tokudb/mysql-test/tokudb/r/cluster_filter_unpack_varchar_and_int_hidden.result b/storage/tokudb/mysql-test/tokudb/r/cluster_filter_unpack_varchar_and_int_hidden.result index c66b67428c5..cf70de29376 100644 --- a/storage/tokudb/mysql-test/tokudb/r/cluster_filter_unpack_varchar_and_int_hidden.result +++ b/storage/tokudb/mysql-test/tokudb/r/cluster_filter_unpack_varchar_and_int_hidden.result @@ -9,7 +9,7 @@ insert into t1 values (4,40,"400","4000","40000",400000); insert into t1 values (5,50,"500","5000","50000",500000); explain select * from t1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL NULL; +1 SIMPLE t1 index NULL b NULL NULL NULL; Using index select * from t1; a b c d e f 1 10 100 1000 10000 100000 @@ -19,7 +19,7 @@ a b c d e f 5 50 500 5000 50000 500000 explain select * from t1 where b > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b NULL NULL NULL; Using where +1 SIMPLE t1 index b b NULL NULL NULL; Using where; Using index select * from t1 where b > 0; a b c d e f 1 10 100 1000 10000 100000 @@ -29,7 +29,7 @@ a b c d e f 5 50 500 5000 50000 500000 explain select * from t1 where d > "0"; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range d d NULL NULL NULL; Using where +1 SIMPLE t1 index d d NULL NULL NULL; Using where; Using index select * from t1 where d > "0"; a b c d e f 1 10 100 1000 10000 100000 @@ -71,7 +71,7 @@ e f update t1 set a = a+1, b = b+10; explain select * from t1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL NULL; +1 SIMPLE t1 index NULL b NULL NULL NULL; Using index select * from t1; a b c d e f 2 20 100 1000 10000 100000 @@ -81,7 +81,7 @@ a b c d e f 6 60 500 5000 50000 500000 explain select * from t1 where b > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b NULL NULL NULL; Using where +1 SIMPLE t1 index b b NULL NULL NULL; Using where; Using index select * from t1 where b > 0; a b c d e f 2 20 100 1000 10000 100000 @@ -91,7 +91,7 @@ a b c d e f 6 60 500 5000 50000 500000 explain select * from t1 where d > "0"; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range d d NULL NULL NULL; Using where +1 SIMPLE t1 index d d NULL NULL NULL; Using where; Using index select * from t1 where d > "0"; a b c d e f 2 20 100 1000 10000 100000 @@ -133,21 +133,21 @@ e f delete from t1 where b > 35; explain select * from t1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL NULL; +1 SIMPLE t1 index NULL b NULL NULL NULL; Using index select * from t1; a b c d e f 2 20 100 1000 10000 100000 3 30 200 2000 20000 200000 explain select * from t1 where b > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b NULL NULL NULL; Using where +1 SIMPLE t1 index b b NULL NULL NULL; Using where; Using index select * from t1 where b > 0; a b c d e f 2 20 100 1000 10000 100000 3 30 200 2000 20000 200000 explain select * from t1 where d > "0"; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range d d NULL NULL NULL; Using where +1 SIMPLE t1 index d d NULL NULL NULL; Using where; Using index select * from t1 where d > "0"; a b c d e f 2 20 100 1000 10000 100000 @@ -175,21 +175,21 @@ alter table t1 drop index b, drop index d; alter table t1 add key d(d,a) clustering=yes, add key b(b) clustering=yes; explain select * from t1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL NULL; +1 SIMPLE t1 index NULL d NULL NULL NULL; Using index select * from t1; a b c d e f 2 20 100 1000 10000 100000 3 30 200 2000 20000 200000 explain select * from t1 where b > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b NULL NULL NULL; Using where +1 SIMPLE t1 index b b NULL NULL NULL; Using where; Using index select * from t1 where b > 0; a b c d e f 2 20 100 1000 10000 100000 3 30 200 2000 20000 200000 explain select * from t1 where d > "0"; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range d d NULL NULL NULL; Using where +1 SIMPLE t1 index d d NULL NULL NULL; Using where; Using index select * from t1 where d > "0"; a b c d e f 2 20 100 1000 10000 100000 diff --git a/storage/tokudb/mysql-test/tokudb/r/cluster_filter_unpack_varchar_hidden.result b/storage/tokudb/mysql-test/tokudb/r/cluster_filter_unpack_varchar_hidden.result index a85e31144ed..640c7badc71 100644 --- a/storage/tokudb/mysql-test/tokudb/r/cluster_filter_unpack_varchar_hidden.result +++ b/storage/tokudb/mysql-test/tokudb/r/cluster_filter_unpack_varchar_hidden.result @@ -9,7 +9,7 @@ insert into t1 values ("4","40","400","4000","40000","400000"); insert into t1 values ("5","50","500","5000","50000","500000"); explain select * from t1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL NULL; +1 SIMPLE t1 index NULL b NULL NULL NULL; Using index select * from t1; a b c d e f 1 10 100 1000 10000 100000 @@ -19,7 +19,7 @@ a b c d e f 5 50 500 5000 50000 500000 explain select * from t1 where b > "0"; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b NULL NULL NULL; Using where +1 SIMPLE t1 index b b NULL NULL NULL; Using where; Using index select * from t1 where b > "0"; a b c d e f 1 10 100 1000 10000 100000 @@ -29,7 +29,7 @@ a b c d e f 5 50 500 5000 50000 500000 explain select * from t1 where d > "0"; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range d d NULL NULL NULL; Using where +1 SIMPLE t1 index d d NULL NULL NULL; Using where; Using index select * from t1 where d > "0"; a b c d e f 1 10 100 1000 10000 100000 @@ -71,7 +71,7 @@ e f update t1 set a = a+1, b = b+10; explain select * from t1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL NULL; +1 SIMPLE t1 index NULL b NULL NULL NULL; Using index select * from t1; a b c d e f 2 20 100 1000 10000 100000 @@ -81,7 +81,7 @@ a b c d e f 6 60 500 5000 50000 500000 explain select * from t1 where b > "0"; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b NULL NULL NULL; Using where +1 SIMPLE t1 index b b NULL NULL NULL; Using where; Using index select * from t1 where b > "0"; a b c d e f 2 20 100 1000 10000 100000 @@ -91,7 +91,7 @@ a b c d e f 6 60 500 5000 50000 500000 explain select * from t1 where d > "0"; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range d d NULL NULL NULL; Using where +1 SIMPLE t1 index d d NULL NULL NULL; Using where; Using index select * from t1 where d > "0"; a b c d e f 2 20 100 1000 10000 100000 @@ -133,21 +133,21 @@ e f delete from t1 where b > 35; explain select * from t1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL NULL; +1 SIMPLE t1 index NULL b NULL NULL NULL; Using index select * from t1; a b c d e f 2 20 100 1000 10000 100000 3 30 200 2000 20000 200000 explain select * from t1 where b > "0"; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b NULL NULL NULL; Using where +1 SIMPLE t1 index b b NULL NULL NULL; Using where; Using index select * from t1 where b > "0"; a b c d e f 2 20 100 1000 10000 100000 3 30 200 2000 20000 200000 explain select * from t1 where d > "0"; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range d d NULL NULL NULL; Using where +1 SIMPLE t1 index d d NULL NULL NULL; Using where; Using index select * from t1 where d > "0"; a b c d e f 2 20 100 1000 10000 100000 @@ -175,21 +175,21 @@ alter table t1 drop index b, drop index d; alter table t1 add key d(d,a) clustering=yes, add key b(b) clustering=yes; explain select * from t1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL NULL; +1 SIMPLE t1 index NULL d NULL NULL NULL; Using index select * from t1; a b c d e f 2 20 100 1000 10000 100000 3 30 200 2000 20000 200000 explain select * from t1 where b > "0"; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b NULL NULL NULL; Using where +1 SIMPLE t1 index b b NULL NULL NULL; Using where; Using index select * from t1 where b > "0"; a b c d e f 2 20 100 1000 10000 100000 3 30 200 2000 20000 200000 explain select * from t1 where d > "0"; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range d d NULL NULL NULL; Using where +1 SIMPLE t1 index d d NULL NULL NULL; Using where; Using index select * from t1 where d > "0"; a b c d e f 2 20 100 1000 10000 100000 diff --git a/storage/tokudb/mysql-test/tokudb/r/cluster_key.result b/storage/tokudb/mysql-test/tokudb/r/cluster_key.result index 0ad2de8537a..74298d69114 100644 --- a/storage/tokudb/mysql-test/tokudb/r/cluster_key.result +++ b/storage/tokudb/mysql-test/tokudb/r/cluster_key.result @@ -13,7 +13,7 @@ a b c d 9 90 900 9000 explain select * from t1 where b > 30; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b 5 NULL NULL; Using where +1 SIMPLE t1 range b b 5 NULL NULL; Using where; Using index select * from t1 where b > 30; a b c d 4 40 400 4000 @@ -69,7 +69,7 @@ a b c d 10 10 10 10 explain select * from t1 where b > 30; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b 5 NULL NULL; Using where +1 SIMPLE t1 range b b 5 NULL NULL; Using where; Using index select * from t1 where b > 30; a b c d 4 40 400 4000 @@ -117,7 +117,7 @@ a b c d e 10 10 10 10 NULL explain select * from t1 where b > 30; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b 5 NULL NULL; Using where +1 SIMPLE t1 range b b 5 NULL NULL; Using where; Using index select * from t1 where b > 30; a b c d e 4 40 400 4000 NULL @@ -171,7 +171,7 @@ a b c d e 10 10 10 10 NULL explain select * from t1 where b > 30; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b 5 NULL NULL; Using where +1 SIMPLE t1 range b b 5 NULL NULL; Using where; Using index select * from t1 where b > 30; a b c d e 4 40 400 4000 NULL diff --git a/storage/tokudb/mysql-test/tokudb/r/cluster_query_plan.result b/storage/tokudb/mysql-test/tokudb/r/cluster_query_plan.result index 493d93a8058..c6754db3981 100644 --- a/storage/tokudb/mysql-test/tokudb/r/cluster_query_plan.result +++ b/storage/tokudb/mysql-test/tokudb/r/cluster_query_plan.result @@ -4,7 +4,7 @@ create table t1(a int, b int, c int, d int, primary key(a), key(b) clustering=ye insert into t1 values (1,1,1,1),(2,2,2,2),(3,3,3,3),(4,4,4,4),(5,5,5,5),(6,6,6,6),(7,7,7,7),(8,8,8,8),(9,9,9,9); explain select * from t1 where b > 2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b 5 NULL NULL; Using where +1 SIMPLE t1 range b b 5 NULL NULL; Using where; Using index explain select * from t1 where c > 2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL c NULL NULL NULL NULL; Using where @@ -16,7 +16,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range c c 5 NULL NULL; Using where explain select * from t1 where b > 7; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b 5 NULL NULL; Using where +1 SIMPLE t1 range b b 5 NULL NULL; Using where; Using index explain select a from t1 where b > 0; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index b b 5 NULL NULL; Using where; Using index diff --git a/storage/tokudb/mysql-test/tokudb/r/cluster_update.result b/storage/tokudb/mysql-test/tokudb/r/cluster_update.result index 76fa87d32a2..6502f7b3e7c 100644 --- a/storage/tokudb/mysql-test/tokudb/r/cluster_update.result +++ b/storage/tokudb/mysql-test/tokudb/r/cluster_update.result @@ -13,7 +13,7 @@ a b c d 9 90 900 9000 explain select * from t1 where b > 30; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b 5 NULL NULL; Using where +1 SIMPLE t1 range b b 5 NULL NULL; Using where; Using index select * from t1 where b > 30; a b c d 4 40 400 4000 @@ -65,7 +65,7 @@ a b c d 9 95 905 9000 explain select * from t1 where b > 30; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b 5 NULL NULL; Using where +1 SIMPLE t1 range b b 5 NULL NULL; Using where; Using index select * from t1 where b > 30; a b c d 4 45 405 4000 @@ -76,7 +76,7 @@ a b c d 9 95 905 9000 explain select * from t1 where c > 750; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range c c 5 NULL NULL; Using where +1 SIMPLE t1 ALL c NULL NULL NULL NULL; Using where select * from t1 where c > 750; a b c d 8 85 805 8000 @@ -100,7 +100,7 @@ a b 9 95 explain select a,b from t1 where c > 750; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range c c 5 NULL NULL; Using where +1 SIMPLE t1 ALL c NULL NULL NULL NULL; Using where select a,c from t1 where c > 750; a c 8 805 @@ -117,7 +117,7 @@ a b c d 9 95 905 9000 explain select * from t1 where b > 30; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b 5 NULL NULL; Using where +1 SIMPLE t1 range b b 5 NULL NULL; Using where; Using index select * from t1 where b > 30; a b c d 4 45 405 4000 @@ -144,7 +144,7 @@ a 9 explain select a,b from t1 where b > 30; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b 5 NULL NULL; Using where +1 SIMPLE t1 range b b 5 NULL NULL; Using where; Using index select a,b from t1 where b > 30; a b 4 45 @@ -183,7 +183,7 @@ a b c d 9 100 910 9000 explain select * from t1 where b > 30; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b 5 NULL NULL; Using where +1 SIMPLE t1 range b b 5 NULL NULL; Using where; Using index select * from t1 where b > 30; a b c d 4 50 410 4000 @@ -194,7 +194,7 @@ a b c d 9 100 910 9000 explain select * from t1 where c > 750; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range c c 5 NULL NULL; Using where +1 SIMPLE t1 ALL c NULL NULL NULL NULL; Using where select * from t1 where c > 750; a b c d 8 90 810 8000 @@ -210,7 +210,7 @@ a 9 explain select a,b from t1 where b > 30; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b 5 NULL NULL; Using where +1 SIMPLE t1 range b b 5 NULL NULL; Using where; Using index select a,b from t1 where b > 30; a b 4 50 @@ -221,7 +221,7 @@ a b 9 100 explain select a,b from t1 where c > 750; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range c c 5 NULL NULL; Using where +1 SIMPLE t1 ALL c NULL NULL NULL NULL; Using where select a,c from t1 where c > 750; a c 8 810 diff --git a/storage/tokudb/mysql-test/tokudb/r/cluster_update2.result b/storage/tokudb/mysql-test/tokudb/r/cluster_update2.result index 159ea7ec229..f4d5e8c3b0f 100644 --- a/storage/tokudb/mysql-test/tokudb/r/cluster_update2.result +++ b/storage/tokudb/mysql-test/tokudb/r/cluster_update2.result @@ -27,7 +27,7 @@ a b c d 9 90 900 19000 explain select * From t1 where b > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b 5 NULL NULL; Using where +1 SIMPLE t1 index b b 5 NULL NULL; Using where; Using index select * From t1 where b > 0; a b c d 1 10 100 11000 @@ -53,7 +53,7 @@ a b c d 10009 90 900 19000 explain select * From t1 where b > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b 5 NULL NULL; Using where +1 SIMPLE t1 index b b 5 NULL NULL; Using where; Using index select * From t1 where b > 0; a b c d 10001 10 100 11000 @@ -79,7 +79,7 @@ a b c d 10009 10090 900 19000 explain select * From t1 where b > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index b b 5 NULL NULL; Using where +1 SIMPLE t1 index b b 5 NULL NULL; Using where; Using index select * From t1 where b > 0; a b c d 10001 10010 100 11000 @@ -96,30 +96,30 @@ create table t1(a int, b int, c int, d int, key(b) clustering=yes)engine=tokudb; insert into t1 values (2,20,200,2000),(4,40,400,4000),(1,10,100,1000),(5,50,500,5000),(6,60,600,6000),(7,70,700,7000),(8,80,800,8000),(3,30,300,3000),(9,90,900,9000); select * from t1; a b c d -2 20 200 2000 -4 40 400 4000 1 10 100 1000 +2 20 200 2000 +3 30 300 3000 +4 40 400 4000 5 50 500 5000 6 60 600 6000 7 70 700 7000 8 80 800 8000 -3 30 300 3000 9 90 900 9000 update t1 set d=d+10000; select * from t1; a b c d -2 20 200 12000 -4 40 400 14000 1 10 100 11000 +2 20 200 12000 +3 30 300 13000 +4 40 400 14000 5 50 500 15000 6 60 600 16000 7 70 700 17000 8 80 800 18000 -3 30 300 13000 9 90 900 19000 explain select * From t1 where b > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b 5 NULL NULL; Using where +1 SIMPLE t1 index b b 5 NULL NULL; Using where; Using index select * From t1 where b > 0; a b c d 1 10 100 11000 @@ -134,18 +134,18 @@ a b c d update t1 set b=b+10000; select * from t1; a b c d -2 10020 200 12000 -4 10040 400 14000 1 10010 100 11000 +2 10020 200 12000 +3 10030 300 13000 +4 10040 400 14000 5 10050 500 15000 6 10060 600 16000 7 10070 700 17000 8 10080 800 18000 -3 10030 300 13000 9 10090 900 19000 explain select * From t1 where b > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b 5 NULL NULL; Using where +1 SIMPLE t1 index b b 5 NULL NULL; Using where; Using index select * From t1 where b > 0; a b c d 1 10010 100 11000 @@ -161,18 +161,18 @@ alter table t1 drop key b; alter table t1 add key b(b) clustering=yes; select * from t1; a b c d -2 10020 200 12000 -4 10040 400 14000 1 10010 100 11000 +2 10020 200 12000 +3 10030 300 13000 +4 10040 400 14000 5 10050 500 15000 6 10060 600 16000 7 10070 700 17000 8 10080 800 18000 -3 10030 300 13000 9 10090 900 19000 explain select * From t1 where b > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b 5 NULL NULL; Using where +1 SIMPLE t1 index b b 5 NULL NULL; Using where; Using index select * From t1 where b > 0; a b c d 1 10010 100 11000 diff --git a/storage/tokudb/mysql-test/tokudb_alter_table/r/hcad_with_lock_sps.result b/storage/tokudb/mysql-test/tokudb_alter_table/r/hcad_with_lock_sps.result index b6008ea6ed5..4b7020727de 100644 --- a/storage/tokudb/mysql-test/tokudb_alter_table/r/hcad_with_lock_sps.result +++ b/storage/tokudb/mysql-test/tokudb_alter_table/r/hcad_with_lock_sps.result @@ -11,7 +11,7 @@ insert into foo values (4,40,400); alter table foo add column z int default 999 first; explain select * from foo; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE foo ALL NULL NULL NULL NULL 4 +1 SIMPLE foo index NULL b 5 NULL 4 Using index select * from foo; z a b c 999 1 10 100 @@ -20,7 +20,7 @@ z a b c 999 4 40 400 explain select * from foo where b > 20; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE foo range b b 5 NULL 2 Using where +1 SIMPLE foo range b b 5 NULL 2 Using where; Using index select* from foo where b > 10; z a b c 999 2 20 200 @@ -31,7 +31,7 @@ begin; alter table foo drop column z; explain select * from foo; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE foo ALL NULL NULL NULL NULL 4 +1 SIMPLE foo index NULL b 5 NULL 4 Using index select * from foo; a b c 1 10 100 @@ -40,7 +40,7 @@ a b c 4 40 400 explain select * from foo where b > 20; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE foo range b b 5 NULL 2 Using where +1 SIMPLE foo range b b 5 NULL 2 Using where; Using index select* from foo where b > 10; a b c 2 20 200 @@ -50,7 +50,7 @@ lock tables foo write; alter table foo add column z int; explain select * from foo; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE foo ALL NULL NULL NULL NULL 4 +1 SIMPLE foo index NULL b 5 NULL 4 Using index select * from foo; a b c z 1 10 100 NULL @@ -59,7 +59,7 @@ a b c z 4 40 400 NULL explain select * from foo where b > 20; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE foo range b b 5 NULL 2 Using where +1 SIMPLE foo range b b 5 NULL 2 Using where; Using index select* from foo where b > 10; a b c z 2 20 200 NULL @@ -87,21 +87,21 @@ select* from foo where b > 10; end | call p0(); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE foo ALL NULL NULL NULL NULL 4 +1 SIMPLE foo index NULL b 5 NULL 4 Using index a b c 1 10 100 2 20 200 3 30 300 4 40 400 id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE foo range b b 5 NULL 2 Using where +1 SIMPLE foo range b b 5 NULL 2 Using where; Using index a b c 2 20 200 3 30 300 4 40 400 explain select * from foo; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE foo ALL NULL NULL NULL NULL 4 +1 SIMPLE foo index NULL b 5 NULL 4 Using index select * from foo; a b c 1 10 100 @@ -110,7 +110,7 @@ a b c 4 40 400 explain select * from foo where b > 20; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE foo range b b 5 NULL 2 Using where +1 SIMPLE foo range b b 5 NULL 2 Using where; Using index select* from foo where b > 10; a b c 2 20 200 @@ -141,7 +141,7 @@ a b c 4 40 400 5 50 500 id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE foo ALL NULL NULL NULL NULL 5 +1 SIMPLE foo index NULL b 5 NULL 5 Using index a b c g 1 10 100 NULL 2 20 200 NULL @@ -154,11 +154,11 @@ a b c g 4 40 400 NULL 5 50 500 NULL id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE foo range b b 5 NULL 3 Using where +1 SIMPLE foo range b b 5 NULL 3 Using where; Using index set autocommit=on; explain select * from foo; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE foo ALL NULL NULL NULL NULL 5 +1 SIMPLE foo index NULL b 5 NULL 5 Using index select * from foo; a b c g 1 10 100 NULL @@ -168,7 +168,7 @@ a b c g 5 50 500 NULL explain select * from foo where b > 10; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE foo range b b 5 NULL 4 Using where +1 SIMPLE foo range b b 5 NULL 4 Using where; Using index select * from foo where b > 10; a b c g 2 20 200 NULL diff --git a/storage/tokudb/mysql-test/tokudb_alter_table/r/hcr3.result b/storage/tokudb/mysql-test/tokudb_alter_table/r/hcr3.result index 28455c661c0..834ddfbd2d3 100644 --- a/storage/tokudb/mysql-test/tokudb_alter_table/r/hcr3.result +++ b/storage/tokudb/mysql-test/tokudb_alter_table/r/hcr3.result @@ -24,7 +24,7 @@ aa b c d e 1 10 cc dddd eeeee explain select * from foo where aa > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE foo range PRIMARY PRIMARY 4 NULL 1 Using where +1 SIMPLE foo index PRIMARY d 13 NULL 1 Using where; Using index select * from foo where aa > 0; aa b c d e 1 10 cc dddd eeeee @@ -62,7 +62,7 @@ foo CREATE TABLE `foo` ( ) ENGINE=TokuDB DEFAULT CHARSET=latin1 explain select * from foo where dd > "d"; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE foo range d d 13 NULL 1 Using where +1 SIMPLE foo index d d 13 NULL 1 Using where; Using index select * from foo where dd > "d"; aa bb c dd e 1 10 cc dddd eeeee diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/1684.result b/storage/tokudb/mysql-test/tokudb_bugs/r/1684.result index 34c14490239..e3618f87e76 100644 --- a/storage/tokudb/mysql-test/tokudb_bugs/r/1684.result +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/1684.result @@ -9,7 +9,7 @@ insert into foo values (4,"four"); alter table foo add key a(a) clustering=yes; explain select * From foo where a > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE foo range a a 5 NULL NULL; Using where +1 SIMPLE foo index a a 5 NULL NULL; Using where; Using index select * From foo where a > 0; a b 1 one diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/1711.result b/storage/tokudb/mysql-test/tokudb_bugs/r/1711.result index 07c465bfe55..ee88e088061 100644 --- a/storage/tokudb/mysql-test/tokudb_bugs/r/1711.result +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/1711.result @@ -4,7 +4,7 @@ create table foo (a int, b int, c int, key (a) clustering=yes)engine=tokudb; insert into foo values (1,1,1),(1,2,2),(1,3,3),(2,1,4),(2,2,5),(2,3,6),(3,1,7),(3,2,8); explain select * From foo where a = 2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE foo ref a a 5 const NULL; +1 SIMPLE foo ref a a 5 const NULL; Using index select * From foo where a = 2; a b c 2 1 4 diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/2458.result b/storage/tokudb/mysql-test/tokudb_bugs/r/2458.result index d2cd248859a..9963dcb7890 100644 --- a/storage/tokudb/mysql-test/tokudb_bugs/r/2458.result +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/2458.result @@ -10,13 +10,13 @@ insert into t1 values (1,1),(2,2),(3,3); insert into t2 values (1),(2),(3); explain select t1.* from t1 left join t2 using(f1) group by t1.f1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index NULL PRIMARY 4 NULL NA +1 SIMPLE t1 ALL NULL NULL NULL NULL NA Using temporary; Using filesort 1 SIMPLE t2 ref f1 f1 4 test.t1.f1 NA Using index alter table t1 drop primary key; alter table t1 add index (f1) clustering=yes; explain select t1.* from t1 left join t2 using(f1) group by t1.f1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index NULL f1 4 NULL NA +1 SIMPLE t1 index NULL f1 4 NULL NA Using index 1 SIMPLE t2 ref f1 f1 4 test.t1.f1 NA Using index drop table t1,t2; # diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/2548.result b/storage/tokudb/mysql-test/tokudb_bugs/r/2548.result index b70ab5063fd..87df2a875a0 100644 --- a/storage/tokudb/mysql-test/tokudb_bugs/r/2548.result +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/2548.result @@ -4,14 +4,14 @@ create table foo (a int, b int, c int, primary key (a), key (b) clustering=yes); replace into foo values (1,10,100), (2,20,200), (1,10,1000); explain select * from foo; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE foo ALL NULL NULL NULL NULL 2 +1 SIMPLE foo index NULL b 5 NULL 2 Using index select * from foo; a b c 1 10 1000 2 20 200 explain select * from foo order by b desc; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE foo index NULL b 5 NULL 2 +1 SIMPLE foo index NULL b 5 NULL 2 Using index select * from foo order by b desc; a b c 2 20 200 @@ -21,7 +21,7 @@ Warnings: Warning 1062 Duplicate entry '1' for key 'PRIMARY' explain select * from foo; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE foo ALL NULL NULL NULL NULL 3 +1 SIMPLE foo index NULL b 5 NULL 3 Using index select * from foo; a b c 1 10 1000 @@ -29,7 +29,7 @@ a b c 3 30 300 explain select * from foo order by b desc; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE foo index NULL b 5 NULL 3 +1 SIMPLE foo index NULL b 5 NULL 3 Using index select * from foo order by b desc; a b c 3 30 300 diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/3015.result b/storage/tokudb/mysql-test/tokudb_bugs/r/3015.result index 7ca01b20e83..e6493dbda5c 100644 --- a/storage/tokudb/mysql-test/tokudb_bugs/r/3015.result +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/3015.result @@ -5,10 +5,10 @@ create table foo (a int, b int, c int, d int, primary key (a), key (b), key (c) insert into foo values (1,100,1000,1),(2,20,200,2),(3,300,30,3),(4,4,4,4); select * from foo; a b c d -1 100 1000 1 -2 20 200 2 -3 300 30 3 4 4 4 4 +3 300 30 3 +2 20 200 2 +1 100 1000 1 explain select b,a from foo; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE foo index NULL b 5 NULL 4 Using index @@ -30,10 +30,10 @@ a b c d update foo set d=d+100; select * from foo; a b c d -1 100 1000 101 -2 20 200 102 -3 300 30 103 4 4 4 104 +3 300 30 103 +2 20 200 102 +1 100 1000 101 explain select b,a from foo; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE foo index NULL b 5 NULL 4 Using index @@ -55,10 +55,10 @@ a b c d update foo set b=b+1; select * from foo; a b c d -1 101 1000 101 -2 21 200 102 -3 301 30 103 4 5 4 104 +3 301 30 103 +2 21 200 102 +1 101 1000 101 explain select b,a from foo; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE foo index NULL b 5 NULL 4 Using index @@ -80,10 +80,10 @@ a b c d update foo set c=c*10; select * from foo; a b c d -1 101 10000 101 -2 21 2000 102 -3 301 300 103 4 5 40 104 +3 301 300 103 +2 21 2000 102 +1 101 10000 101 explain select b,a from foo; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE foo index NULL b 5 NULL 4 Using index diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/3083.result b/storage/tokudb/mysql-test/tokudb_bugs/r/3083.result index fd8b98076fa..6e633981a63 100644 --- a/storage/tokudb/mysql-test/tokudb_bugs/r/3083.result +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/3083.result @@ -6,7 +6,7 @@ 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 ALL NULL NULL NULL NULL 5 +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 @@ -16,7 +16,7 @@ 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 ALL NULL NULL NULL NULL 5 +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 diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/bulk_fetch.result b/storage/tokudb/mysql-test/tokudb_bugs/r/bulk_fetch.result index 22bbc021a4f..86943c2d2f6 100644 --- a/storage/tokudb/mysql-test/tokudb_bugs/r/bulk_fetch.result +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/bulk_fetch.result @@ -62,7 +62,7 @@ c 600 explain select * from foo where c > 300; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE foo range c c 5 NULL 3 Using where +1 SIMPLE foo range c c 5 NULL 3 Using where; Using index select * from foo where c > 300; a b c 4 40 400 diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/index_read.result b/storage/tokudb/mysql-test/tokudb_bugs/r/index_read.result index 02bb31dcd8a..5d5c4d43cd8 100644 --- a/storage/tokudb/mysql-test/tokudb_bugs/r/index_read.result +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/index_read.result @@ -73,14 +73,14 @@ alter table foo drop primary key; alter table foo add index clst_a(a,b) clustering=yes; explain select * from foo where a=4; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE foo ref clst_a clst_a 4 const NULL; +1 SIMPLE foo ref clst_a clst_a 4 const NULL; Using index select * from foo where a=4; a b c 4 40 400 4 400 400 explain select * from foo where a>4; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE foo range clst_a clst_a 4 NULL NULL; Using where +1 SIMPLE foo range clst_a clst_a 4 NULL NULL; Using where; Using index select * from foo where a>4; a b c 5 50 500 @@ -89,7 +89,7 @@ a b c 6 600 600 explain select * from foo where a<3 order by a desc; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE foo range clst_a clst_a 4 NULL NULL; Using where +1 SIMPLE foo range clst_a clst_a 4 NULL NULL; Using where; Using index select * from foo where a<3 order by a desc; a b c 2 200 200 @@ -98,7 +98,7 @@ a b c 1 10 100 explain select * from foo where a>=4; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE foo range clst_a clst_a 4 NULL NULL; Using where +1 SIMPLE foo range clst_a clst_a 4 NULL NULL; Using where; Using index select * from foo where a>=4; a b c 4 40 400 @@ -109,7 +109,7 @@ a b c 6 600 600 explain select * from foo where a<=2 order by a desc; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE foo range clst_a clst_a 4 NULL NULL; Using where +1 SIMPLE foo range clst_a clst_a 4 NULL NULL; Using where; Using index select * from foo where a<=2 order by a desc; a b c 2 200 200 @@ -118,7 +118,7 @@ a b c 1 10 100 explain select * from foo where a=4 order by b desc; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE foo ref clst_a clst_a 4 const NULL; Using where +1 SIMPLE foo ref clst_a clst_a 4 const NULL; Using where; Using index select * from foo where a=4 order by b desc; a b c 4 400 400 diff --git a/storage/tokudb/mysql-test/tokudb_mariadb/r/clustering.result b/storage/tokudb/mysql-test/tokudb_mariadb/r/clustering.result index 4eaab9ee859..86f6fd4cdc2 100644 --- a/storage/tokudb/mysql-test/tokudb_mariadb/r/clustering.result +++ b/storage/tokudb/mysql-test/tokudb_mariadb/r/clustering.result @@ -24,7 +24,7 @@ a b c 8 8 8 explain select a,c from t1 where a > 2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 5 NULL 6 Using where +1 SIMPLE t1 range a a 5 NULL 6 Using where; Using index explain select b,c from t1 where b > 2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL b NULL NULL NULL 8 Using where