summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVarun Gupta <varunraiko1803@gmail.com>2018-02-21 16:01:50 +0200
committerVarun Gupta <varunraiko1803@gmail.com>2018-02-21 16:01:50 +0200
commitdbbaaff0fbce203e8c785179b1c559f82f869a69 (patch)
tree7c2f7b683ecf5de051b53cf2bbc97560a4e63c9e
parent5df9e8de638bcb0c0c877a56e01ae5c59062249a (diff)
downloadmariadb-git-10.3-MDEV-7773.tar.gz
MDEV-15253:Default optimizer setting changes for MariaDB 10.310.3-MDEV-7773
Milestone 1: raising join_cache_level to 4 from 2
-rw-r--r--mysql-test/r/compress.result22
-rw-r--r--mysql-test/r/ctype_utf8.result4
-rw-r--r--mysql-test/r/ctype_utf8mb4.result4
-rw-r--r--mysql-test/r/ctype_utf8mb4_heap.result4
-rw-r--r--mysql-test/r/ctype_utf8mb4_innodb.result4
-rw-r--r--mysql-test/r/ctype_utf8mb4_myisam.result4
-rw-r--r--mysql-test/r/delete.result6
-rw-r--r--mysql-test/r/derived.result14
-rw-r--r--mysql-test/r/derived_opt.result32
-rw-r--r--mysql-test/r/derived_view.result72
-rw-r--r--mysql-test/r/distinct.result12
-rw-r--r--mysql-test/r/explain_json.result275
-rw-r--r--mysql-test/r/explain_json_innodb.result35
-rw-r--r--mysql-test/r/func_concat.result2
-rw-r--r--mysql-test/r/func_in.result8
-rw-r--r--mysql-test/r/func_isnull.result4
-rw-r--r--mysql-test/r/func_misc.result4
-rw-r--r--mysql-test/r/func_str.result2
-rw-r--r--mysql-test/r/grant_explain_non_select.result4
-rw-r--r--mysql-test/r/group_by.result18
-rw-r--r--mysql-test/r/group_by_innodb.result2
-rw-r--r--mysql-test/r/group_min_max.result6
-rw-r--r--mysql-test/r/index_intersect.result2
-rw-r--r--mysql-test/r/index_intersect_innodb.result2
-rw-r--r--mysql-test/r/information_schema.result4
-rw-r--r--mysql-test/r/join.result68
-rw-r--r--mysql-test/r/join_cache.result40
-rw-r--r--mysql-test/r/join_nested_jcl6.result2
-rw-r--r--mysql-test/r/join_optimizer.result2
-rw-r--r--mysql-test/r/join_outer_innodb.result88
-rw-r--r--mysql-test/r/join_outer_jcl6.result58
-rw-r--r--mysql-test/r/key_cache.result14
-rw-r--r--mysql-test/r/limit_rows_examined.result2
-rw-r--r--mysql-test/r/mdev13607.result800
-rw-r--r--mysql-test/r/mysqld--help.result2
-rw-r--r--mysql-test/r/null_key.result18
-rw-r--r--mysql-test/r/opt_tvc.result36
-rw-r--r--mysql-test/r/order_by.result74
-rw-r--r--mysql-test/r/pool_of_threads.result22
-rw-r--r--mysql-test/r/select_jcl6.result2
-rw-r--r--mysql-test/r/select_safe.result4
-rw-r--r--mysql-test/r/signal_demo1.result2
-rw-r--r--mysql-test/r/ssl.result22
-rw-r--r--mysql-test/r/ssl_compress.result22
-rw-r--r--mysql-test/r/stat_tables_disabled.result12
-rw-r--r--mysql-test/r/stat_tables_innodb.result80
-rw-r--r--mysql-test/r/subselect2.result24
-rw-r--r--mysql-test/r/subselect3_jcl6.result2
-rw-r--r--mysql-test/r/subselect4.result8
-rw-r--r--mysql-test/r/subselect_cache.result22
-rw-r--r--mysql-test/r/subselect_exists2in.result6
-rw-r--r--mysql-test/r/subselect_extra.result10
-rw-r--r--mysql-test/r/subselect_innodb.result2
-rw-r--r--mysql-test/r/subselect_mat_cost.result76
-rw-r--r--mysql-test/r/subselect_mat_cost_bugs.result14
-rw-r--r--mysql-test/r/subselect_sj2_jcl6.result2
-rw-r--r--mysql-test/r/subselect_sj_jcl6.result2
-rw-r--r--mysql-test/r/subselect_sj_nonmerged.result20
-rw-r--r--mysql-test/r/table_elim.result8
-rw-r--r--mysql-test/r/table_elim_debug.result2
-rw-r--r--mysql-test/r/table_value_constr.result8
-rw-r--r--mysql-test/r/tmp_table_count-7586.result2
-rw-r--r--mysql-test/r/type_time_6065.result50
-rw-r--r--mysql-test/suite/gcol/r/gcol_keys_innodb.result4
-rw-r--r--mysql-test/suite/heap/heap_btree.result8
-rw-r--r--mysql-test/suite/heap/heap_hash.result6
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug30423.result8
-rw-r--r--mysql-test/suite/maria/icp.result6
-rw-r--r--mysql-test/suite/optimizer_unfixed_bugs/r/bug45221.result2
-rw-r--r--mysql-test/suite/sys_vars/r/join_cache_level_basic.result12
-rw-r--r--mysql-test/suite/sys_vars/r/max_seeks_for_key_func.result20
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result6
-rw-r--r--mysql-test/suite/versioning/r/derived.result4
-rw-r--r--mysql-test/suite/versioning/r/select.result10
-rw-r--r--sql/sys_vars.cc2
75 files changed, 1165 insertions, 1097 deletions
diff --git a/mysql-test/r/compress.result b/mysql-test/r/compress.result
index 762ab6630d8..39ad137dc96 100644
--- a/mysql-test/r/compress.result
+++ b/mysql-test/r/compress.result
@@ -605,19 +605,19 @@ fld3
explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by t3.t2nr,fld3;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL fld1 NULL NULL NULL 1199 Using where; Using temporary; Using filesort
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.fld1 1 Using where; Using index
+1 SIMPLE t3 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t2.fld1 41810 Using where; Using index; Using join buffer (flat, BNLH join)
explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using filesort
-1 SIMPLE t3 ref period period 4 test.t1.period 4181
+1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using temporary; Using filesort
+1 SIMPLE t3 hash_ALL period #hash#period 4 test.t1.period 41810 Using join buffer (flat, BNLH join)
explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t3 index period period 4 NULL 1
-1 SIMPLE t1 ref period period 4 test.t3.period 4181
+1 SIMPLE t3 ALL period NULL NULL NULL 41810 Using temporary; Using filesort
+1 SIMPLE t1 hash_ALL period #hash#period 4 test.t3.period 41810 Using join buffer (flat, BNLH join)
explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index period period 4 NULL 1
-1 SIMPLE t3 ref period period 4 test.t1.period 4181
+1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using temporary; Using filesort
+1 SIMPLE t3 hash_ALL period #hash#period 4 test.t1.period 41810 Using join buffer (flat, BNLH join)
select period from t1;
period
9410
@@ -1386,15 +1386,15 @@ delete from t2 where fld1=999999;
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
-1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
+1 SIMPLE t4 hash_ALL PRIMARY #hash#PRIMARY 1 test.t2.companynr 12 Using join buffer (flat, BNLH join)
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
-1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
+1 SIMPLE t4 hash_ALL PRIMARY #hash#PRIMARY 1 test.t2.companynr 12 Using join buffer (flat, BNLH join)
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
-1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
+1 SIMPLE t4 hash_ALL PRIMARY #hash#PRIMARY 1 test.t2.companynr 12 Using join buffer (flat, BNLH join)
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
@@ -1439,7 +1439,7 @@ companynr companynr
explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using index; Using temporary
-1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 1 func 1199 Using where; Using join buffer (flat, BNLH join)
select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008;
fld1 companynr fld3 period
038008 37 reporters 1008
diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result
index dfe96d1a904..e28d2920532 100644
--- a/mysql-test/r/ctype_utf8.result
+++ b/mysql-test/r/ctype_utf8.result
@@ -1796,8 +1796,8 @@ insert into t1 values ('123'), ('456');
explain
select substr(Z.a,-1), Z.a from t1 as Y join t1 as Z on Y.a=Z.a order by 1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE Y ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
-1 SIMPLE Z ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE Y ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort
+1 SIMPLE Z hash_ALL NULL #hash#$hj 31 test.Y.a 2 Using where; Using join buffer (flat, BNLH join)
select substr(Z.a,-1), Z.a from t1 as Y join t1 as Z on Y.a=Z.a order by 1;
substr(Z.a,-1) a
3 123
diff --git a/mysql-test/r/ctype_utf8mb4.result b/mysql-test/r/ctype_utf8mb4.result
index fbe95d9f44b..1b68c7e1407 100644
--- a/mysql-test/r/ctype_utf8mb4.result
+++ b/mysql-test/r/ctype_utf8mb4.result
@@ -1821,8 +1821,8 @@ insert into t1 values ('123'), ('456');
explain
select substr(Z.a,-1), Z.a from t1 as Y join t1 as Z on Y.a=Z.a order by 1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE Y ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
-1 SIMPLE Z ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE Y ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort
+1 SIMPLE Z hash_ALL NULL #hash#$hj 41 test.Y.a 2 Using where; Using join buffer (flat, BNLH join)
select substr(Z.a,-1), Z.a from t1 as Y join t1 as Z on Y.a=Z.a order by 1;
substr(Z.a,-1) a
3 123
diff --git a/mysql-test/r/ctype_utf8mb4_heap.result b/mysql-test/r/ctype_utf8mb4_heap.result
index d82ed89be9c..d424e4c598c 100644
--- a/mysql-test/r/ctype_utf8mb4_heap.result
+++ b/mysql-test/r/ctype_utf8mb4_heap.result
@@ -1653,8 +1653,8 @@ insert into t1 values ('123'), ('456');
explain
select substr(Z.a,-1), Z.a from t1 as Y join t1 as Z on Y.a=Z.a order by 1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE Y ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
-1 SIMPLE Z ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE Y ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort
+1 SIMPLE Z hash_ALL NULL #hash#$hj 41 test.Y.a 2 Using where; Using join buffer (flat, BNLH join)
select substr(Z.a,-1), Z.a from t1 as Y join t1 as Z on Y.a=Z.a order by 1;
substr(Z.a,-1) a
3 123
diff --git a/mysql-test/r/ctype_utf8mb4_innodb.result b/mysql-test/r/ctype_utf8mb4_innodb.result
index 956b2f83d9e..4c7e42e1afe 100644
--- a/mysql-test/r/ctype_utf8mb4_innodb.result
+++ b/mysql-test/r/ctype_utf8mb4_innodb.result
@@ -1779,8 +1779,8 @@ insert into t1 values ('123'), ('456');
explain
select substr(Z.a,-1), Z.a from t1 as Y join t1 as Z on Y.a=Z.a order by 1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE Y ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
-1 SIMPLE Z ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE Y ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort
+1 SIMPLE Z hash_ALL NULL #hash#$hj 41 test.Y.a 2 Using where; Using join buffer (flat, BNLH join)
select substr(Z.a,-1), Z.a from t1 as Y join t1 as Z on Y.a=Z.a order by 1;
substr(Z.a,-1) a
3 123
diff --git a/mysql-test/r/ctype_utf8mb4_myisam.result b/mysql-test/r/ctype_utf8mb4_myisam.result
index fd58e12542c..4b914f1a7b8 100644
--- a/mysql-test/r/ctype_utf8mb4_myisam.result
+++ b/mysql-test/r/ctype_utf8mb4_myisam.result
@@ -1786,8 +1786,8 @@ insert into t1 values ('123'), ('456');
explain
select substr(Z.a,-1), Z.a from t1 as Y join t1 as Z on Y.a=Z.a order by 1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE Y ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
-1 SIMPLE Z ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE Y ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort
+1 SIMPLE Z hash_ALL NULL #hash#$hj 41 test.Y.a 2 Using where; Using join buffer (flat, BNLH join)
select substr(Z.a,-1), Z.a from t1 as Y join t1 as Z on Y.a=Z.a order by 1;
substr(Z.a,-1) a
3 123
diff --git a/mysql-test/r/delete.result b/mysql-test/r/delete.result
index ed3683d52f9..3ddec34d7ca 100644
--- a/mysql-test/r/delete.result
+++ b/mysql-test/r/delete.result
@@ -205,13 +205,13 @@ insert into t3 values (1,1),(2,1),(1,3);
select * from t1,t2,t3 where t1.a=t2.a AND t2.b=t3.a and t1.b=t3.b;
a b a b a b
1 1 1 1 1 1
-2 1 2 2 2 1
1 3 1 1 1 3
+2 1 2 2 2 1
explain select * from t1,t2,t3 where t1.a=t2.a AND t2.b=t3.a and t1.b=t3.b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
-1 SIMPLE t2 ref PRIMARY PRIMARY 4 test.t1.a 1 Using index
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 8 test.t2.b,test.t1.b 1 Using index
+1 SIMPLE t2 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:8 test.t1.a 3 Using index; Using join buffer (flat, BNLH join)
+1 SIMPLE t3 hash_index PRIMARY #hash#PRIMARY:PRIMARY 8:8 test.t2.b,test.t1.b 3 Using index; Using join buffer (incremental, BNLH join)
delete t2.*,t3.* from t1,t2,t3 where t1.a=t2.a AND t2.b=t3.a and t1.b=t3.b;
select * from t3;
a b
diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result
index ebbc08aa958..78ce4a1d746 100644
--- a/mysql-test/r/derived.result
+++ b/mysql-test/r/derived.result
@@ -191,15 +191,15 @@ pla_id test
explain SELECT STRAIGHT_JOIN d.pla_id, m2.mat_id FROM t1 m2 INNER JOIN (SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id) d ON d.matintnum=m2.matintnum;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY m2 ALL NULL NULL NULL NULL 9
-1 PRIMARY <derived2> ALL NULL NULL NULL NULL 9 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY <derived2> hash_ALL NULL #hash#$hj 7 test.m2.matintnum 9 Using where; Using join buffer (flat, BNLH join)
2 DERIVED mp ALL NULL NULL NULL NULL 9 Using temporary; Using filesort
-2 DERIVED m1 eq_ref PRIMARY PRIMARY 3 test.mp.mat_id 1
+2 DERIVED m1 hash_ALL PRIMARY #hash#PRIMARY 3 test.mp.mat_id 9 Using join buffer (flat, BNLH join)
explain SELECT STRAIGHT_JOIN d.pla_id, m2.test FROM t1 m2 INNER JOIN (SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id) d ON d.matintnum=m2.matintnum;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY m2 ALL NULL NULL NULL NULL 9
-1 PRIMARY <derived2> ALL NULL NULL NULL NULL 9 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY <derived2> hash_ALL NULL #hash#$hj 7 test.m2.matintnum 9 Using where; Using join buffer (flat, BNLH join)
2 DERIVED mp ALL NULL NULL NULL NULL 9 Using temporary; Using filesort
-2 DERIVED m1 eq_ref PRIMARY PRIMARY 3 test.mp.mat_id 1
+2 DERIVED m1 hash_ALL PRIMARY #hash#PRIMARY 3 test.mp.mat_id 9 Using join buffer (flat, BNLH join)
drop table t1,t2;
SELECT a.x FROM (SELECT 1 AS x) AS a HAVING a.x = 1;
x
@@ -236,7 +236,7 @@ count(*)
explain select count(*) from t1 INNER JOIN (SELECT A.E1, A.E2, A.E3 FROM t1 AS A WHERE A.E3 = (SELECT MAX(B.E3) FROM t1 AS B WHERE A.E2 = B.E2)) AS THEMAX ON t1.E1 = THEMAX.E2 AND t1.E1 = t1.E2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2
-1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 THEMAX.E2 1 Using where
+1 PRIMARY t1 hash_ALL PRIMARY #hash#PRIMARY 4 THEMAX.E2 2 Using where; Using join buffer (flat, BNLH join)
2 DERIVED A ALL NULL NULL NULL NULL 2 Using where
3 DEPENDENT SUBQUERY B ALL NULL NULL NULL NULL 2 Using where
drop table t1;
@@ -317,8 +317,8 @@ b 3.5000
explain SELECT s.name, AVG(s.val) AS median FROM (SELECT x.name, x.val FROM t1 x, t1 y WHERE x.name=y.name GROUP BY x.name, x.val HAVING SUM(y.val <= x.val) >= COUNT(*)/2 AND SUM(y.val >= x.val) >= COUNT(*)/2) AS s GROUP BY s.name;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 289 Using temporary; Using filesort
-2 DERIVED x ALL NULL NULL NULL NULL 17 Using temporary; Using filesort
-2 DERIVED y ALL NULL NULL NULL NULL 17 Using where; Using join buffer (flat, BNL join)
+2 DERIVED x ALL NULL NULL NULL NULL 17 Using where; Using temporary; Using filesort
+2 DERIVED y hash_ALL NULL #hash#$hj 2 test.x.name 17 Using where; Using join buffer (flat, BNLH join)
drop table t1;
create table t2 (a int, b int, primary key (a));
insert into t2 values (1,7),(2,7);
diff --git a/mysql-test/r/derived_opt.result b/mysql-test/r/derived_opt.result
index 6e4ea1b5d36..e3e0df862ea 100644
--- a/mysql-test/r/derived_opt.result
+++ b/mysql-test/r/derived_opt.result
@@ -75,32 +75,32 @@ insert into t1 values (NULL, 'a', 1), (NULL, 'b', 2), (NULL, 'c', 3), (NULL, 'd'
insert into t2 values (1, 100), (1, 101), (1, 102), (2, 100), (2, 103), (2, 104), (3, 101), (3, 102), (3, 105);
SELECT STRAIGHT_JOIN d.pla_id, m2.mat_id FROM t1 m2 INNER JOIN (SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id) d ON d.matintnum=m2.matintnum;
pla_id mat_id
-102 1
-101 1
100 1
-104 2
+101 1
+102 1
103 2
+104 2
105 3
SELECT STRAIGHT_JOIN d.pla_id, m2.test FROM t1 m2 INNER JOIN (SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id) d ON d.matintnum=m2.matintnum;
pla_id test
-102 1
-101 1
100 1
-104 2
+101 1
+102 1
103 2
+104 2
105 3
explain SELECT STRAIGHT_JOIN d.pla_id, m2.mat_id FROM t1 m2 INNER JOIN (SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id) d ON d.matintnum=m2.matintnum;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY m2 ALL NULL NULL NULL NULL 9
-1 PRIMARY <derived2> ref key0 key0 7 test.m2.matintnum 2
+1 PRIMARY <derived2> hash_ALL key0 #hash#key0 7 test.m2.matintnum 9 Using join buffer (flat, BNLH join)
2 DERIVED mp ALL NULL NULL NULL NULL 9 Using temporary; Using filesort
-2 DERIVED m1 eq_ref PRIMARY PRIMARY 3 test.mp.mat_id 1
+2 DERIVED m1 hash_ALL PRIMARY #hash#PRIMARY 3 test.mp.mat_id 9 Using join buffer (flat, BNLH join)
explain SELECT STRAIGHT_JOIN d.pla_id, m2.test FROM t1 m2 INNER JOIN (SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id) d ON d.matintnum=m2.matintnum;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY m2 ALL NULL NULL NULL NULL 9
-1 PRIMARY <derived2> ref key0 key0 7 test.m2.matintnum 2
+1 PRIMARY <derived2> hash_ALL key0 #hash#key0 7 test.m2.matintnum 9 Using join buffer (flat, BNLH join)
2 DERIVED mp ALL NULL NULL NULL NULL 9 Using temporary; Using filesort
-2 DERIVED m1 eq_ref PRIMARY PRIMARY 3 test.mp.mat_id 1
+2 DERIVED m1 hash_ALL PRIMARY #hash#PRIMARY 3 test.mp.mat_id 9 Using join buffer (flat, BNLH join)
drop table t1,t2;
create table t1 (E1 INTEGER UNSIGNED NOT NULL, E2 INTEGER UNSIGNED NOT NULL, E3 INTEGER UNSIGNED NOT NULL, PRIMARY KEY(E1)
);
@@ -111,7 +111,7 @@ count(*)
explain select count(*) from t1 INNER JOIN (SELECT A.E1, A.E2, A.E3 FROM t1 AS A WHERE A.E3 = (SELECT MAX(B.E3) FROM t1 AS B WHERE A.E2 = B.E2)) AS THEMAX ON t1.E1 = THEMAX.E2 AND t1.E1 = t1.E2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY A ALL NULL NULL NULL NULL 2 Using where
-1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.A.E2 1 Using where
+1 PRIMARY t1 hash_ALL PRIMARY #hash#PRIMARY 4 test.A.E2 2 Using where; Using join buffer (flat, BNLH join)
3 DEPENDENT SUBQUERY B ALL NULL NULL NULL NULL 2 Using where
drop table t1;
create table t1 (a int);
@@ -324,13 +324,13 @@ JOIN t4 AS td ON tc.a = td.a) tu)
limit 10;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL #
-1 PRIMARY tx eq_ref PRIMARY PRIMARY 4 tu.pk # Using index
-1 PRIMARY ty eq_ref PRIMARY PRIMARY 4 tu.pk # Using index
+1 PRIMARY tx hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 tu.pk # Using index; Using join buffer (flat, BNLH join)
+1 PRIMARY ty hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 tu.pk # Using index; Using join buffer (incremental, BNLH join)
2 MATERIALIZED <derived3> ALL NULL NULL NULL NULL #
3 DERIVED td system PRIMARY NULL NULL NULL # Using temporary
-3 DERIVED tc ref PRIMARY,a a 3 const #
-3 DERIVED ta eq_ref PRIMARY PRIMARY 4 test.tc.pk # Using index
-3 DERIVED tb eq_ref PRIMARY PRIMARY 4 test.tc.pk # Using index; Distinct
+3 DERIVED tc ref PRIMARY,a a 3 const # Using index condition
+3 DERIVED ta hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.tc.pk # Using index; Using join buffer (flat, BNLH join)
+3 DERIVED tb hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.tc.pk # Using index; Using join buffer (incremental, BNLH join)
SELECT * FROM t3 AS tX JOIN t2 AS tY ON (tX.pk = tY.pk)
WHERE
tX.pk IN
diff --git a/mysql-test/r/derived_view.result b/mysql-test/r/derived_view.result
index 85e56ff176e..74815a9b2da 100644
--- a/mysql-test/r/derived_view.result
+++ b/mysql-test/r/derived_view.result
@@ -2015,8 +2015,8 @@ FROM t1, (SELECT t2.b, t2.c FROM t3 RIGHT JOIN t2 ON t2.a = t3.b) AS t
WHERE t.b AND t.c = t1.a;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t3 system NULL NULL NULL NULL 0 0.00 Const row not found
-1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
-1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 4 test.t1.a 2 100.00 Using where; Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t1`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`c` = `test`.`t1`.`a` and `test`.`t2`.`b` <> 0
SELECT t.b, t.c, t1.a
@@ -2030,8 +2030,8 @@ FROM t1, (SELECT t2.b, t2.c FROM t3 RIGHT JOIN t2 ON t2.a = t3.b) AS t
WHERE t.b <> 0 AND t.c = t1.a;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t3 system NULL NULL NULL NULL 0 0.00 Const row not found
-1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
-1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 4 test.t1.a 2 100.00 Using where; Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t1`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`c` = `test`.`t1`.`a` and `test`.`t2`.`b` <> 0
SELECT t.b, t.c, t1.a
@@ -2045,8 +2045,8 @@ SELECT t.b, t.c, t1.a
FROM t1, (SELECT t2.b, t2.c FROM t3 RIGHT JOIN t2 ON t2.a = t3.b) AS t
WHERE t.b AND t.c = t1.a;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
-1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 4 test.t1.a 2 100.00 Using where; Using join buffer (flat, BNLH join)
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Note 1003 select `test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t1`.`a` AS `a` from `test`.`t1` join `test`.`t2` left join `test`.`t3` on(`test`.`t3`.`b` = `test`.`t2`.`a`) where `test`.`t2`.`c` = `test`.`t1`.`a` and `test`.`t2`.`b` <> 0
@@ -2060,8 +2060,8 @@ SELECT t.b, t.c, t1.a
FROM t1, (SELECT t2.b, t2.c FROM t3 RIGHT JOIN t2 ON t2.a = t3.b) AS t
WHERE t.b <> 0 AND t.c = t1.a;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
-1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 4 test.t1.a 2 100.00 Using where; Using join buffer (flat, BNLH join)
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Note 1003 select `test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t1`.`a` AS `a` from `test`.`t1` join `test`.`t2` left join `test`.`t3` on(`test`.`t3`.`b` = `test`.`t2`.`a`) where `test`.`t2`.`c` = `test`.`t1`.`a` and `test`.`t2`.`b` <> 0
@@ -2186,7 +2186,7 @@ explain SELECT * FROM (SELECT t1.* FROM t1, t2) AS t JOIN t3 ON t3.a = t.b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t3 system NULL NULL NULL NULL 1
1 SIMPLE t2 ALL NULL NULL NULL NULL 5
-1 SIMPLE t1 ALL NULL NULL NULL NULL 21 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t1 hash_ALL NULL #hash#$hj 38 const 21 Using where; Using join buffer (flat, BNLH join)
SELECT * FROM (SELECT t1.* FROM t1, t2) AS t JOIN t3 ON t3.a = t.b;
a b a
USA Miami Miami
@@ -2521,7 +2521,7 @@ EXPLAIN EXTENDED
SELECT v1.c1, v1.c2 FROM v1, t2 WHERE v1.c1=t2.c1 AND v1.c2=t2.c2;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.c2 2 100.00 Using where
+1 PRIMARY <derived2> hash_ALL key0 #hash#key0 8 test.t2.c1,test.t2.c2 5 40.00 Using join buffer (flat, BNLH join)
2 DERIVED t1 ALL NULL NULL NULL NULL 5 100.00
Warnings:
Note 1003 /* select#1 */ select `v1`.`c1` AS `c1`,`v1`.`c2` AS `c2` from `test`.`v1` join `test`.`t2` where `v1`.`c1` = `test`.`t2`.`c1` and `v1`.`c2` = `test`.`t2`.`c2`
@@ -2534,7 +2534,7 @@ SELECT t2.c1, t2.c2 FROM (SELECT c1 g, MAX(c2) m FROM t1 GROUP BY c1) t, t2
WHERE t.g=t2.c1 AND t.m=t2.c2;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.c2 2 100.00 Using where
+1 PRIMARY <derived2> hash_ALL key0 #hash#key0 8 test.t2.c1,test.t2.c2 5 40.00 Using join buffer (flat, BNLH join)
2 DERIVED t1 ALL NULL NULL NULL NULL 5 100.00 Using temporary; Using filesort
Warnings:
Note 1003 /* select#1 */ select `test`.`t2`.`c1` AS `c1`,`test`.`t2`.`c2` AS `c2` from (/* select#2 */ select `test`.`t1`.`c1` AS `g`,max(`test`.`t1`.`c2`) AS `m` from `test`.`t1` group by `test`.`t1`.`c1`) `t` join `test`.`t2` where `t`.`g` = `test`.`t2`.`c1` and `t`.`m` = `test`.`t2`.`c2`
@@ -2545,14 +2545,22 @@ c 3
EXPLAIN EXTENDED
SELECT v1.c1, v1.c2, t2.c1, t2.c2 FROM v1, t2 WHERE v1.c1=t2.c1;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00
-1 PRIMARY <derived2> ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
+1 PRIMARY <derived2> hash_ALL key0 #hash#key0 3 test.t2.c1 5 40.00 Using join buffer (flat, BNLH join)
2 DERIVED t1 ALL NULL NULL NULL NULL 5 100.00
Warnings:
Note 1003 /* select#1 */ select `v1`.`c1` AS `c1`,`v1`.`c2` AS `c2`,`test`.`t2`.`c1` AS `c1`,`test`.`t2`.`c2` AS `c2` from `test`.`v1` join `test`.`t2` where `v1`.`c1` = `test`.`t2`.`c1`
SELECT v1.c1, v1.c2, t2.c1, t2.c2 FROM v1, t2 WHERE v1.c1=t2.c1;
c1 c2 c1 c2
+a 1 b 2
+a 1 c 3
+c 3 b 2
c 3 c 3
+g 7 b 2
+g 7 c 3
+d 4 b 2
+d 4 c 3
+c 3 b 2
c 3 c 3
DROP VIEW v1;
DROP TABLE t1,t2;
@@ -2697,8 +2705,8 @@ ON p.id = g.p_random
ORDER BY gallery_name ASC
;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY <derived2> ALL NULL NULL NULL NULL 10 Using filesort
-1 PRIMARY p eq_ref PRIMARY PRIMARY 4 g.p_random 1 Using where
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 10 Using temporary; Using filesort
+1 PRIMARY p hash_ALL PRIMARY #hash#PRIMARY 4 g.p_random 38 Using where; Using join buffer (flat, BNLH join)
2 DERIVED gal ALL NULL NULL NULL NULL 10
3 DEPENDENT SUBQUERY pi ref gallery_id gallery_id 4 test.gal.id 4 Using temporary; Using filesort
drop table galleries, pictures;
@@ -2865,9 +2873,9 @@ GROUP BY mp.pla_id) d
ON d.matintnum=m2.matintnum;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY m2 ALL NULL NULL NULL NULL 9
-1 PRIMARY <derived2> ref key0 key0 7 test.m2.matintnum 2
+1 PRIMARY <derived2> hash_ALL key0 #hash#key0 7 test.m2.matintnum 9 Using join buffer (flat, BNLH join)
2 DERIVED mp ALL NULL NULL NULL NULL 9 Using temporary; Using filesort
-2 DERIVED m1 eq_ref PRIMARY PRIMARY 3 test.mp.mat_id 1
+2 DERIVED m1 hash_ALL PRIMARY #hash#PRIMARY 3 test.mp.mat_id 9 Using join buffer (flat, BNLH join)
prepare stmt1 from
"SELECT STRAIGHT_JOIN d.pla_id, m2.mat_id
FROM t1 m2
@@ -2879,43 +2887,43 @@ prepare stmt1 from
flush status;
execute stmt1;
pla_id mat_id
-102 1
-101 1
100 1
-104 2
+101 1
+102 1
103 2
+104 2
105 3
show status like '%Handler_read%';
Variable_name Value
Handler_read_first 0
-Handler_read_key 21
+Handler_read_key 9
Handler_read_last 0
-Handler_read_next 6
+Handler_read_next 0
Handler_read_prev 0
Handler_read_retry 0
Handler_read_rnd 6
Handler_read_rnd_deleted 0
-Handler_read_rnd_next 27
+Handler_read_rnd_next 44
flush status;
execute stmt1;
pla_id mat_id
-102 1
-101 1
100 1
-104 2
+101 1
+102 1
103 2
+104 2
105 3
show status like '%Handler_read%';
Variable_name Value
Handler_read_first 0
-Handler_read_key 21
+Handler_read_key 9
Handler_read_last 0
-Handler_read_next 6
+Handler_read_next 0
Handler_read_prev 0
Handler_read_retry 0
Handler_read_rnd 6
Handler_read_rnd_deleted 0
-Handler_read_rnd_next 27
+Handler_read_rnd_next 44
deallocate prepare stmt1;
drop table t1,t2;
#
@@ -2944,16 +2952,16 @@ test.t2 analyze status OK
explain select a from t1 where a in (select b from t2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 7 Using where
-1 PRIMARY t2 ref idx idx 5 test.t1.a 140 Using index; FirstMatch(t1)
+1 PRIMARY t2 hash_index idx #hash#idx:idx 5:5 test.t1.a 6144 Using index; FirstMatch(t1); Using join buffer (flat, BNLH join)
explain select * from (select a from t1 where a in (select b from t2)) t;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 7 Using where
-1 PRIMARY t2 ref idx idx 5 test.t1.a 140 Using index; FirstMatch(t1)
+1 PRIMARY t2 hash_index idx #hash#idx:idx 5:5 test.t1.a 6144 Using index; FirstMatch(t1); Using join buffer (flat, BNLH join)
create view v1 as select a from t1 where a in (select b from t2);
explain select * from v1;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 7 Using where
-1 PRIMARY t2 ref idx idx 5 test.t1.a 140 Using index; FirstMatch(t1)
+1 PRIMARY t2 hash_index idx #hash#idx:idx 5:5 test.t1.a 6144 Using index; FirstMatch(t1); Using join buffer (flat, BNLH join)
drop view v1;
drop table t1,t2;
#
diff --git a/mysql-test/r/distinct.result b/mysql-test/r/distinct.result
index 926dc17d0c4..dd6948a1e36 100644
--- a/mysql-test/r/distinct.result
+++ b/mysql-test/r/distinct.result
@@ -174,8 +174,8 @@ INSERT INTO t3 VALUES (1,'1'),(2,'2'),(1,'1'),(2,'2');
explain SELECT distinct t3.a FROM t3,t2,t1 WHERE t3.a=t1.b AND t1.a=t2.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 4 Using where; Using temporary
-1 SIMPLE t3 ref a a 5 test.t1.b 2 Using index
-1 SIMPLE t2 index a a 4 NULL 5 Using where; Using index; Using join buffer (flat, BNL join)
+1 SIMPLE t3 hash_index a #hash#a:a 5:5 test.t1.b 6 Using index; Using join buffer (flat, BNLH join)
+1 SIMPLE t2 index a a 4 NULL 5 Using where; Using index; Using join buffer (incremental, BNL join)
SELECT distinct t3.a FROM t3,t2,t1 WHERE t3.a=t1.b AND t1.a=t2.a;
a
1
@@ -190,7 +190,7 @@ insert into t3 select * from t4;
explain select distinct t1.a from t1,t3 where t1.a=t3.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 4 Using index; Using temporary
-1 SIMPLE t3 ref a a 5 test.t1.a 11 Using index; Distinct
+1 SIMPLE t3 hash_index a #hash#a:a 5:5 test.t1.a 204 Using index; Using join buffer (flat, BNLH join)
select distinct t1.a from t1,t3 where t1.a=t3.a;
a
1
@@ -523,7 +523,7 @@ EXPLAIN SELECT DISTINCT t1_1.a, t1_1.b FROM t1 t1_1, t1 t1_2
WHERE t1_1.a = t1_2.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1_1 ALL PRIMARY NULL NULL NULL 3 Using temporary
-1 SIMPLE t1_2 eq_ref PRIMARY PRIMARY 4 test.t1_1.a 1 Using index; Distinct
+1 SIMPLE t1_2 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t1_1.a 3 Using index; Using join buffer (flat, BNLH join)
EXPLAIN SELECT a FROM t1 GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL PRIMARY 4 NULL 3 Using index
@@ -916,8 +916,8 @@ SELECT STRAIGHT_JOIN DISTINCT t1.id FROM
t1, v1, t2 WHERE v1.id = t2.i AND t1.i1 = v1.i1 AND t2.i != 3;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 96 100.00 Using where; Using temporary
-1 PRIMARY <derived2> ref key0 key0 5 test.t1.i1 9 100.00 Using where
-1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY <derived2> hash_ALL key0 #hash#key0 5 test.t1.i1 96 10.00 Using where; Using join buffer (flat, BNLH join)
+1 PRIMARY t2 hash_ALL NULL #hash#$hj 5 v1.id 2 100.00 Using where; Using join buffer (incremental, BNLH join)
2 DERIVED t1 ALL NULL NULL NULL NULL 96 100.00 Using where
Warnings:
Note 1003 /* select#1 */ select straight_join distinct `test`.`t1`.`id` AS `id` from `test`.`t1` join `test`.`v1` join `test`.`t2` where `test`.`t2`.`i` = `v1`.`id` and `v1`.`i1` = `test`.`t1`.`i1` and `v1`.`id` <> 3
diff --git a/mysql-test/r/explain_json.result b/mysql-test/r/explain_json.result
index ef6b70aff71..3c7ddc66cb3 100644
--- a/mysql-test/r/explain_json.result
+++ b/mysql-test/r/explain_json.result
@@ -58,16 +58,21 @@ EXPLAIN
"filtered": 100,
"attached_condition": "t0.a is not null"
},
- "table": {
- "table_name": "t1",
- "access_type": "ref",
- "possible_keys": ["a"],
- "key": "a",
- "key_length": "5",
- "used_key_parts": ["a"],
- "ref": ["test.t0.a"],
- "rows": 1,
- "filtered": 100
+ "block-nl-join": {
+ "table": {
+ "table_name": "t1",
+ "access_type": "hash_ALL",
+ "possible_keys": ["a"],
+ "key": "#hash#a",
+ "key_length": "5",
+ "used_key_parts": ["a"],
+ "ref": ["test.t0.a"],
+ "rows": 1000,
+ "filtered": 0.1
+ },
+ "buffer_type": "flat",
+ "buffer_size": "256Kb",
+ "join_type": "BNLH"
}
}
}
@@ -190,16 +195,22 @@ EXPLAIN
"filtered": 100,
"attached_condition": "t0.a is not null"
},
- "table": {
- "table_name": "t2",
- "access_type": "ref",
- "possible_keys": ["b1"],
- "key": "b1",
- "key_length": "10",
- "used_key_parts": ["b1", "b2"],
- "ref": ["test.t0.a", "const"],
- "rows": 1,
- "filtered": 100
+ "block-nl-join": {
+ "table": {
+ "table_name": "t2",
+ "access_type": "hash_ALL",
+ "possible_keys": ["b1"],
+ "key": "#hash#b1",
+ "key_length": "10",
+ "used_key_parts": ["b1", "b2"],
+ "ref": ["test.t0.a", "const"],
+ "rows": 1000,
+ "filtered": 0.1,
+ "attached_condition": "t2.b2 = 4"
+ },
+ "buffer_type": "flat",
+ "buffer_size": "256Kb",
+ "join_type": "BNLH"
}
}
}
@@ -362,19 +373,23 @@ EXPLAIN
"access_type": "ALL",
"rows": 100,
"filtered": 100,
- "attached_condition": "tbl1.b < 3"
+ "attached_condition": "tbl1.b < 3 and tbl1.a is not null"
},
"block-nl-join": {
"table": {
"table_name": "tbl2",
- "access_type": "ALL",
+ "access_type": "hash_ALL",
+ "key": "#hash#$hj",
+ "key_length": "5",
+ "used_key_parts": ["a"],
+ "ref": ["test.tbl1.a"],
"rows": 100,
"filtered": 100,
"attached_condition": "tbl2.b < 5"
},
"buffer_type": "flat",
"buffer_size": "256Kb",
- "join_type": "BNL",
+ "join_type": "BNLH",
"attached_condition": "tbl2.a = tbl1.a"
}
}
@@ -518,16 +533,21 @@ EXPLAIN
"filtered": 100,
"attached_condition": "tbl2.a is not null"
},
- "table": {
- "table_name": "<derived2>",
- "access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
- "key_length": "8",
- "used_key_parts": ["cnt"],
- "ref": ["test.tbl2.a"],
- "rows": 2,
- "filtered": 100,
+ "block-nl-join": {
+ "table": {
+ "table_name": "<derived2>",
+ "access_type": "hash_ALL",
+ "possible_keys": ["key0"],
+ "key": "#hash#key0",
+ "key_length": "8",
+ "used_key_parts": ["cnt"],
+ "ref": ["test.tbl2.a"],
+ "rows": 10,
+ "filtered": 20
+ },
+ "buffer_type": "flat",
+ "buffer_size": "256Kb",
+ "join_type": "BNLH",
"attached_condition": "tbl1.cnt = tbl2.a",
"materialized": {
"query_block": {
@@ -564,16 +584,21 @@ EXPLAIN
"filtered": 100,
"attached_condition": "t1.a is not null"
},
- "table": {
- "table_name": "<subquery2>",
- "access_type": "eq_ref",
- "possible_keys": ["distinct_key"],
- "key": "distinct_key",
- "key_length": "4",
- "used_key_parts": ["max(a)"],
- "ref": ["test.t1.a"],
- "rows": 1,
- "filtered": 100,
+ "block-nl-join": {
+ "table": {
+ "table_name": "<subquery2>",
+ "access_type": "hash_ALL",
+ "possible_keys": ["distinct_key"],
+ "key": "#hash#distinct_key",
+ "key_length": "4",
+ "used_key_parts": ["max(a)"],
+ "ref": ["test.t1.a"],
+ "rows": 10,
+ "filtered": 10
+ },
+ "buffer_type": "flat",
+ "buffer_size": "256Kb",
+ "join_type": "BNLH",
"materialized": {
"unique": 1,
"query_block": {
@@ -688,8 +713,8 @@ set optimizer_switch='firstmatch=off';
explain
select * from t2 where t2.a in ( select a from t1 where t1.b=t2.b);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t2 ALL NULL NULL NULL NULL 10
-1 PRIMARY t1 ALL NULL NULL NULL NULL 10 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join)
+1 PRIMARY t2 ALL NULL NULL NULL NULL 10 Using where
+1 PRIMARY t1 hash_ALL NULL #hash#$hj 10 test.t2.a,test.t2.b 10 Using where; Start temporary; End temporary; Using join buffer (flat, BNLH join)
explain format=json
select * from t2 where t2.a in ( select a from t1 where t1.b=t2.b);
EXPLAIN
@@ -700,19 +725,24 @@ EXPLAIN
"table_name": "t2",
"access_type": "ALL",
"rows": 10,
- "filtered": 100
+ "filtered": 100,
+ "attached_condition": "t2.a is not null and t2.b is not null"
},
"duplicates_removal": {
"block-nl-join": {
"table": {
"table_name": "t1",
- "access_type": "ALL",
+ "access_type": "hash_ALL",
+ "key": "#hash#$hj",
+ "key_length": "10",
+ "used_key_parts": ["a", "b"],
+ "ref": ["test.t2.a", "test.t2.b"],
"rows": 10,
"filtered": 100
},
"buffer_type": "flat",
"buffer_size": "256Kb",
- "join_type": "BNL",
+ "join_type": "BNLH",
"attached_condition": "t1.b = t2.b and t1.a = t2.a"
}
}
@@ -866,18 +896,23 @@ EXPLAIN
"table_name": "tbl1",
"access_type": "ALL",
"rows": 100,
- "filtered": 100
+ "filtered": 100,
+ "attached_condition": "tbl1.b is not null"
},
"block-nl-join": {
"table": {
"table_name": "tbl2",
- "access_type": "ALL",
+ "access_type": "hash_ALL",
+ "key": "#hash#$hj",
+ "key_length": "5",
+ "used_key_parts": ["b"],
+ "ref": ["test.tbl1.b"],
"rows": 100,
"filtered": 100
},
"buffer_type": "flat",
"buffer_size": "256Kb",
- "join_type": "BNL",
+ "join_type": "BNLH",
"attached_condition": "tbl2.b = tbl1.b"
}
}
@@ -1302,7 +1337,7 @@ explain
select * from t1 left join t2 on t2.pk=t1.a where t2.pk is null;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2
-1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 Using where; Using index; Not exists
+1 SIMPLE t2 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t1.a 2 Using where; Using index; Not exists; Using join buffer (flat, BNLH join)
explain format=json
select * from t1 left join t2 on t2.pk=t1.a where t2.pk is null;
EXPLAIN
@@ -1315,19 +1350,24 @@ EXPLAIN
"rows": 2,
"filtered": 100
},
- "table": {
- "table_name": "t2",
- "access_type": "eq_ref",
- "possible_keys": ["PRIMARY"],
- "key": "PRIMARY",
- "key_length": "4",
- "used_key_parts": ["pk"],
- "ref": ["test.t1.a"],
- "rows": 1,
- "filtered": 100,
- "attached_condition": "trigcond(t2.pk is null) and trigcond(trigcond(t1.a is not null))",
- "using_index": true,
- "not_exists": true
+ "block-nl-join": {
+ "table": {
+ "table_name": "t2",
+ "access_type": "hash_index",
+ "possible_keys": ["PRIMARY"],
+ "key": "#hash#PRIMARY:PRIMARY",
+ "key_length": "4:4",
+ "used_key_parts": ["pk"],
+ "ref": ["test.t1.a"],
+ "rows": 2,
+ "filtered": 50,
+ "using_index": true,
+ "not_exists": true
+ },
+ "buffer_type": "flat",
+ "buffer_size": "256Kb",
+ "join_type": "BNLH",
+ "attached_condition": "trigcond(t2.pk is null) and trigcond(trigcond(t1.a is not null))"
}
}
}
@@ -1349,23 +1389,29 @@ ANALYZE
"filtered": 100,
"r_filtered": 100
},
- "table": {
- "table_name": "t2",
- "access_type": "eq_ref",
- "possible_keys": ["PRIMARY"],
- "key": "PRIMARY",
- "key_length": "4",
- "used_key_parts": ["pk"],
- "ref": ["test.t1.a"],
- "r_loops": 2,
- "rows": 1,
- "r_rows": 1,
- "r_total_time_ms": "REPLACED",
- "filtered": 100,
- "r_filtered": 100,
+ "block-nl-join": {
+ "table": {
+ "table_name": "t2",
+ "access_type": "hash_index",
+ "possible_keys": ["PRIMARY"],
+ "key": "#hash#PRIMARY:PRIMARY",
+ "key_length": "4:4",
+ "used_key_parts": ["pk"],
+ "ref": ["test.t1.a"],
+ "r_loops": 1,
+ "rows": 2,
+ "r_rows": 2,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 50,
+ "r_filtered": 100,
+ "using_index": true,
+ "not_exists": true
+ },
+ "buffer_type": "flat",
+ "buffer_size": "256Kb",
+ "join_type": "BNLH",
"attached_condition": "trigcond(t2.pk is null) and trigcond(trigcond(t1.a is not null))",
- "using_index": true,
- "not_exists": true
+ "r_filtered": 100
}
}
}
@@ -1374,7 +1420,7 @@ explain
select distinct t1.a from t1 join t2 on t2.pk=t1.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where; Using temporary
-1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 Using index; Distinct
+1 SIMPLE t2 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t1.a 2 Using index; Using join buffer (flat, BNLH join)
explain format=json
select distinct t1.a from t1 join t2 on t2.pk=t1.a;
EXPLAIN
@@ -1389,18 +1435,22 @@ EXPLAIN
"filtered": 100,
"attached_condition": "t1.a is not null"
},
- "table": {
- "table_name": "t2",
- "access_type": "eq_ref",
- "possible_keys": ["PRIMARY"],
- "key": "PRIMARY",
- "key_length": "4",
- "used_key_parts": ["pk"],
- "ref": ["test.t1.a"],
- "rows": 1,
- "filtered": 100,
- "using_index": true,
- "distinct": true
+ "block-nl-join": {
+ "table": {
+ "table_name": "t2",
+ "access_type": "hash_index",
+ "possible_keys": ["PRIMARY"],
+ "key": "#hash#PRIMARY:PRIMARY",
+ "key_length": "4:4",
+ "used_key_parts": ["pk"],
+ "ref": ["test.t1.a"],
+ "rows": 2,
+ "filtered": 50,
+ "using_index": true
+ },
+ "buffer_type": "flat",
+ "buffer_size": "256Kb",
+ "join_type": "BNLH"
}
}
}
@@ -1425,22 +1475,27 @@ ANALYZE
"r_filtered": 100,
"attached_condition": "t1.a is not null"
},
- "table": {
- "table_name": "t2",
- "access_type": "eq_ref",
- "possible_keys": ["PRIMARY"],
- "key": "PRIMARY",
- "key_length": "4",
- "used_key_parts": ["pk"],
- "ref": ["test.t1.a"],
- "r_loops": 2,
- "rows": 1,
- "r_rows": 1,
- "r_total_time_ms": "REPLACED",
- "filtered": 100,
- "r_filtered": 100,
- "using_index": true,
- "distinct": true
+ "block-nl-join": {
+ "table": {
+ "table_name": "t2",
+ "access_type": "hash_index",
+ "possible_keys": ["PRIMARY"],
+ "key": "#hash#PRIMARY:PRIMARY",
+ "key_length": "4:4",
+ "used_key_parts": ["pk"],
+ "ref": ["test.t1.a"],
+ "r_loops": 1,
+ "rows": 2,
+ "r_rows": 2,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 50,
+ "r_filtered": 100,
+ "using_index": true
+ },
+ "buffer_type": "flat",
+ "buffer_size": "256Kb",
+ "join_type": "BNLH",
+ "r_filtered": 100
}
}
}
diff --git a/mysql-test/r/explain_json_innodb.result b/mysql-test/r/explain_json_innodb.result
index 8cec65642b4..ae7753a4f97 100644
--- a/mysql-test/r/explain_json_innodb.result
+++ b/mysql-test/r/explain_json_innodb.result
@@ -33,21 +33,26 @@ EXPLAIN
"filtered": 100,
"attached_condition": "tbl_alias1.column_name_2 is not null and tbl_alias1.column_name_1 is not null"
},
- "table": {
- "table_name": "tbl_alias2",
- "access_type": "eq_ref",
- "possible_keys": ["PRIMARY"],
- "key": "PRIMARY",
- "key_length": "9",
- "used_key_parts": ["c", "b"],
- "ref": [
- "test.tbl_alias1.column_name_2",
- "test.tbl_alias1.column_name_1"
- ],
- "rows": 1,
- "filtered": 100,
- "attached_condition": "tbl_alias2.c = tbl_alias1.column_name_2",
- "using_index": true
+ "block-nl-join": {
+ "table": {
+ "table_name": "tbl_alias2",
+ "access_type": "hash_index",
+ "possible_keys": ["PRIMARY"],
+ "key": "#hash#PRIMARY:PRIMARY",
+ "key_length": "9:9",
+ "used_key_parts": ["c", "b"],
+ "ref": [
+ "test.tbl_alias1.column_name_2",
+ "test.tbl_alias1.column_name_1"
+ ],
+ "rows": 2,
+ "filtered": 50,
+ "using_index": true
+ },
+ "buffer_type": "flat",
+ "buffer_size": "256Kb",
+ "join_type": "BNLH",
+ "attached_condition": "tbl_alias2.c = tbl_alias1.column_name_2"
}
}
}
diff --git a/mysql-test/r/func_concat.result b/mysql-test/r/func_concat.result
index 9ab6f74653e..e74857ca9cd 100644
--- a/mysql-test/r/func_concat.result
+++ b/mysql-test/r/func_concat.result
@@ -118,7 +118,7 @@ EXPLAIN SELECT CONCAT('gui_', t2.a), t1.d FROM t2
LEFT JOIN t1 ON t1.a = CONCAT('gui_', t2.a) AND t1.b = 'a' AND t1.c = 'b';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index NULL PRIMARY 102 NULL 3 Using index
-1 SIMPLE t1 eq_ref PRIMARY,a PRIMARY 318 func,const,const 1 Using where
+1 SIMPLE t1 hash_ALL PRIMARY,a #hash#PRIMARY 318 func,const,const 3 Using where; Using join buffer (flat, BNLH join)
DROP TABLE t1, t2;
#
# Bug #50096: CONCAT_WS inside procedure returning wrong data
diff --git a/mysql-test/r/func_in.result b/mysql-test/r/func_in.result
index 692806c7cac..e829853baa4 100644
--- a/mysql-test/r/func_in.result
+++ b/mysql-test/r/func_in.result
@@ -370,8 +370,8 @@ JOIN t2 ON t3.a=t2.a
JOIN t4 WHERE t4.a IN (t1.b, t2.b);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t3 index PRIMARY PRIMARY 4 NULL 4 Using index
-1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t3.a 1
-1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t3.a 1
+1 SIMPLE t1 hash_ALL PRIMARY #hash#PRIMARY 4 test.t3.a 6 Using join buffer (flat, BNLH join)
+1 SIMPLE t2 hash_ALL PRIMARY #hash#PRIMARY 4 test.t3.a 5 Using join buffer (incremental, BNLH join)
1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 7 Range checked for each record (index map: 0x1)
SELECT STRAIGHT_JOIN * FROM t3
JOIN t1 ON t3.a=t1.a
@@ -388,8 +388,8 @@ FROM t3, t1, t2
WHERE t3.a=t1.a AND t3.a=t2.a;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 index PRIMARY PRIMARY 4 NULL 4 Using index
-1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t3.a 1
-1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t3.a 1
+1 PRIMARY t1 hash_ALL PRIMARY #hash#PRIMARY 4 test.t3.a 6 Using join buffer (flat, BNLH join)
+1 PRIMARY t2 hash_ALL PRIMARY #hash#PRIMARY 4 test.t3.a 5 Using join buffer (incremental, BNLH join)
2 DEPENDENT SUBQUERY t4 index NULL PRIMARY 4 NULL 7 Using where; Using index
SELECT STRAIGHT_JOIN
(SELECT SUM(t4.a) FROM t4 WHERE t4.a IN (t1.b, t2.b))
diff --git a/mysql-test/r/func_isnull.result b/mysql-test/r/func_isnull.result
index 15d87997e29..83c57513576 100644
--- a/mysql-test/r/func_isnull.result
+++ b/mysql-test/r/func_isnull.result
@@ -88,7 +88,7 @@ EXPLAIN EXTENDED
SELECT * FROM t2 LEFT JOIN t1 ON t2.d1=t1.d1 WHERE t1.d1 IS NULL;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00
-1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t2.d1 3 100.00 Using where; Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t2`.`d1` AS `d1`,`test`.`t1`.`d1` AS `d1` from `test`.`t2` left join `test`.`t1` on(`test`.`t1`.`d1` = `test`.`t2`.`d1`) where `test`.`t1`.`d1` = 0 or `test`.`t1`.`d1` is null
SELECT * FROM t2 LEFT JOIN v1 ON t2.d1=v1.d1 WHERE v1.d1 IS NULL;
@@ -100,7 +100,7 @@ EXPLAIN EXTENDED
SELECT * FROM t2 LEFT JOIN v1 ON t2.d1=v1.d1 WHERE v1.d1 IS NULL;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00
-1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t2.d1 3 100.00 Using where; Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t2`.`d1` AS `d1`,`test`.`t1`.`d1` AS `d1` from `test`.`t2` left join (`test`.`t1`) on(`test`.`t1`.`d1` = `test`.`t2`.`d1`) where `test`.`t1`.`d1` = 0 or `test`.`t1`.`d1` is null
DROP VIEW v1;
diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result
index 804a563f401..cfadc89d5a3 100644
--- a/mysql-test/r/func_misc.result
+++ b/mysql-test/r/func_misc.result
@@ -351,7 +351,7 @@ explain extended
select a from t1 left join v_merge on (a=e) where last_value(NULL,e) not in (select last_value(NULL,e) from vm);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00
-1 PRIMARY tv ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY tv hash_ALL NULL #hash#$hj 2 test.t1.a 1 100.00 Using where; Using join buffer (flat, BNLH join)
2 DEPENDENT SUBQUERY tv system NULL NULL NULL NULL 1 100.00
Warnings:
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` left join (`test`.`tv`) on(`test`.`tv`.`e` = `test`.`t1`.`a`) where !<expr_cache><last_value(NULL,`test`.`tv`.`e`)>(<in_optimizer>(last_value(NULL,`test`.`tv`.`e`),<exists>(/* select#2 */ select last_value(NULL,'1') from dual where trigcond(<cache>(last_value(NULL,`test`.`tv`.`e`)) = last_value(NULL,'1')))))
@@ -359,7 +359,7 @@ explain extended
select a from t1 left join v_merge on (a=e) where e not in (select last_value(NULL,e) from vm);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00
-1 PRIMARY tv ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY tv hash_ALL NULL #hash#$hj 2 test.t1.a 1 100.00 Using where; Using join buffer (flat, BNLH join)
2 DEPENDENT SUBQUERY tv system NULL NULL NULL NULL 1 100.00
Warnings:
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` left join (`test`.`tv`) on(`test`.`tv`.`e` = `test`.`t1`.`a`) where !<expr_cache><`test`.`tv`.`e`>(<in_optimizer>(`test`.`tv`.`e`,<exists>(/* select#2 */ select last_value(NULL,'1') from dual where trigcond(<cache>(`test`.`tv`.`e`) = last_value(NULL,'1')))))
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index 2b376373f51..05c5e839004 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -1204,9 +1204,9 @@ SELECT t1.id, CONCAT_WS('->', t3.title, t2.title, t1.title) as col1
FROM t1 LEFT JOIN t1 AS t2 ON t1.pc=t2.id
LEFT JOIN t1 AS t3 ON t2.pc=t3.id;
id col1
-1 Main
2 Main->Toys
3 Main->Games
+1 Main
SELECT t1.id, CONCAT_WS('->', t3.title, t2.title, t1.title) as col1
FROM t1 LEFT JOIN t1 AS t2 ON t1.pc=t2.id
LEFT JOIN t1 AS t3 ON t2.pc=t3.id
diff --git a/mysql-test/r/grant_explain_non_select.result b/mysql-test/r/grant_explain_non_select.result
index 53b7d687d6c..f83eed0eeb5 100644
--- a/mysql-test/r/grant_explain_non_select.result
+++ b/mysql-test/r/grant_explain_non_select.result
@@ -116,7 +116,7 @@ id select_type table type possible_keys key key_len ref rows Extra
UPDATE t1 SET a = a + 1;
EXPLAIN UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where
1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using where
UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
connection default;
@@ -163,7 +163,7 @@ id select_type table type possible_keys key key_len ref rows Extra
DELETE FROM t1 WHERE a = 10;
EXPLAIN DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ALL NULL NULL NULL NULL 3
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where
1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using where
DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
connection default;
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result
index 62c659dd933..d134804743c 100644
--- a/mysql-test/r/group_by.result
+++ b/mysql-test/r/group_by.result
@@ -51,12 +51,12 @@ userid MIN(t1.score+0.0)
2 2.0
SELECT t2.userid, MIN(t1.score+0.0) FROM t1, t2 WHERE t1.userID=t2.userID AND t1.spID=2 GROUP BY t2.userid ORDER BY NULL;
userid MIN(t1.score+0.0)
-2 2.0
1 1.0
+2 2.0
EXPLAIN SELECT t2.userid, MIN(t1.score+0.0) FROM t1, t2 WHERE t1.userID=t2.userID AND t1.spID=2 GROUP BY t2.userid ORDER BY NULL;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where; Using temporary
-1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.userID 1 Using index
+1 SIMPLE t2 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t1.userID 5 Using index; Using join buffer (flat, BNLH join)
drop table t1,t2;
CREATE TABLE t1 (
PID int(10) unsigned NOT NULL auto_increment,
@@ -208,11 +208,11 @@ value description bug_id
BBBBBBBBBBBBB - conversion 9
BBBBBBBBBBBBB - conversion 10
BBBBBBBBBBBBB - generic 7
-BBBBBBBBBBBBB - generic 14
-BBBBBBBBBBBBB - eeeeeeeee NULL
kkkkkkkkkkk lllllllllll 6
kkkkkkkkkkk lllllllllll 8
kkkkkkkkkkk lllllllllll 12
+BBBBBBBBBBBBB - generic 14
+BBBBBBBBBBBBB - eeeeeeeee NULL
Test Procedures NULL
Documentation NULL
Host communication NULL
@@ -498,8 +498,8 @@ select * from t1 AS m LEFT JOIN t2 AS c1 ON m.c1id =
c1.id AND c1.active = 'Yes' LEFT JOIN t3 AS c2 ON m.c2id = c2.id AND
c2.active = 'Yes' WHERE m.pid=1 AND (c1.id IS NOT NULL OR c2.id IS NOT NULL);
pid c1id c2id value id active id active
-1 1 NULL 1 1 Yes NULL NULL
1 NULL 3 3 NULL NULL 3 Yes
+1 1 NULL 1 1 Yes NULL NULL
1 4 NULL 4 4 Yes NULL NULL
select max(value) from t1 AS m LEFT JOIN t2 AS c1 ON
m.c1id = c1.id AND c1.active = 'Yes' LEFT JOIN t3 AS c2 ON m.c2id =
@@ -887,8 +887,8 @@ explain
SELECT straight_join sql_no_cache v1.a, v1.b, v1.real_b from t2, v1
where t2.b=v1.a GROUP BY t2.b;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 index b b 2 NULL 10 Using where; Using index
-1 SIMPLE t1 eq_ref PRIMARY PRIMARY 1 test.t2.b 1
+1 SIMPLE t2 index b b 2 NULL 10 Using where; Using index; Using temporary; Using filesort
+1 SIMPLE t1 hash_ALL PRIMARY #hash#PRIMARY 1 test.t2.b 7 Using join buffer (flat, BNLH join)
SELECT straight_join sql_no_cache v1.a, v1.b, v1.real_b from t2, v1
where t2.b=v1.a GROUP BY t2.b;
a b real_b
@@ -2320,17 +2320,17 @@ field1 field2
2004-10-11 18:13:00 1
2009-02-19 02:05:00 5
Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: 'g'
Warning 1292 Truncated incorrect DOUBLE value: 'o'
Warning 1292 Truncated incorrect DOUBLE value: 'v'
+Warning 1292 Truncated incorrect DOUBLE value: 'g'
SELECT alias2.f3 AS field1 , alias2.f1 AS field2 FROM t1 AS alias1 JOIN t1 AS alias2 ON alias2.f1 = alias1.f2 AND alias2.f1 != alias1.f4 GROUP BY field1 , field2 ;
field1 field2
2004-10-11 18:13:00 1
2009-02-19 02:05:00 5
Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: 'g'
Warning 1292 Truncated incorrect DOUBLE value: 'o'
Warning 1292 Truncated incorrect DOUBLE value: 'v'
+Warning 1292 Truncated incorrect DOUBLE value: 'g'
SET SESSION SQL_MODE=default;
drop table t1;
#
diff --git a/mysql-test/r/group_by_innodb.result b/mysql-test/r/group_by_innodb.result
index 034866b63d5..395b576cec3 100644
--- a/mysql-test/r/group_by_innodb.result
+++ b/mysql-test/r/group_by_innodb.result
@@ -67,9 +67,9 @@ INSERT INTO t2 VALUES (3);
SELECT a.oidGroup, a.oid, b.oid FROM t1 a LEFT JOIN t2 b ON
a.oid=b.oid WHERE a.oidGroup=1;
oidGroup oid oid
+1 3 3
1 1 NULL
1 2 NULL
-1 3 3
1 4 NULL
SELECT a.oidGroup, a.oid, b.oid FROM t1 a LEFT JOIN t2 b ON
a.oid=b.oid WHERE a.oidGroup=1 GROUP BY a.oid;
diff --git a/mysql-test/r/group_min_max.result b/mysql-test/r/group_min_max.result
index 36a44b05817..9eb56ceb1b4 100644
--- a/mysql-test/r/group_min_max.result
+++ b/mysql-test/r/group_min_max.result
@@ -2439,7 +2439,7 @@ EXPLAIN SELECT 1 FROM t1 AS t1_outer WHERE
a IN (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 8
-1 PRIMARY t1_outer ref a a 5 <subquery2>.max(b) 2 Using index
+1 PRIMARY t1_outer hash_index a #hash#a:a 5:10 <subquery2>.max(b) 15 Using index; Using join buffer (flat, BNLH join)
2 MATERIALIZED t1 range NULL a 5 NULL 8 Using index for group-by
EXPLAIN SELECT 1 FROM t1 AS t1_outer GROUP BY a HAVING
a > (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2);
@@ -2451,7 +2451,7 @@ ON t1_outer1.a = (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2)
AND t1_outer1.b = t1_outer2.b;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1_outer1 ref a a 5 const 1 Using where; Using index
-1 PRIMARY t1_outer2 index NULL a 10 NULL 15 Using where; Using index; Using join buffer (flat, BNL join)
+1 PRIMARY t1_outer2 hash_index NULL #hash#$hj:a 5:10 test.t1_outer1.b 15 Using where; Using index; Using join buffer (flat, BNLH join)
2 SUBQUERY t1 range NULL a 5 NULL 8 Using index for group-by
EXPLAIN SELECT (SELECT (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) x
FROM t1 AS t1_outer) x2 FROM t1 AS t1_outer2;
@@ -2634,7 +2634,7 @@ a b
3 13
explain extended select sql_buffer_result a, max(b)+1 from t1 where a = 0 group by a;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 ref a,index a 5 const 15 100.00 Using index; Using temporary
+1 SIMPLE t1 ref a,index a 5 const 15 100.00 Using where; Using index; Using temporary
Warnings:
Note 1003 select sql_buffer_result `test`.`t1`.`a` AS `a`,max(`test`.`t1`.`b`) + 1 AS `max(b)+1` from `test`.`t1` where `test`.`t1`.`a` = 0 group by `test`.`t1`.`a`
drop table t1;
diff --git a/mysql-test/r/index_intersect.result b/mysql-test/r/index_intersect.result
index 7a0633d4dc8..75aa25fa899 100644
--- a/mysql-test/r/index_intersect.result
+++ b/mysql-test/r/index_intersect.result
@@ -1004,7 +1004,7 @@ WHERE City.Name LIKE 'C%' AND City.Population > 1000000 AND
Country.Code=City.Country;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE City index_merge Population,Name,CountryID,CountryName Name,Population 35,4 NULL # Using sort_intersect(Name,Population); Using where
-1 SIMPLE Country eq_ref PRIMARY PRIMARY 3 world.City.Country #
+1 SIMPLE Country hash_ALL PRIMARY #hash#PRIMARY 3 world.City.Country # Using join buffer (flat, BNLH join)
DROP DATABASE world;
use test;
CREATE TABLE t1 (
diff --git a/mysql-test/r/index_intersect_innodb.result b/mysql-test/r/index_intersect_innodb.result
index 15244098170..d91a97043e1 100644
--- a/mysql-test/r/index_intersect_innodb.result
+++ b/mysql-test/r/index_intersect_innodb.result
@@ -1005,7 +1005,7 @@ WHERE City.Name LIKE 'C%' AND City.Population > 1000000 AND
Country.Code=City.Country;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE City index_merge Population,Name,CountryID,CountryName Population,Name 4,35 NULL # Using sort_intersect(Population,Name); Using where
-1 SIMPLE Country eq_ref PRIMARY PRIMARY 3 world.City.Country #
+1 SIMPLE Country hash_ALL PRIMARY #hash#PRIMARY 3 world.City.Country # Using join buffer (flat, BNLH join)
DROP DATABASE world;
use test;
CREATE TABLE t1 (
diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result
index d9ed5e7e891..807a272979e 100644
--- a/mysql-test/r/information_schema.result
+++ b/mysql-test/r/information_schema.result
@@ -348,7 +348,7 @@ information_schema.SCHEMATA b where
a.ROUTINE_SCHEMA = b.SCHEMA_NAME;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE # ALL NULL NULL NULL NULL NULL
-1 SIMPLE # ALL NULL NULL NULL NULL NULL Using where; Using join buffer (flat, BNL join)
+1 SIMPLE # hash_ALL NULL #hash#$hj 194 information_schema.a.ROUTINE_SCHEMA NULL Using where; Using join buffer (flat, BNLH join)
select a.ROUTINE_NAME, b.name from information_schema.ROUTINES a,
mysql.proc b where a.ROUTINE_NAME = convert(b.name using utf8) AND a.ROUTINE_SCHEMA='test' order by 1;
ROUTINE_NAME name
@@ -1556,7 +1556,7 @@ from information_schema.tables a, information_schema.columns b
where a.table_name='t1' and a.table_schema='test' and b.table_name=a.table_name;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE a ALL NULL TABLE_SCHEMA,TABLE_NAME NULL NULL NULL Using where; Skip_open_table; Scanned 0 databases
-1 SIMPLE b ALL NULL NULL NULL NULL NULL Using where; Open_frm_only; Scanned all databases; Using join buffer (flat, BNL join)
+1 SIMPLE b hash_ALL NULL #hash#$hj 194 information_schema.a.TABLE_NAME NULL Using where; Open_frm_only; Scanned all databases; Using join buffer (flat, BNLH join)
SELECT * FROM INFORMATION_SCHEMA.SCHEMATA
WHERE SCHEMA_NAME = 'mysqltest';
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result
index 046674d5569..ab0fa67f883 100644
--- a/mysql-test/r/join.result
+++ b/mysql-test/r/join.result
@@ -50,8 +50,8 @@ insert into t1 values (107);
insert into t2 values (107),(75),(1000);
select t1.id, t2.id from t1, t2 where t2.id = t1.id;
id id
-107 107
75 75
+107 107
select t1.id, count(t2.id) from t1,t2 where t2.id = t1.id group by t1.id;
id count(t2.id)
75 1
@@ -408,8 +408,8 @@ EXPLAIN
SELECT STRAIGHT_JOIN t2.e FROM t1,t2 WHERE t2.d=1 AND t1.b=t2.e
ORDER BY t1.b, t1.c;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 32 Using temporary; Using filesort
-1 SIMPLE t2 ALL NULL NULL NULL NULL 16 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32 Using where; Using temporary; Using filesort
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.b 16 Using where; Using join buffer (flat, BNLH join)
SELECT STRAIGHT_JOIN t2.e FROM t1,t2 WHERE t2.d=1 AND t1.b=t2.e
ORDER BY t1.b, t1.c;
e
@@ -856,8 +856,8 @@ a b a a
explain select * from t1, t2, t3 where t3.a=t1.a and t2.a=t1.b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
-1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 Using index
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 Using index
+1 SIMPLE t2 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t1.b 10 Using index; Using join buffer (flat, BNLH join)
+1 SIMPLE t3 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t1.a 10 Using index; Using join buffer (incremental, BNLH join)
We expect rnd_next=5, and read_key must be 0 because of short-cutting:
show status like 'Handler_read%';
Variable_name Value
@@ -881,7 +881,7 @@ insert into t3 select * from t2 where a < 800;
explain select * from t2,t3 where t2.a < 200 and t2.b=t3.b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL a,b NULL NULL NULL 1000 Using where
-1 SIMPLE t3 ref b b 5 test.t2.b 1
+1 SIMPLE t3 hash_ALL b #hash#b 5 test.t2.b 800 Using join buffer (flat, BNLH join)
drop table t1, t2, t3;
create table t1 (a int);
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
@@ -902,8 +902,8 @@ vv: Following query must use ALL(t1), eq_ref(A), eq_ref(B): vv
explain select * from t1, t2 A, t2 B where A.a = t1.a and B.a=A.b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 10 Using where
-1 SIMPLE A eq_ref PRIMARY PRIMARY 4 test.t1.a 1 Using where
-1 SIMPLE B eq_ref PRIMARY PRIMARY 4 test.A.b 1
+1 SIMPLE A hash_ALL PRIMARY #hash#PRIMARY 4 test.t1.a 100 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE B hash_ALL PRIMARY #hash#PRIMARY 4 test.A.b 100 Using join buffer (incremental, BNLH join)
show status like '%cost%';
Variable_name Value
Last_query_cost 28.016090
@@ -922,12 +922,12 @@ INSERT INTO t1 SELECT a + 64, b FROM t1;
INSERT INTO t2 SELECT a, b FROM t1;
EXPLAIN SELECT * FROM t1 JOIN t2 ON b=c ORDER BY a LIMIT 2;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL PRIMARY 4 NULL 2 Using where
-1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.b 1
+1 SIMPLE t1 ALL NULL NULL NULL NULL 128 Using where; Using temporary; Using filesort
+1 SIMPLE t2 hash_ALL PRIMARY #hash#PRIMARY 4 test.t1.b 128 Using join buffer (flat, BNLH join)
EXPLAIN SELECT * FROM t1 JOIN t2 ON a=c ORDER BY a LIMIT 2;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 2
-1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1
+1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 128 Using temporary; Using filesort
+1 SIMPLE t2 hash_ALL PRIMARY #hash#PRIMARY 4 test.t1.a 128 Using join buffer (flat, BNLH join)
SELECT * FROM t1 JOIN t2 ON b=c ORDER BY a LIMIT 2;
a b c d
SELECT * FROM t1 JOIN t2 ON a=c ORDER BY a LIMIT 2;
@@ -936,12 +936,12 @@ a b c d
2 NULL 2 NULL
EXPLAIN SELECT * FROM t1 JOIN t2 ON b=c ORDER BY a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 128 Using where; Using filesort
-1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.b 1
+1 SIMPLE t1 ALL NULL NULL NULL NULL 128 Using where; Using temporary; Using filesort
+1 SIMPLE t2 hash_ALL PRIMARY #hash#PRIMARY 4 test.t1.b 128 Using join buffer (flat, BNLH join)
EXPLAIN SELECT * FROM t1 JOIN t2 ON a=c ORDER BY a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 128 Using filesort
-1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1
+1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 128 Using temporary; Using filesort
+1 SIMPLE t2 hash_ALL PRIMARY #hash#PRIMARY 4 test.t1.a 128 Using join buffer (flat, BNLH join)
SELECT * FROM t1 JOIN t2 ON b=c ORDER BY a;
a b c d
SELECT * FROM t1 JOIN t2 ON a=c ORDER BY a;
@@ -1106,12 +1106,12 @@ ON t4.a = t5.a
)
ON t1.a = t3.a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 3
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where
1 SIMPLE t3 ref a a 5 test.t1.a 2 Using where; Using index
1 SIMPLE t4 ALL NULL NULL NULL NULL 0 Using where
1 SIMPLE t5 ALL NULL NULL NULL NULL 0 Using where
1 SIMPLE t6 ALL NULL NULL NULL NULL 0 Using where
-1 SIMPLE t2 ALL NULL NULL NULL NULL 10 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.a 10 Using where; Using join buffer (flat, BNLH join)
SELECT *
FROM
t1 JOIN t2 ON t1.a = t2.a
@@ -1310,17 +1310,17 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 system NULL NULL NULL NULL 1
1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 Using where
-1 SIMPLE t4 ALL NULL NULL NULL NULL 4 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 const 4 Using where; Using join buffer (flat, BNLH join)
EXPLAIN
SELECT STRAIGHT_JOIN *
FROM t4 JOIN
(t1 JOIN t3 ON t3.ref_t1=t1.c1 JOIN t2 ON t2.ref_t1=t1.c1)
ON t4.ref_t1=t1.c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 ALL NULL NULL NULL NULL 4
+1 SIMPLE t4 ALL NULL NULL NULL NULL 4 Using where
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join)
-1 SIMPLE t3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-1 SIMPLE t2 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
+1 SIMPLE t3 hash_ALL NULL #hash#$hj 5 test.t4.ref_t1 2 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t4.ref_t1 1 Using where; Using join buffer (incremental, BNLH join)
EXPLAIN
SELECT *
FROM t4 STRAIGHT_JOIN
@@ -1328,9 +1328,9 @@ FROM t4 STRAIGHT_JOIN
ON t4.ref_t1=t1.c1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t4 ALL NULL NULL NULL NULL 4 Using where
-1 SIMPLE t2 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (flat, BNL join)
-1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t4.ref_t1 1
-1 SIMPLE t3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t4.ref_t1 1 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE t1 hash_ALL PRIMARY #hash#PRIMARY 4 test.t4.ref_t1 3 Using join buffer (incremental, BNLH join)
+1 SIMPLE t3 hash_ALL NULL #hash#$hj 5 test.t4.ref_t1 2 Using where; Using join buffer (incremental, BNLH join)
drop table t1,t2,t3,t4;
End of 5.2 tests
#
@@ -1380,7 +1380,7 @@ SELECT * FROM t1 STRAIGHT_JOIN t2 ON t2.f1 = t1.f1
WHERE t1.f1<>0 OR t1.f2<>0 AND t1.f1 = t2.f2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where
-1 SIMPLE t2 ALL f2 NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t2 hash_ALL f2 #hash#$hj 5 test.t1.f1 2 Using where; Using join buffer (flat, BNLH join)
SELECT * FROM t1 STRAIGHT_JOIN t2 ON t2.f1 = t1.f1
WHERE t1.f1<>0 OR t1.f2<>0 AND t1.f1 = t2.f2;
f1 f2 f1 f2
@@ -1395,7 +1395,7 @@ SELECT STRAIGHT_JOIN * FROM t1 JOIN t2 ON t2.f2 = t1.f1
WHERE t1.f1 IN (SELECT f1 FROM t1) AND t1.f1 = t2.f1 OR t1.f1 = 9;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 2 Using where
-1 PRIMARY t2 ALL PRIMARY NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY t2 hash_ALL PRIMARY #hash#$hj 5 test.t1.f1 2 Using where; Using join buffer (flat, BNLH join)
2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 Using index
SELECT STRAIGHT_JOIN * FROM t1 JOIN t2 ON t2.f2 = t1.f1
WHERE t1.f1 IN (SELECT f1 FROM t1) AND t1.f1 = t2.f1 OR t1.f1 = 9;
@@ -1468,7 +1468,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE D system PRIMARY NULL NULL NULL 1
1 SIMPLE DSAR system NULL NULL NULL NULL 1
1 SIMPLE DT range t_id t_id 2 NULL 2 Using where
-1 SIMPLE DSA ref PRIMARY PRIMARY 8 const,test.DT.t_id,func 1 Using index
+1 SIMPLE DSA hash_range PRIMARY #hash#PRIMARY:PRIMARY 8:4 const,test.DT.t_id,func 3 Using where; Using index; Using join buffer (flat, BNLH join)
SELECT * FROM t5 DU, t1 D, t4 DT, t2 DSA, t3 DSAR
WHERE DU.dog_id=D.dog_id AND D.dog_id=DT.dog_id AND D.birthday=DT.birthday AND
DT.t_id=DSA.t_id AND DT.birthday=DSA.birthday AND DSA.dog_id=DSAR.dog_id;
@@ -1515,8 +1515,8 @@ INSERT INTO t2 (a) VALUES (1),(2),(3),(4);
EXPLAIN
SELECT t1.a FROM t1 NATURAL INNER JOIN t2 ORDER BY t1.a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using temporary; Using filesort
-1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using where; Using temporary; Using filesort
+1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t2.a 8 Using where; Using join buffer (flat, BNLH join)
SELECT t1.a FROM t1 NATURAL INNER JOIN t2 ORDER BY t1.a;
a
1
@@ -1526,8 +1526,8 @@ a
EXPLAIN
SELECT t1.a FROM t1 STRAIGHT_JOIN t2 USING(a) ORDER BY t1.a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using temporary; Using filesort
-1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using where; Using temporary; Using filesort
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.a 4 Using where; Using join buffer (flat, BNLH join)
SELECT t1.a FROM t1 STRAIGHT_JOIN t2 USING(a) ORDER BY t1.a;
a
1
@@ -1537,8 +1537,8 @@ a
EXPLAIN
SELECT t1.a FROM t1 NATURAL STRAIGHT_JOIN t2 ORDER BY t1.a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using temporary; Using filesort
-1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using where; Using temporary; Using filesort
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.a 4 Using where; Using join buffer (flat, BNLH join)
SELECT t1.a FROM t1 NATURAL STRAIGHT_JOIN t2 ORDER BY t1.a;
a
1
diff --git a/mysql-test/r/join_cache.result b/mysql-test/r/join_cache.result
index eea397402ad..3cc69246f8a 100644
--- a/mysql-test/r/join_cache.result
+++ b/mysql-test/r/join_cache.result
@@ -777,7 +777,7 @@ Variable_name Value
join_buffer_size 262144
show variables like 'join_cache_level';
Variable_name Value
-join_cache_level 2
+join_cache_level 4
DROP DATABASE world;
CREATE DATABASE world;
use world;
@@ -2691,7 +2691,7 @@ Variable_name Value
join_buffer_size 262144
show variables like 'join_cache_level';
Variable_name Value
-join_cache_level 2
+join_cache_level 4
set join_cache_level=1;
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND City.Population > 3000000;
@@ -3184,7 +3184,7 @@ EXPLAIN
SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.a WHERE t2.b IS NULL;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5
-1 SIMPLE t2 ref i_a i_a 4 test.t1.a 2 Using where; Not exists
+1 SIMPLE t2 hash_ALL i_a #hash#i_a 4 test.t1.a 10 Using where; Not exists; Using join buffer (flat, BNLH join)
SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.a WHERE t2.b IS NULL;
a a b
3 NULL NULL
@@ -4440,7 +4440,7 @@ EXPLAIN
SELECT t2.i FROM t1,t2 WHERE t1.cu = t2.cl ;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 6
-1 SIMPLE t1 ref cu cu 33 func 2 Using where; Using index
+1 SIMPLE t1 hash_index cu #hash#cu:cu 33:33 func 10 Using where; Using index; Using join buffer (flat, BNLH join)
SELECT t2.i FROM t1,t2 WHERE t1.cu = t2.cl ;
i
6
@@ -4514,17 +4514,17 @@ EXPLAIN
SELECT t1.v,t2.i FROM t1,t2 WHERE t2.v = t1.v;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Using where
-1 SIMPLE t2 ref idx idx 13 test.t1.v 3
+1 SIMPLE t2 hash_ALL idx #hash#idx 13 test.t1.v 36 Using join buffer (flat, BNLH join)
SELECT t1.v,t2.i FROM t1,t2 WHERE t2.v = t1.v;
v i
-abcdefjh 4
f 4
f 4
+abcdefjh 4
EXPLAIN
SELECT t1.v,t2.i FROM t1,t2 WHERE t2.v = concat(t1.v, t1.v);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 7
-1 SIMPLE t2 ref idx idx 13 func 3 Using index condition
+1 SIMPLE t2 hash_ALL idx #hash#idx 13 func 36 Using where; Using join buffer (flat, BNLH join)
SELECT t1.v,t2.i FROM t1,t2 WHERE t2.v = concat(t1.v, t1.v);
v i
f 5
@@ -4646,15 +4646,15 @@ INSERT INTO t2 VALUES
SELECT * FROM t1,t2 WHERE t2.a=t1.a;
pk a pk a
2 aa 30 aa
+3 bb 4 bb
2 aa 31 aa
+3 bb 32 bb
2 aa 42 aa
2 aa 130 aa
-2 aa 131 aa
-2 aa 142 aa
-3 bb 4 bb
-3 bb 32 bb
3 bb 14 bb
+2 aa 131 aa
3 bb 132 bb
+2 aa 142 aa
SET SESSION join_cache_level = 4;
EXPLAIN
SELECT * FROM t1,t2 WHERE t2.a=t1.a;
@@ -5062,8 +5062,8 @@ SET SESSION optimizer_switch = 'index_condition_pushdown=off';
EXPLAIN SELECT * FROM t1,t2
WHERE t2.f3 = t1.f2 AND t1.f1 IN (9, 0, 100) ORDER BY t1.f2 LIMIT 1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range f1,f2 f2 13 NULL 10 Using where
-1 SIMPLE t2 ref f3 f3 67 test.t1.f2 2 Using where; Using index
+1 SIMPLE t1 range f1,f2 f1 5 NULL 3 Using where; Rowid-ordered scan; Using temporary; Using filesort
+1 SIMPLE t2 hash_index f3 #hash#f3:f3 67:67 test.t1.f2 19 Using where; Using index; Using join buffer (flat, BNLH join)
SELECT * FROM t1,t2
WHERE t2.f3 = t1.f2 AND t1.f1 IN (9, 0 ,100) ORDER BY t1.f2 LIMIT 1;
f1 f2 f3
@@ -5072,8 +5072,8 @@ SET SESSION optimizer_switch = 'index_condition_pushdown=on';
EXPLAIN SELECT * FROM t1,t2
WHERE t2.f3 = t1.f2 AND t1.f1 IN (9, 0 ,100) ORDER BY t1.f2 LIMIT 1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range f1,f2 f2 13 NULL 10 Using where
-1 SIMPLE t2 ref f3 f3 67 test.t1.f2 2 Using where; Using index
+1 SIMPLE t1 range f1,f2 f1 5 NULL 3 Using index condition; Using where; Rowid-ordered scan; Using temporary; Using filesort
+1 SIMPLE t2 hash_index f3 #hash#f3:f3 67:67 test.t1.f2 19 Using where; Using index; Using join buffer (flat, BNLH join)
SELECT * FROM t1,t2
WHERE t2.f3 = t1.f2 AND t1.f1 IN (9, 0 ,100) ORDER BY t1.f2 LIMIT 1;
f1 f2 f3
@@ -5708,7 +5708,7 @@ explain select * from t0,t1 left join t2 on t1.b=t2.b order by t0.a, t1.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 system NULL NULL NULL NULL 1 Using temporary; Using filesort
1 SIMPLE t1 ALL NULL NULL NULL NULL 10
-1 SIMPLE t2 ALL NULL NULL NULL NULL 10 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.b 10 Using where; Using join buffer (flat, BNLH join)
drop table t0,t1,t2;
# MDEV-6292: huge performance degradation for a sequence
# of LEFT JOIN operations when using join buffer
@@ -5979,8 +5979,8 @@ insert into t1 values
(7), (9), (1), (4), (2), (3), (5), (8), (11), (6), (10);
explain select count(*) from t1, t1 t2 where t1.a=t2.a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 11
-1 SIMPLE t2 ALL NULL NULL NULL NULL 11 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t1 ALL NULL NULL NULL NULL 11 Using where
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.a 11 Using where; Using join buffer (flat, BNLH join)
set join_buffer_space_limit=1024*8;
select @@join_buffer_space_limit;
@@join_buffer_space_limit
@@ -5990,8 +5990,8 @@ select @@join_buffer_size;
262144
explain select count(*) from t1, t1 t2 where t1.a=t2.a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 11
-1 SIMPLE t2 ALL NULL NULL NULL NULL 11 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 11 Using where
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.a 11 Using where
set join_buffer_space_limit=default;
drop table t1;
#
diff --git a/mysql-test/r/join_nested_jcl6.result b/mysql-test/r/join_nested_jcl6.result
index eb59531b7d2..7356f84aa0a 100644
--- a/mysql-test/r/join_nested_jcl6.result
+++ b/mysql-test/r/join_nested_jcl6.result
@@ -2085,7 +2085,7 @@ DROP TABLE t5,t6,t7,t8;
set join_cache_level=default;
show variables like 'join_cache_level';
Variable_name Value
-join_cache_level 2
+join_cache_level 4
set @@optimizer_switch=@save_optimizer_switch_jcl6;
set @optimizer_switch_for_join_nested_test=NULL;
set @join_cache_level_for_join_nested_test=NULL;
diff --git a/mysql-test/r/join_optimizer.result b/mysql-test/r/join_optimizer.result
index ad7267ab665..7c92d54d183 100644
--- a/mysql-test/r/join_optimizer.result
+++ b/mysql-test/r/join_optimizer.result
@@ -33,5 +33,5 @@ SELECT STRAIGHT_JOIN g.id FROM t2 a, t3 g USE INDEX(groups_dt)
WHERE g.domain = 'queue' AND g.type = a.type;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE a ALL NULL NULL NULL NULL 2 Using where
-1 SIMPLE g ref groups_dt groups_dt 70 const,test.a.type 13 Using index condition
+1 SIMPLE g hash_range groups_dt #hash#groups_dt:groups_dt 70:35 const,test.a.type 13 Using index condition; Using where; Using join buffer (flat, BNLH join)
drop table t0,t1,t2,t3;
diff --git a/mysql-test/r/join_outer_innodb.result b/mysql-test/r/join_outer_innodb.result
index 6f3fb09329d..6e6eb07b69a 100644
--- a/mysql-test/r/join_outer_innodb.result
+++ b/mysql-test/r/join_outer_innodb.result
@@ -9,13 +9,13 @@ SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id
WHERE t1.name LIKE 'A%';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index PRIMARY,name name 23 NULL 3 Using where; Using index
-1 SIMPLE t2 ref fkey fkey 5 test.t1.id 1 Using index
+1 SIMPLE t2 hash_index fkey #hash#fkey:fkey 5:5 test.t1.id 5 Using index; Using join buffer (flat, BNLH join)
EXPLAIN
SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id
WHERE t1.name LIKE 'A%' OR FALSE;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index PRIMARY,name name 23 NULL 3 Using where; Using index
-1 SIMPLE t2 ref fkey fkey 5 test.t1.id 1 Using index
+1 SIMPLE t2 hash_index fkey #hash#fkey:fkey 5:5 test.t1.id 5 Using index; Using join buffer (flat, BNLH join)
DROP TABLE t1,t2;
#
# BUG#58456: Assertion 0 in QUICK_INDEX_MERGE_SELECT::need_sorted_output
@@ -134,9 +134,9 @@ WHERE t6b.col_int_key IS TRUE;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t6a ALL NULL NULL NULL NULL 1 Using where
1 SIMPLE t1 ALL NULL NULL NULL NULL 1 Using join buffer (flat, BNL join)
-1 SIMPLE t4 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
+1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t1.pk 1 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t3 ALL NULL NULL NULL NULL 1 Using join buffer (incremental, BNL join)
-1 SIMPLE t5 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
+1 SIMPLE t5 hash_ALL NULL #hash#$hj 5 test.t1.pk 1 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t6b ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
1 SIMPLE t2 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
SELECT t6a.pk, t2.pk
@@ -180,9 +180,9 @@ WHERE t6b.col_int_key IS TRUE;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t6a ALL NULL NULL NULL NULL 1 Using where
1 SIMPLE t1 ALL NULL NULL NULL NULL 1 Using join buffer (flat, BNL join)
-1 SIMPLE t4 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
+1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t1.pk 1 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t3 ALL NULL NULL NULL NULL 1 Using join buffer (incremental, BNL join)
-1 SIMPLE t5 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
+1 SIMPLE t5 hash_ALL NULL #hash#$hj 5 test.t1.pk 1 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t6b ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
1 SIMPLE t2 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
drop table t1,t2,t3,t4,t5,t6;
@@ -433,47 +433,47 @@ left join t16 on t15.o1 = t16.p1
where t1.a10 = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL a4,a6,a5,a7 NULL NULL NULL 3 Using where
-1 SIMPLE t2 ref PRIMARY PRIMARY 4 test.t1.a1 1 Using index
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.b2 1 Using where; Using index
-1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t1.a2 1 Using index
-1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.d1 1 Using where
-1 SIMPLE t6 eq_ref PRIMARY PRIMARY 4 test.t1.a3 1 Using where; Using index
-1 SIMPLE t8 eq_ref PRIMARY PRIMARY 1 test.t1.a4 1 Using index
-1 SIMPLE t7 eq_ref PRIMARY PRIMARY 1 test.t1.a7 1
-1 SIMPLE t9 ref PRIMARY PRIMARY 1 test.t1.a4 1
-1 SIMPLE t11 eq_ref PRIMARY PRIMARY 4 test.t1.a5 1
-1 SIMPLE t12 eq_ref PRIMARY PRIMARY 4 test.t11.k3 1 Using where
-1 SIMPLE l2 eq_ref PRIMARY PRIMARY 4 test.t11.k4 1 Using where
-1 SIMPLE t13 ref PRIMARY,m3 PRIMARY 4 test.t1.a1 1 Using where; Using index
-1 SIMPLE l4 eq_ref PRIMARY PRIMARY 4 test.t13.m2 1 Using where; Using index
-1 SIMPLE m2 ref PRIMARY,m3 PRIMARY 4 test.t1.a1 1 Using where; Using index
-1 SIMPLE l3 eq_ref PRIMARY PRIMARY 4 test.m2.m2 1 Using where
-1 SIMPLE t14 eq_ref PRIMARY PRIMARY 2 test.t1.a8 1 Using where
-1 SIMPLE t15 eq_ref PRIMARY PRIMARY 2 test.t1.a9 1 Using where; Using index
-1 SIMPLE t16 ref PRIMARY PRIMARY 2 test.t15.o1 1 Using where
-1 SIMPLE t10 ALL PRIMARY NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t2 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:8 test.t1.a1 1 Using index; Using join buffer (flat, BNLH join)
+1 SIMPLE t3 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t2.b2 17 Using where; Using index; Using join buffer (incremental, BNLH join)
+1 SIMPLE t4 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t1.a2 5 Using index; Using join buffer (incremental, BNLH join)
+1 SIMPLE t5 hash_ALL PRIMARY #hash#PRIMARY 4 test.t4.d1 3 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t6 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t1.a3 3 Using where; Using index; Using join buffer (incremental, BNLH join)
+1 SIMPLE t8 hash_index PRIMARY #hash#PRIMARY:PRIMARY 1:1 test.t1.a4 4 Using index; Using join buffer (incremental, BNLH join)
+1 SIMPLE t7 hash_ALL PRIMARY #hash#PRIMARY 1 test.t1.a7 6 Using join buffer (incremental, BNLH join)
+1 SIMPLE t9 hash_index PRIMARY #hash#PRIMARY:i3 1:388 test.t1.a4 8 Using index; Using join buffer (incremental, BNLH join)
+1 SIMPLE t11 hash_ALL PRIMARY #hash#PRIMARY 4 test.t1.a5 22 Using join buffer (incremental, BNLH join)
+1 SIMPLE t12 hash_ALL PRIMARY #hash#PRIMARY 4 test.t11.k3 3 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE l2 hash_ALL PRIMARY #hash#PRIMARY 4 test.t11.k4 3 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t13 hash_index PRIMARY,m3 #hash#PRIMARY:PRIMARY 4:12 test.t1.a1 3 Using where; Using index; Using join buffer (incremental, BNLH join)
+1 SIMPLE l4 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t13.m2 3 Using where; Using index; Using join buffer (incremental, BNLH join)
+1 SIMPLE m2 hash_index PRIMARY,m3 #hash#PRIMARY:PRIMARY 4:12 test.t1.a1 3 Using where; Using index; Using join buffer (incremental, BNLH join)
+1 SIMPLE l3 hash_ALL PRIMARY #hash#PRIMARY 4 test.m2.m2 3 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t14 hash_ALL PRIMARY #hash#PRIMARY 2 test.t1.a8 4 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t15 hash_index PRIMARY #hash#PRIMARY:PRIMARY 2:2 test.t1.a9 2 Using where; Using index; Using join buffer (incremental, BNLH join)
+1 SIMPLE t16 hash_ALL PRIMARY #hash#PRIMARY 2 test.t15.o1 4 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t10 ALL PRIMARY NULL NULL NULL 3 Using where; Using join buffer (incremental, BNL join)
explain select * from v1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL a4,a6,a5,a7 NULL NULL NULL 3 Using where
-1 SIMPLE t2 ref PRIMARY PRIMARY 4 test.t1.a1 1 Using index
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.b2 1 Using where; Using index
-1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t1.a2 1 Using index
-1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.d1 1 Using where
-1 SIMPLE t6 eq_ref PRIMARY PRIMARY 4 test.t1.a3 1 Using where; Using index
-1 SIMPLE t8 eq_ref PRIMARY PRIMARY 1 test.t1.a4 1 Using index
-1 SIMPLE t7 eq_ref PRIMARY PRIMARY 1 test.t1.a7 1
-1 SIMPLE t9 ref PRIMARY PRIMARY 1 test.t1.a4 1
-1 SIMPLE t11 eq_ref PRIMARY PRIMARY 4 test.t1.a5 1
-1 SIMPLE t12 eq_ref PRIMARY PRIMARY 4 test.t11.k3 1 Using where
-1 SIMPLE l2 eq_ref PRIMARY PRIMARY 4 test.t11.k4 1 Using where
-1 SIMPLE t13 ref PRIMARY,m3 PRIMARY 4 test.t1.a1 1 Using where; Using index
-1 SIMPLE l4 eq_ref PRIMARY PRIMARY 4 test.t13.m2 1 Using where; Using index
-1 SIMPLE m2 ref PRIMARY,m3 PRIMARY 4 test.t1.a1 1 Using where; Using index
-1 SIMPLE l3 eq_ref PRIMARY PRIMARY 4 test.m2.m2 1 Using where
-1 SIMPLE t14 eq_ref PRIMARY PRIMARY 2 test.t1.a8 1 Using where
-1 SIMPLE t15 eq_ref PRIMARY PRIMARY 2 test.t1.a9 1 Using where; Using index
-1 SIMPLE t16 ref PRIMARY PRIMARY 2 test.t15.o1 1 Using where
-1 SIMPLE t10 ALL PRIMARY NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t2 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:8 test.t1.a1 1 Using index; Using join buffer (flat, BNLH join)
+1 SIMPLE t3 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t2.b2 17 Using where; Using index; Using join buffer (incremental, BNLH join)
+1 SIMPLE t4 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t1.a2 5 Using index; Using join buffer (incremental, BNLH join)
+1 SIMPLE t5 hash_ALL PRIMARY #hash#PRIMARY 4 test.t4.d1 3 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t6 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t1.a3 3 Using where; Using index; Using join buffer (incremental, BNLH join)
+1 SIMPLE t8 hash_index PRIMARY #hash#PRIMARY:PRIMARY 1:1 test.t1.a4 4 Using index; Using join buffer (incremental, BNLH join)
+1 SIMPLE t7 hash_ALL PRIMARY #hash#PRIMARY 1 test.t1.a7 6 Using join buffer (incremental, BNLH join)
+1 SIMPLE t9 hash_index PRIMARY #hash#PRIMARY:i3 1:388 test.t1.a4 8 Using index; Using join buffer (incremental, BNLH join)
+1 SIMPLE t11 hash_ALL PRIMARY #hash#PRIMARY 4 test.t1.a5 22 Using join buffer (incremental, BNLH join)
+1 SIMPLE t12 hash_ALL PRIMARY #hash#PRIMARY 4 test.t11.k3 3 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE l2 hash_ALL PRIMARY #hash#PRIMARY 4 test.t11.k4 3 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t13 hash_index PRIMARY,m3 #hash#PRIMARY:PRIMARY 4:12 test.t1.a1 3 Using where; Using index; Using join buffer (incremental, BNLH join)
+1 SIMPLE l4 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t13.m2 3 Using where; Using index; Using join buffer (incremental, BNLH join)
+1 SIMPLE m2 hash_index PRIMARY,m3 #hash#PRIMARY:PRIMARY 4:12 test.t1.a1 3 Using where; Using index; Using join buffer (incremental, BNLH join)
+1 SIMPLE l3 hash_ALL PRIMARY #hash#PRIMARY 4 test.m2.m2 3 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t14 hash_ALL PRIMARY #hash#PRIMARY 2 test.t1.a8 4 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t15 hash_index PRIMARY #hash#PRIMARY:PRIMARY 2:2 test.t1.a9 2 Using where; Using index; Using join buffer (incremental, BNLH join)
+1 SIMPLE t16 hash_ALL PRIMARY #hash#PRIMARY 2 test.t15.o1 4 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t10 ALL PRIMARY NULL NULL NULL 3 Using where; Using join buffer (incremental, BNL join)
drop view v1;
drop table t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16;
#
diff --git a/mysql-test/r/join_outer_jcl6.result b/mysql-test/r/join_outer_jcl6.result
index 72527040301..c291ea745a7 100644
--- a/mysql-test/r/join_outer_jcl6.result
+++ b/mysql-test/r/join_outer_jcl6.result
@@ -2086,7 +2086,7 @@ WHERE t1.pk BETWEEN 5 AND 6 AND t1.b IS NULL OR t1.b = 5
ORDER BY t1.b;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ref idx idx 4 const 2 100.00 Using where
-1 SIMPLE t2 ref c c 5 test.t1.a 2 100.00
+1 SIMPLE t2 hash_ALL c #hash#c 5 test.t1.a 16 12.50 Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` join `test`.`t1` where `test`.`t2`.`c` = `test`.`t1`.`a` and `test`.`t1`.`b` = 5 order by `test`.`t1`.`b`
SELECT t1.b, t2.c, t2.d FROM t2 JOIN t1 ON t2.c = t1.a
@@ -2094,16 +2094,16 @@ WHERE t1.pk BETWEEN 5 AND 6 AND t1.b IS NULL OR t1.b = 5
ORDER BY t1.b;
b c d
5 8 88
-5 8 81
5 8 88
5 8 81
+5 8 81
EXPLAIN EXTENDED
SELECT t1.b, t2.c, t2.d FROM t2 LEFT JOIN t1 ON t2.c = t1.a
WHERE t1.pk BETWEEN 5 AND 6 AND t1.b IS NULL OR t1.b = 5
ORDER BY t1.b;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ref PRIMARY,idx idx 4 const 2 100.00 Using where
-1 SIMPLE t2 ref c c 5 test.t1.a 2 100.00
+1 SIMPLE t2 hash_ALL c #hash#c 5 test.t1.a 16 12.50 Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` join `test`.`t1` where `test`.`t2`.`c` = `test`.`t1`.`a` and `test`.`t1`.`b` = 5 order by `test`.`t1`.`b`
SELECT t1.b, t2.c, t2.d FROM t2 LEFT JOIN t1 ON t2.c = t1.a
@@ -2111,9 +2111,9 @@ WHERE t1.pk BETWEEN 5 AND 6 AND t1.b IS NULL OR t1.b = 5
ORDER BY t1.b;
b c d
5 8 88
-5 8 81
5 8 88
5 8 81
+5 8 81
DROP TABLE t1,t2;
#
# Bug mdev-4336: LEFT JOIN with disjunctive
@@ -2140,15 +2140,15 @@ insert into t1 select A.a + 10*B.a from t0 A, t0 B;
explain select * from t1 left join t0 on t0.a=t1.pk where t0.person_id='fooo' or 'xyz' IS NULL;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using where
-1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t0.a 1 Using index
+1 SIMPLE t1 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t0.a 100 Using index; Using join buffer (flat, BNLH join)
explain select * from t1 left join t0 on t0.a=t1.pk where t0.person_id='fooo';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using where
-1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t0.a 1 Using index
+1 SIMPLE t1 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t0.a 100 Using index; Using join buffer (flat, BNLH join)
explain select * from t1 left join t0 on t0.a=t1.pk where t0.person_id='fooo' or t0.person_id='bar';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using where
-1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t0.a 1 Using index
+1 SIMPLE t1 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t0.a 100 Using index; Using join buffer (flat, BNLH join)
drop table t0, t1;
#
# MDEV-4836: Wrong result on <not null date column> IS NULL (old documented hack stopped working)
@@ -2229,10 +2229,10 @@ SELECT * FROM t1 LEFT JOIN t2 LEFT JOIN t3 ON i2 = i3 ON i1 = i3
WHERE d3 IS NULL;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
-1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join)
-1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join)
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.i1 2 100.00 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE t3 hash_ALL NULL #hash#$hj 5 test.t1.i1 2 100.00 Using where; Using join buffer (incremental, BNLH join)
Warnings:
-Note 1003 select `test`.`t1`.`i1` AS `i1`,`test`.`t2`.`i2` AS `i2`,`test`.`t3`.`i3` AS `i3`,`test`.`t3`.`d3` AS `d3` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on(`test`.`t2`.`i2` = `test`.`t1`.`i1` and `test`.`t3`.`i3` = `test`.`t1`.`i1`) where `test`.`t3`.`d3` = 0 or `test`.`t3`.`d3` is null
+Note 1003 select `test`.`t1`.`i1` AS `i1`,`test`.`t2`.`i2` AS `i2`,`test`.`t3`.`i3` AS `i3`,`test`.`t3`.`d3` AS `d3` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on(`test`.`t2`.`i2` = `test`.`t1`.`i1` and `test`.`t3`.`i3` = `test`.`t1`.`i1` and `test`.`t1`.`i1` is not null and `test`.`t1`.`i1` is not null) where `test`.`t3`.`d3` = 0 or `test`.`t3`.`d3` is null
DROP TABLE t1,t2,t3;
#
# Bug mdev-6705: wrong on expression after constant row substitution
@@ -2250,9 +2250,9 @@ WHERE b IN (1,2,3) OR b = d;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where
-1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t3 hash_ALL NULL #hash#$hj 5 const 2 100.00 Using where; Using join buffer (flat, BNLH join)
Warnings:
-Note 1003 select 10 AS `a`,8 AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t2` left join `test`.`t3` on(`test`.`t3`.`d` = 10) where `test`.`t2`.`c` = 8 and `test`.`t3`.`d` = 8
+Note 1003 select 10 AS `a`,8 AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t2` left join `test`.`t3` on(`test`.`t3`.`d` = 10 and 10 is not null) where `test`.`t2`.`c` = 8 and `test`.`t3`.`d` = 8
SELECT * FROM t1 INNER JOIN t2 ON c = b LEFT JOIN t3 ON d = a
WHERE b IN (1,2,3) OR b = d;
a b c d
@@ -2279,11 +2279,11 @@ id select_type table type possible_keys key key_len ref rows Extra
explain select * from t1 left join t2 on t2.b is null;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 9
-1 SIMPLE t2 ref b b 5 const 780 Using where
+1 SIMPLE t2 hash_ALL b #hash#b 5 const 1000 Using where; Using join buffer (flat, BNLH join)
explain select * from t1 left join t2 on t2.c is null;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 9
-1 SIMPLE t2 ref c c 5 const 393 Using where
+1 SIMPLE t2 hash_ALL c #hash#c 5 const 1000 Using where; Using join buffer (flat, BNLH join)
drop table t1,t2;
#
# MDEV-10006: optimizer doesn't convert outer join to inner on views with WHERE clause
@@ -2324,9 +2324,9 @@ LEFT JOIN t3 on t2.i2 = t3.i3
) as w1
WHERE v3 = 4;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t3 ref PRIMARY,v3 v3 5 const 1 100.00
-1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t3.i3 1 100.00
-1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t3.i3 1 100.00
+1 SIMPLE t3 ref PRIMARY,v3 v3 5 const 1 100.00 Using index condition
+1 SIMPLE t1 hash_ALL PRIMARY #hash#PRIMARY 4 test.t3.i3 9 11.11 Using join buffer (flat, BNLH join)
+1 SIMPLE t2 hash_ALL PRIMARY #hash#PRIMARY 4 test.t3.i3 9 11.11 Using join buffer (incremental, BNLH join)
Warnings:
Note 1003 select `test`.`t1`.`i1` AS `i1`,`test`.`t1`.`v1` AS `v1`,`test`.`t2`.`i2` AS `i2`,`test`.`t2`.`v2` AS `v2`,`test`.`t3`.`i3` AS `i3`,`test`.`t3`.`v3` AS `v3` from `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t3`.`v3` = 4 and `test`.`t1`.`i1` = `test`.`t3`.`i3` and `test`.`t2`.`i2` = `test`.`t3`.`i3`
# This should have the same join order like the query above:
@@ -2342,9 +2342,9 @@ AND 1 = 1
) as w2
WHERE v3 = 4;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t3 ref PRIMARY,v3 v3 5 const 1 100.00
-1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t3.i3 1 100.00
-1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t3.i3 1 100.00
+1 SIMPLE t3 ref PRIMARY,v3 v3 5 const 1 100.00 Using index condition
+1 SIMPLE t1 hash_ALL PRIMARY #hash#PRIMARY 4 test.t3.i3 9 11.11 Using join buffer (flat, BNLH join)
+1 SIMPLE t2 hash_ALL PRIMARY #hash#PRIMARY 4 test.t3.i3 9 11.11 Using join buffer (incremental, BNLH join)
Warnings:
Note 1003 select `test`.`t1`.`i1` AS `i1`,`test`.`t1`.`v1` AS `v1`,`test`.`t2`.`i2` AS `i2`,`test`.`t2`.`v2` AS `v2`,`test`.`t3`.`i3` AS `i3`,`test`.`t3`.`v3` AS `v3` from `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t3`.`v3` = 4 and `test`.`t1`.`i1` = `test`.`t3`.`i3` and `test`.`t2`.`i2` = `test`.`t3`.`i3`
drop table t1,t2,t3;
@@ -2367,9 +2367,9 @@ ON t1.x = t2.x
WHERE IFNULL(t2.x,0)=0;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
-1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.x 2 100.00 Using where; Using join buffer (flat, BNLH join)
Warnings:
-Note 1003 select `test`.`t1`.`x` AS `x`,`test`.`t2`.`x` AS `x`,ifnull(`test`.`t2`.`x`,0) AS `IFNULL(t2.x,0)`,`f`(`test`.`t2`.`x`,0) AS `f(t2.x,0)` from `test`.`t` `t1` left join `test`.`t` `t2` on(`test`.`t2`.`x` = `test`.`t1`.`x`) where ifnull(`test`.`t2`.`x`,0) = 0
+Note 1003 select `test`.`t1`.`x` AS `x`,`test`.`t2`.`x` AS `x`,ifnull(`test`.`t2`.`x`,0) AS `IFNULL(t2.x,0)`,`f`(`test`.`t2`.`x`,0) AS `f(t2.x,0)` from `test`.`t` `t1` left join `test`.`t` `t2` on(`test`.`t2`.`x` = `test`.`t1`.`x` and `test`.`t1`.`x` is not null) where ifnull(`test`.`t2`.`x`,0) = 0
SELECT t1.x, t2.x, IFNULL(t2.x,0), f(t2.x,0)
FROM t t1 LEFT JOIN t t2
ON t1.x = t2.x
@@ -2383,9 +2383,9 @@ ON t1.x = t2.x
WHERE f(t2.x,0)=0;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
-1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.x 2 100.00 Using where; Using join buffer (flat, BNLH join)
Warnings:
-Note 1003 select `test`.`t1`.`x` AS `x`,`test`.`t2`.`x` AS `x`,ifnull(`test`.`t2`.`x`,0) AS `IFNULL(t2.x,0)`,`f`(`test`.`t2`.`x`,0) AS `f(t2.x,0)` from `test`.`t` `t1` left join `test`.`t` `t2` on(`test`.`t2`.`x` = `test`.`t1`.`x`) where `f`(`test`.`t2`.`x`,0) = 0
+Note 1003 select `test`.`t1`.`x` AS `x`,`test`.`t2`.`x` AS `x`,ifnull(`test`.`t2`.`x`,0) AS `IFNULL(t2.x,0)`,`f`(`test`.`t2`.`x`,0) AS `f(t2.x,0)` from `test`.`t` `t1` left join `test`.`t` `t2` on(`test`.`t2`.`x` = `test`.`t1`.`x` and `test`.`t1`.`x` is not null) where `f`(`test`.`t2`.`x`,0) = 0
drop function f;
drop table t;
CREATE TABLE t1 (
@@ -2423,9 +2423,9 @@ FROM t1 LEFT OUTER JOIN t2 ON t1.col1 = t2.col2
WHERE IFNULL(t2.col3,0) = 0;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
-1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 17 test.t1.col1 2 100.00 Using where; Using join buffer (flat, BNLH join)
Warnings:
-Note 1003 select `test`.`t1`.`col1` AS `col1`,`test`.`t2`.`col1` AS `col1`,`test`.`t2`.`col3` AS `col3` from `test`.`t1` left join `test`.`t2` on(`test`.`t2`.`col2` = `test`.`t1`.`col1`) where ifnull(`test`.`t2`.`col3`,0) = 0
+Note 1003 select `test`.`t1`.`col1` AS `col1`,`test`.`t2`.`col1` AS `col1`,`test`.`t2`.`col3` AS `col3` from `test`.`t1` left join `test`.`t2` on(`test`.`t2`.`col2` = `test`.`t1`.`col1` and `test`.`t1`.`col1` is not null) where ifnull(`test`.`t2`.`col3`,0) = 0
SELECT t1.col1, t2.col1, t2.col3
FROM t1 LEFT OUTER JOIN t2 ON t1.col1 = t2.col2
WHERE f1(t2.col3,0) = 0;
@@ -2437,9 +2437,9 @@ FROM t1 LEFT OUTER JOIN t2 ON t1.col1 = t2.col2
WHERE f1(t2.col3,0) = 0;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
-1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 17 test.t1.col1 2 100.00 Using where; Using join buffer (flat, BNLH join)
Warnings:
-Note 1003 select `test`.`t1`.`col1` AS `col1`,`test`.`t2`.`col1` AS `col1`,`test`.`t2`.`col3` AS `col3` from `test`.`t1` left join `test`.`t2` on(`test`.`t2`.`col2` = `test`.`t1`.`col1`) where `f1`(`test`.`t2`.`col3`,0) = 0
+Note 1003 select `test`.`t1`.`col1` AS `col1`,`test`.`t2`.`col1` AS `col1`,`test`.`t2`.`col3` AS `col3` from `test`.`t1` left join `test`.`t2` on(`test`.`t2`.`col2` = `test`.`t1`.`col1` and `test`.`t1`.`col1` is not null) where `f1`(`test`.`t2`.`col3`,0) = 0
DROP FUNCTION f1;
DROP TABLE t1,t2;
#
@@ -2460,7 +2460,7 @@ SET optimizer_switch=@save_optimizer_switch;
set join_cache_level=default;
show variables like 'join_cache_level';
Variable_name Value
-join_cache_level 2
+join_cache_level 4
set @@optimizer_switch=@save_optimizer_switch_jcl6;
set @optimizer_switch_for_join_outer_test=NULL;
set @join_cache_level_for_join_outer_test=NULL;
diff --git a/mysql-test/r/key_cache.result b/mysql-test/r/key_cache.result
index 1146ae8bbfa..79fb7111e86 100644
--- a/mysql-test/r/key_cache.result
+++ b/mysql-test/r/key_cache.result
@@ -134,7 +134,7 @@ i
explain select count(*) from t1, t2 where t1.p = t2.i;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 2 Using index
-1 SIMPLE t2 ref k1 k1 5 test.t1.p 2 Using index
+1 SIMPLE t2 hash_index k1 #hash#k1:k1 5:5 test.t1.p 4 Using index; Using join buffer (flat, BNLH join)
select count(*) from t1, t2 where t1.p = t2.i;
count(*)
3
@@ -679,7 +679,7 @@ i
explain select count(*) from t1, t2 where t1.p = t2.i;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index k1 k1 5 NULL 1024 Using where; Using index
-1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.i 1 Using index
+1 SIMPLE t1 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t2.i 512 Using index; Using join buffer (flat, BNLH join)
select count(*) from t1, t2 where t1.p = t2.i;
count(*)
256
@@ -687,11 +687,11 @@ select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 # # 0 3172 24 1552 18
small NULL NULL 1048576 1024 # # 0 0 0 0 0
-keycache1 7 NULL 262143 2048 # # 0 14 3 0 0
+keycache1 7 NULL 262143 2048 # # 0 35 4 0 0
select * from information_schema.key_caches where key_cache_name like "key%"
and segment_number is null;
KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
-keycache1 7 NULL 262143 2048 3 # 0 14 3 0 0
+keycache1 7 NULL 262143 2048 4 # 0 35 4 0 0
cache index t2 in keycache1;
Table Op Msg_type Msg_text
test.t2 assign_to_keycache status OK
@@ -699,7 +699,7 @@ update t2 set p=p+3000, i=2 where a='qqqq';
select * from information_schema.key_caches where key_cache_name like "key%"
and segment_number is null;
KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
-keycache1 7 NULL 262143 2048 25 # 0 2082 25 1071 19
+keycache1 7 NULL 262143 2048 26 # 0 2103 26 1071 19
set global keycache2.key_buffer_size=1024*1024;
cache index t2 in keycache2;
Table Op Msg_type Msg_text
@@ -712,7 +712,7 @@ keycache2 NULL NULL 1048576 1024 6 # 0 6 6 3 3
select * from information_schema.key_caches where key_cache_name like "key%"
and segment_number is null;
KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
-keycache1 7 NULL 262143 2048 25 # 0 2082 25 1071 19
+keycache1 7 NULL 262143 2048 26 # 0 2103 26 1071 19
keycache2 NULL NULL 1048576 1024 6 # 0 6 6 3 3
cache index t2 in keycache1;
Table Op Msg_type Msg_text
@@ -753,7 +753,7 @@ select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 # # 0 3172 24 1552 18
small NULL NULL 1048576 1024 # # 0 0 0 0 0
-keycache1 7 NULL 262143 2048 # # 0 3201 43 1594 30
+keycache1 7 NULL 262143 2048 # # 0 3222 44 1594 30
keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3
set global keycache1.key_cache_block_size=2*1024;
insert into t2 values (7000, 3, 'yyyy');
diff --git a/mysql-test/r/limit_rows_examined.result b/mysql-test/r/limit_rows_examined.result
index 7d1ca948c8b..4a2f4cf5491 100644
--- a/mysql-test/r/limit_rows_examined.result
+++ b/mysql-test/r/limit_rows_examined.result
@@ -683,7 +683,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using temporary
1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
2 SUBQUERY t3 ALL NULL NULL NULL NULL 3
-2 SUBQUERY t2 ALL NULL NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join)
+2 SUBQUERY t2 hash_ALL NULL #hash#$hj 5 test.t3.d 3 Using where; Using join buffer (flat, BNLH join)
SELECT DISTINCT a AS field1 FROM t1, t2
WHERE EXISTS (SELECT c FROM t3 LEFT JOIN t2 ON b = d)
HAVING field1 > 'aaa' LIMIT ROWS EXAMINED 20;
diff --git a/mysql-test/r/mdev13607.result b/mysql-test/r/mdev13607.result
index 08848bc645b..8e4fa5c09e7 100644
--- a/mysql-test/r/mdev13607.result
+++ b/mysql-test/r/mdev13607.result
@@ -51,31 +51,31 @@ INNER JOIN
(SELECT p1.* FROM t1 p1 NATURAL JOIN t2 r1 NATURAL JOIN t3 d1 NATURAL JOIN t1 p2 NATURAL JOIN t2 r2 NATURAL JOIN t3 d2 NATURAL JOIN t1 p3 NATURAL JOIN t2 r3 NATURAL JOIN t3 d3 NATURAL JOIN t1 p4 NATURAL JOIN t2 r4 NATURAL JOIN t3 d4 NATURAL JOIN t1 p5 NATURAL JOIN t2 r5 NATURAL JOIN t3 d5 NATURAL JOIN t1 p6 NATURAL JOIN t2 r6 NATURAL JOIN t3 d6 NATURAL JOIN t1 p7 NATURAL JOIN t2 r7 NATURAL JOIN t3 d7 NATURAL JOIN t1 p8 NATURAL JOIN t2 r8 NATURAL JOIN t3 d8 NATURAL JOIN t1 p9 ) gp_16
;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY r1 ALL NULL NULL NULL NULL 2
-1 PRIMARY d1 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
-1 PRIMARY r2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-1 PRIMARY d2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-1 PRIMARY r3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-1 PRIMARY d3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-1 PRIMARY r4 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-1 PRIMARY d4 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-1 PRIMARY r5 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-1 PRIMARY d5 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-1 PRIMARY r6 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-1 PRIMARY d6 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-1 PRIMARY r7 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-1 PRIMARY d7 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-1 PRIMARY r8 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-1 PRIMARY d8 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-1 PRIMARY p1 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-1 PRIMARY p2 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-1 PRIMARY p3 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-1 PRIMARY p4 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-1 PRIMARY p5 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-1 PRIMARY p6 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-1 PRIMARY p7 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-1 PRIMARY p8 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-1 PRIMARY p9 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
+1 PRIMARY r1 ALL NULL NULL NULL NULL 2 Using where
+1 PRIMARY d1 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (flat, BNLH join)
+1 PRIMARY r2 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+1 PRIMARY d2 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+1 PRIMARY r3 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+1 PRIMARY d3 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+1 PRIMARY r4 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+1 PRIMARY d4 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+1 PRIMARY r5 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+1 PRIMARY d5 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+1 PRIMARY r6 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+1 PRIMARY d6 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+1 PRIMARY r7 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+1 PRIMARY d7 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+1 PRIMARY r8 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+1 PRIMARY d8 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+1 PRIMARY p1 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+1 PRIMARY p2 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+1 PRIMARY p3 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+1 PRIMARY p4 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+1 PRIMARY p5 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+1 PRIMARY p6 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+1 PRIMARY p7 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+1 PRIMARY p8 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+1 PRIMARY p9 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
1 PRIMARY <derived3> ALL NULL NULL NULL NULL -1127208515966861312 Using join buffer (incremental, BNL join)
1 PRIMARY <derived4> ALL NULL NULL NULL NULL -1127208515966861312 Using join buffer (incremental, BNL join)
1 PRIMARY <derived5> ALL NULL NULL NULL NULL -1127208515966861312 Using join buffer (incremental, BNL join)
@@ -91,379 +91,379 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived15> ALL NULL NULL NULL NULL -1127208515966861312 Using join buffer (incremental, BNL join)
1 PRIMARY <derived16> ALL NULL NULL NULL NULL -1127208515966861312 Using join buffer (incremental, BNL join)
1 PRIMARY <derived17> ALL NULL NULL NULL NULL -1127208515966861312 Using join buffer (incremental, BNL join)
-17 DERIVED r1 ALL NULL NULL NULL NULL 2
-17 DERIVED d1 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
-17 DERIVED r2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-17 DERIVED d2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-17 DERIVED r3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-17 DERIVED d3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-17 DERIVED r4 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-17 DERIVED d4 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-17 DERIVED r5 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-17 DERIVED d5 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-17 DERIVED r6 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-17 DERIVED d6 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-17 DERIVED r7 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-17 DERIVED d7 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-17 DERIVED r8 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-17 DERIVED d8 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-17 DERIVED p1 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-17 DERIVED p2 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-17 DERIVED p3 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-17 DERIVED p4 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-17 DERIVED p5 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-17 DERIVED p6 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-17 DERIVED p7 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-17 DERIVED p8 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-17 DERIVED p9 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-16 DERIVED r1 ALL NULL NULL NULL NULL 2
-16 DERIVED d1 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
-16 DERIVED r2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-16 DERIVED d2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-16 DERIVED r3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-16 DERIVED d3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-16 DERIVED r4 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-16 DERIVED d4 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-16 DERIVED r5 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-16 DERIVED d5 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-16 DERIVED r6 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-16 DERIVED d6 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-16 DERIVED r7 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-16 DERIVED d7 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-16 DERIVED r8 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-16 DERIVED d8 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-16 DERIVED p1 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-16 DERIVED p2 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-16 DERIVED p3 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-16 DERIVED p4 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-16 DERIVED p5 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-16 DERIVED p6 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-16 DERIVED p7 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-16 DERIVED p8 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-16 DERIVED p9 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-15 DERIVED r1 ALL NULL NULL NULL NULL 2
-15 DERIVED d1 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
-15 DERIVED r2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-15 DERIVED d2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-15 DERIVED r3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-15 DERIVED d3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-15 DERIVED r4 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-15 DERIVED d4 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-15 DERIVED r5 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-15 DERIVED d5 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-15 DERIVED r6 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-15 DERIVED d6 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-15 DERIVED r7 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-15 DERIVED d7 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-15 DERIVED r8 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-15 DERIVED d8 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-15 DERIVED p1 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-15 DERIVED p2 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-15 DERIVED p3 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-15 DERIVED p4 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-15 DERIVED p5 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-15 DERIVED p6 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-15 DERIVED p7 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-15 DERIVED p8 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-15 DERIVED p9 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-14 DERIVED r1 ALL NULL NULL NULL NULL 2
-14 DERIVED d1 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
-14 DERIVED r2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-14 DERIVED d2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-14 DERIVED r3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-14 DERIVED d3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-14 DERIVED r4 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-14 DERIVED d4 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-14 DERIVED r5 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-14 DERIVED d5 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-14 DERIVED r6 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-14 DERIVED d6 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-14 DERIVED r7 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-14 DERIVED d7 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-14 DERIVED r8 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-14 DERIVED d8 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-14 DERIVED p1 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-14 DERIVED p2 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-14 DERIVED p3 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-14 DERIVED p4 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-14 DERIVED p5 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-14 DERIVED p6 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-14 DERIVED p7 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-14 DERIVED p8 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-14 DERIVED p9 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-13 DERIVED r1 ALL NULL NULL NULL NULL 2
-13 DERIVED d1 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
-13 DERIVED r2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-13 DERIVED d2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-13 DERIVED r3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-13 DERIVED d3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-13 DERIVED r4 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-13 DERIVED d4 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-13 DERIVED r5 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-13 DERIVED d5 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-13 DERIVED r6 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-13 DERIVED d6 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-13 DERIVED r7 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-13 DERIVED d7 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-13 DERIVED r8 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-13 DERIVED d8 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-13 DERIVED p1 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-13 DERIVED p2 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-13 DERIVED p3 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-13 DERIVED p4 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-13 DERIVED p5 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-13 DERIVED p6 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-13 DERIVED p7 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-13 DERIVED p8 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-13 DERIVED p9 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-12 DERIVED r1 ALL NULL NULL NULL NULL 2
-12 DERIVED d1 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
-12 DERIVED r2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-12 DERIVED d2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-12 DERIVED r3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-12 DERIVED d3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-12 DERIVED r4 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-12 DERIVED d4 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-12 DERIVED r5 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-12 DERIVED d5 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-12 DERIVED r6 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-12 DERIVED d6 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-12 DERIVED r7 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-12 DERIVED d7 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-12 DERIVED r8 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-12 DERIVED d8 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-12 DERIVED p1 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-12 DERIVED p2 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-12 DERIVED p3 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-12 DERIVED p4 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-12 DERIVED p5 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-12 DERIVED p6 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-12 DERIVED p7 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-12 DERIVED p8 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-12 DERIVED p9 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-11 DERIVED r1 ALL NULL NULL NULL NULL 2
-11 DERIVED d1 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
-11 DERIVED r2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-11 DERIVED d2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-11 DERIVED r3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-11 DERIVED d3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-11 DERIVED r4 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-11 DERIVED d4 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-11 DERIVED r5 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-11 DERIVED d5 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-11 DERIVED r6 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-11 DERIVED d6 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-11 DERIVED r7 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-11 DERIVED d7 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-11 DERIVED r8 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-11 DERIVED d8 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-11 DERIVED p1 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-11 DERIVED p2 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-11 DERIVED p3 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-11 DERIVED p4 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-11 DERIVED p5 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-11 DERIVED p6 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-11 DERIVED p7 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-11 DERIVED p8 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-11 DERIVED p9 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-10 DERIVED r1 ALL NULL NULL NULL NULL 2
-10 DERIVED d1 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
-10 DERIVED r2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-10 DERIVED d2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-10 DERIVED r3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-10 DERIVED d3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-10 DERIVED r4 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-10 DERIVED d4 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-10 DERIVED r5 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-10 DERIVED d5 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-10 DERIVED r6 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-10 DERIVED d6 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-10 DERIVED r7 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-10 DERIVED d7 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-10 DERIVED r8 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-10 DERIVED d8 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-10 DERIVED p1 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-10 DERIVED p2 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-10 DERIVED p3 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-10 DERIVED p4 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-10 DERIVED p5 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-10 DERIVED p6 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-10 DERIVED p7 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-10 DERIVED p8 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-10 DERIVED p9 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-9 DERIVED r1 ALL NULL NULL NULL NULL 2
-9 DERIVED d1 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
-9 DERIVED r2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-9 DERIVED d2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-9 DERIVED r3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-9 DERIVED d3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-9 DERIVED r4 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-9 DERIVED d4 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-9 DERIVED r5 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-9 DERIVED d5 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-9 DERIVED r6 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-9 DERIVED d6 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-9 DERIVED r7 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-9 DERIVED d7 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-9 DERIVED r8 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-9 DERIVED d8 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-9 DERIVED p1 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-9 DERIVED p2 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-9 DERIVED p3 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-9 DERIVED p4 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-9 DERIVED p5 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-9 DERIVED p6 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-9 DERIVED p7 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-9 DERIVED p8 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-9 DERIVED p9 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-8 DERIVED r1 ALL NULL NULL NULL NULL 2
-8 DERIVED d1 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
-8 DERIVED r2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-8 DERIVED d2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-8 DERIVED r3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-8 DERIVED d3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-8 DERIVED r4 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-8 DERIVED d4 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-8 DERIVED r5 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-8 DERIVED d5 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-8 DERIVED r6 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-8 DERIVED d6 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-8 DERIVED r7 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-8 DERIVED d7 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-8 DERIVED r8 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-8 DERIVED d8 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-8 DERIVED p1 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-8 DERIVED p2 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-8 DERIVED p3 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-8 DERIVED p4 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-8 DERIVED p5 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-8 DERIVED p6 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-8 DERIVED p7 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-8 DERIVED p8 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-8 DERIVED p9 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-7 DERIVED r1 ALL NULL NULL NULL NULL 2
-7 DERIVED d1 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
-7 DERIVED r2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-7 DERIVED d2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-7 DERIVED r3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-7 DERIVED d3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-7 DERIVED r4 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-7 DERIVED d4 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-7 DERIVED r5 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-7 DERIVED d5 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-7 DERIVED r6 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-7 DERIVED d6 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-7 DERIVED r7 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-7 DERIVED d7 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-7 DERIVED r8 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-7 DERIVED d8 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-7 DERIVED p1 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-7 DERIVED p2 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-7 DERIVED p3 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-7 DERIVED p4 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-7 DERIVED p5 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-7 DERIVED p6 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-7 DERIVED p7 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-7 DERIVED p8 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-7 DERIVED p9 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-6 DERIVED r1 ALL NULL NULL NULL NULL 2
-6 DERIVED d1 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
-6 DERIVED r2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-6 DERIVED d2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-6 DERIVED r3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-6 DERIVED d3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-6 DERIVED r4 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-6 DERIVED d4 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-6 DERIVED r5 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-6 DERIVED d5 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-6 DERIVED r6 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-6 DERIVED d6 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-6 DERIVED r7 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-6 DERIVED d7 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-6 DERIVED r8 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-6 DERIVED d8 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-6 DERIVED p1 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-6 DERIVED p2 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-6 DERIVED p3 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-6 DERIVED p4 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-6 DERIVED p5 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-6 DERIVED p6 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-6 DERIVED p7 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-6 DERIVED p8 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-6 DERIVED p9 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-5 DERIVED r1 ALL NULL NULL NULL NULL 2
-5 DERIVED d1 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
-5 DERIVED r2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-5 DERIVED d2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-5 DERIVED r3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-5 DERIVED d3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-5 DERIVED r4 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-5 DERIVED d4 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-5 DERIVED r5 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-5 DERIVED d5 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-5 DERIVED r6 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-5 DERIVED d6 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-5 DERIVED r7 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-5 DERIVED d7 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-5 DERIVED r8 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-5 DERIVED d8 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-5 DERIVED p1 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-5 DERIVED p2 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-5 DERIVED p3 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-5 DERIVED p4 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-5 DERIVED p5 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-5 DERIVED p6 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-5 DERIVED p7 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-5 DERIVED p8 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-5 DERIVED p9 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-4 DERIVED r1 ALL NULL NULL NULL NULL 2
-4 DERIVED d1 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
-4 DERIVED r2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-4 DERIVED d2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-4 DERIVED r3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-4 DERIVED d3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-4 DERIVED r4 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-4 DERIVED d4 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-4 DERIVED r5 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-4 DERIVED d5 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-4 DERIVED r6 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-4 DERIVED d6 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-4 DERIVED r7 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-4 DERIVED d7 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-4 DERIVED r8 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-4 DERIVED d8 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-4 DERIVED p1 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-4 DERIVED p2 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-4 DERIVED p3 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-4 DERIVED p4 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-4 DERIVED p5 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-4 DERIVED p6 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-4 DERIVED p7 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-4 DERIVED p8 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-4 DERIVED p9 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-3 DERIVED r1 ALL NULL NULL NULL NULL 2
-3 DERIVED d1 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
-3 DERIVED r2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-3 DERIVED d2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-3 DERIVED r3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-3 DERIVED d3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-3 DERIVED r4 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-3 DERIVED d4 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-3 DERIVED r5 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-3 DERIVED d5 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-3 DERIVED r6 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-3 DERIVED d6 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-3 DERIVED r7 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-3 DERIVED d7 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-3 DERIVED r8 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-3 DERIVED d8 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-3 DERIVED p1 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-3 DERIVED p2 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-3 DERIVED p3 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-3 DERIVED p4 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-3 DERIVED p5 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-3 DERIVED p6 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-3 DERIVED p7 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-3 DERIVED p8 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
-3 DERIVED p9 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (incremental, BNL join)
+17 DERIVED r1 ALL NULL NULL NULL NULL 2 Using where
+17 DERIVED d1 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (flat, BNLH join)
+17 DERIVED r2 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+17 DERIVED d2 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+17 DERIVED r3 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+17 DERIVED d3 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+17 DERIVED r4 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+17 DERIVED d4 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+17 DERIVED r5 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+17 DERIVED d5 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+17 DERIVED r6 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+17 DERIVED d6 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+17 DERIVED r7 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+17 DERIVED d7 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+17 DERIVED r8 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+17 DERIVED d8 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+17 DERIVED p1 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+17 DERIVED p2 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+17 DERIVED p3 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+17 DERIVED p4 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+17 DERIVED p5 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+17 DERIVED p6 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+17 DERIVED p7 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+17 DERIVED p8 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+17 DERIVED p9 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+16 DERIVED r1 ALL NULL NULL NULL NULL 2 Using where
+16 DERIVED d1 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (flat, BNLH join)
+16 DERIVED r2 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+16 DERIVED d2 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+16 DERIVED r3 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+16 DERIVED d3 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+16 DERIVED r4 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+16 DERIVED d4 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+16 DERIVED r5 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+16 DERIVED d5 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+16 DERIVED r6 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+16 DERIVED d6 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+16 DERIVED r7 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+16 DERIVED d7 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+16 DERIVED r8 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+16 DERIVED d8 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+16 DERIVED p1 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+16 DERIVED p2 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+16 DERIVED p3 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+16 DERIVED p4 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+16 DERIVED p5 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+16 DERIVED p6 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+16 DERIVED p7 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+16 DERIVED p8 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+16 DERIVED p9 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+15 DERIVED r1 ALL NULL NULL NULL NULL 2 Using where
+15 DERIVED d1 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (flat, BNLH join)
+15 DERIVED r2 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+15 DERIVED d2 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+15 DERIVED r3 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+15 DERIVED d3 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+15 DERIVED r4 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+15 DERIVED d4 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+15 DERIVED r5 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+15 DERIVED d5 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+15 DERIVED r6 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+15 DERIVED d6 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+15 DERIVED r7 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+15 DERIVED d7 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+15 DERIVED r8 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+15 DERIVED d8 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+15 DERIVED p1 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+15 DERIVED p2 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+15 DERIVED p3 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+15 DERIVED p4 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+15 DERIVED p5 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+15 DERIVED p6 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+15 DERIVED p7 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+15 DERIVED p8 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+15 DERIVED p9 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+14 DERIVED r1 ALL NULL NULL NULL NULL 2 Using where
+14 DERIVED d1 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (flat, BNLH join)
+14 DERIVED r2 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+14 DERIVED d2 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+14 DERIVED r3 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+14 DERIVED d3 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+14 DERIVED r4 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+14 DERIVED d4 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+14 DERIVED r5 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+14 DERIVED d5 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+14 DERIVED r6 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+14 DERIVED d6 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+14 DERIVED r7 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+14 DERIVED d7 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+14 DERIVED r8 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+14 DERIVED d8 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+14 DERIVED p1 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+14 DERIVED p2 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+14 DERIVED p3 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+14 DERIVED p4 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+14 DERIVED p5 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+14 DERIVED p6 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+14 DERIVED p7 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+14 DERIVED p8 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+14 DERIVED p9 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+13 DERIVED r1 ALL NULL NULL NULL NULL 2 Using where
+13 DERIVED d1 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (flat, BNLH join)
+13 DERIVED r2 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+13 DERIVED d2 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+13 DERIVED r3 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+13 DERIVED d3 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+13 DERIVED r4 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+13 DERIVED d4 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+13 DERIVED r5 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+13 DERIVED d5 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+13 DERIVED r6 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+13 DERIVED d6 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+13 DERIVED r7 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+13 DERIVED d7 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+13 DERIVED r8 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+13 DERIVED d8 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+13 DERIVED p1 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+13 DERIVED p2 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+13 DERIVED p3 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+13 DERIVED p4 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+13 DERIVED p5 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+13 DERIVED p6 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+13 DERIVED p7 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+13 DERIVED p8 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+13 DERIVED p9 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+12 DERIVED r1 ALL NULL NULL NULL NULL 2 Using where
+12 DERIVED d1 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (flat, BNLH join)
+12 DERIVED r2 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+12 DERIVED d2 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+12 DERIVED r3 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+12 DERIVED d3 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+12 DERIVED r4 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+12 DERIVED d4 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+12 DERIVED r5 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+12 DERIVED d5 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+12 DERIVED r6 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+12 DERIVED d6 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+12 DERIVED r7 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+12 DERIVED d7 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+12 DERIVED r8 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+12 DERIVED d8 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+12 DERIVED p1 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+12 DERIVED p2 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+12 DERIVED p3 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+12 DERIVED p4 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+12 DERIVED p5 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+12 DERIVED p6 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+12 DERIVED p7 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+12 DERIVED p8 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+12 DERIVED p9 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+11 DERIVED r1 ALL NULL NULL NULL NULL 2 Using where
+11 DERIVED d1 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (flat, BNLH join)
+11 DERIVED r2 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+11 DERIVED d2 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+11 DERIVED r3 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+11 DERIVED d3 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+11 DERIVED r4 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+11 DERIVED d4 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+11 DERIVED r5 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+11 DERIVED d5 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+11 DERIVED r6 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+11 DERIVED d6 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+11 DERIVED r7 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+11 DERIVED d7 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+11 DERIVED r8 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+11 DERIVED d8 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+11 DERIVED p1 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+11 DERIVED p2 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+11 DERIVED p3 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+11 DERIVED p4 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+11 DERIVED p5 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+11 DERIVED p6 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+11 DERIVED p7 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+11 DERIVED p8 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+11 DERIVED p9 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+10 DERIVED r1 ALL NULL NULL NULL NULL 2 Using where
+10 DERIVED d1 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (flat, BNLH join)
+10 DERIVED r2 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+10 DERIVED d2 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+10 DERIVED r3 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+10 DERIVED d3 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+10 DERIVED r4 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+10 DERIVED d4 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+10 DERIVED r5 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+10 DERIVED d5 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+10 DERIVED r6 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+10 DERIVED d6 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+10 DERIVED r7 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+10 DERIVED d7 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+10 DERIVED r8 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+10 DERIVED d8 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+10 DERIVED p1 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+10 DERIVED p2 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+10 DERIVED p3 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+10 DERIVED p4 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+10 DERIVED p5 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+10 DERIVED p6 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+10 DERIVED p7 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+10 DERIVED p8 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+10 DERIVED p9 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+9 DERIVED r1 ALL NULL NULL NULL NULL 2 Using where
+9 DERIVED d1 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (flat, BNLH join)
+9 DERIVED r2 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+9 DERIVED d2 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+9 DERIVED r3 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+9 DERIVED d3 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+9 DERIVED r4 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+9 DERIVED d4 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+9 DERIVED r5 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+9 DERIVED d5 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+9 DERIVED r6 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+9 DERIVED d6 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+9 DERIVED r7 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+9 DERIVED d7 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+9 DERIVED r8 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+9 DERIVED d8 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+9 DERIVED p1 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+9 DERIVED p2 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+9 DERIVED p3 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+9 DERIVED p4 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+9 DERIVED p5 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+9 DERIVED p6 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+9 DERIVED p7 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+9 DERIVED p8 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+9 DERIVED p9 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+8 DERIVED r1 ALL NULL NULL NULL NULL 2 Using where
+8 DERIVED d1 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (flat, BNLH join)
+8 DERIVED r2 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+8 DERIVED d2 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+8 DERIVED r3 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+8 DERIVED d3 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+8 DERIVED r4 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+8 DERIVED d4 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+8 DERIVED r5 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+8 DERIVED d5 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+8 DERIVED r6 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+8 DERIVED d6 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+8 DERIVED r7 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+8 DERIVED d7 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+8 DERIVED r8 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+8 DERIVED d8 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+8 DERIVED p1 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+8 DERIVED p2 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+8 DERIVED p3 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+8 DERIVED p4 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+8 DERIVED p5 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+8 DERIVED p6 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+8 DERIVED p7 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+8 DERIVED p8 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+8 DERIVED p9 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+7 DERIVED r1 ALL NULL NULL NULL NULL 2 Using where
+7 DERIVED d1 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (flat, BNLH join)
+7 DERIVED r2 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+7 DERIVED d2 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+7 DERIVED r3 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+7 DERIVED d3 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+7 DERIVED r4 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+7 DERIVED d4 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+7 DERIVED r5 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+7 DERIVED d5 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+7 DERIVED r6 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+7 DERIVED d6 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+7 DERIVED r7 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+7 DERIVED d7 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+7 DERIVED r8 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+7 DERIVED d8 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+7 DERIVED p1 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+7 DERIVED p2 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+7 DERIVED p3 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+7 DERIVED p4 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+7 DERIVED p5 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+7 DERIVED p6 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+7 DERIVED p7 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+7 DERIVED p8 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+7 DERIVED p9 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+6 DERIVED r1 ALL NULL NULL NULL NULL 2 Using where
+6 DERIVED d1 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (flat, BNLH join)
+6 DERIVED r2 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+6 DERIVED d2 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+6 DERIVED r3 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+6 DERIVED d3 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+6 DERIVED r4 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+6 DERIVED d4 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+6 DERIVED r5 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+6 DERIVED d5 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+6 DERIVED r6 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+6 DERIVED d6 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+6 DERIVED r7 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+6 DERIVED d7 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+6 DERIVED r8 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+6 DERIVED d8 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+6 DERIVED p1 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+6 DERIVED p2 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+6 DERIVED p3 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+6 DERIVED p4 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+6 DERIVED p5 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+6 DERIVED p6 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+6 DERIVED p7 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+6 DERIVED p8 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+6 DERIVED p9 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+5 DERIVED r1 ALL NULL NULL NULL NULL 2 Using where
+5 DERIVED d1 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (flat, BNLH join)
+5 DERIVED r2 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+5 DERIVED d2 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+5 DERIVED r3 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+5 DERIVED d3 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+5 DERIVED r4 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+5 DERIVED d4 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+5 DERIVED r5 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+5 DERIVED d5 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+5 DERIVED r6 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+5 DERIVED d6 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+5 DERIVED r7 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+5 DERIVED d7 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+5 DERIVED r8 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+5 DERIVED d8 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+5 DERIVED p1 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+5 DERIVED p2 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+5 DERIVED p3 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+5 DERIVED p4 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+5 DERIVED p5 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+5 DERIVED p6 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+5 DERIVED p7 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+5 DERIVED p8 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+5 DERIVED p9 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+4 DERIVED r1 ALL NULL NULL NULL NULL 2 Using where
+4 DERIVED d1 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (flat, BNLH join)
+4 DERIVED r2 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+4 DERIVED d2 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+4 DERIVED r3 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+4 DERIVED d3 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+4 DERIVED r4 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+4 DERIVED d4 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+4 DERIVED r5 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+4 DERIVED d5 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+4 DERIVED r6 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+4 DERIVED d6 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+4 DERIVED r7 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+4 DERIVED d7 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+4 DERIVED r8 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+4 DERIVED d8 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+4 DERIVED p1 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+4 DERIVED p2 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+4 DERIVED p3 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+4 DERIVED p4 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+4 DERIVED p5 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+4 DERIVED p6 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+4 DERIVED p7 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+4 DERIVED p8 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+4 DERIVED p9 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+3 DERIVED r1 ALL NULL NULL NULL NULL 2 Using where
+3 DERIVED d1 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (flat, BNLH join)
+3 DERIVED r2 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+3 DERIVED d2 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+3 DERIVED r3 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+3 DERIVED d3 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+3 DERIVED r4 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+3 DERIVED d4 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+3 DERIVED r5 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+3 DERIVED d5 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+3 DERIVED r6 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+3 DERIVED d6 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+3 DERIVED r7 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+3 DERIVED d7 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+3 DERIVED r8 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+3 DERIVED d8 hash_ALL NULL #hash#$hj 5 test.r1.id 2 Using where; Using join buffer (incremental, BNLH join)
+3 DERIVED p1 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+3 DERIVED p2 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+3 DERIVED p3 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+3 DERIVED p4 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+3 DERIVED p5 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+3 DERIVED p6 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+3 DERIVED p7 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+3 DERIVED p8 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
+3 DERIVED p9 hash_ALL NULL #hash#$hj 5 test.r1.id 50 Using where; Using join buffer (incremental, BNLH join)
DROP TABLE t1,t2,t3;
diff --git a/mysql-test/r/mysqld--help.result b/mysql-test/r/mysqld--help.result
index ca773364c1d..f3ffc3ee18d 100644
--- a/mysql-test/r/mysqld--help.result
+++ b/mysql-test/r/mysqld--help.result
@@ -1426,7 +1426,7 @@ init-slave
interactive-timeout 28800
join-buffer-size 262144
join-buffer-space-limit 2097152
-join-cache-level 2
+join-cache-level 4
keep-files-on-create FALSE
key-buffer-size 134217728
key-cache-age-threshold 300
diff --git a/mysql-test/r/null_key.result b/mysql-test/r/null_key.result
index 4b4a4b80dee..cd553b77738 100644
--- a/mysql-test/r/null_key.result
+++ b/mysql-test/r/null_key.result
@@ -181,12 +181,12 @@ insert into t2 values (7),(8);
explain select * from t2 straight_join t1 where t1.a=t2.a and b is null;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where
-1 SIMPLE t1 ref a,b a 10 test.t2.a,const 2 Using where; Using index
+1 SIMPLE t1 hash_range a,b #hash#a:b 10:5 test.t2.a,const 2 Using where; Using join buffer (flat, BNLH join)
drop index b on t1;
explain select * from t2,t1 where t1.a=t2.a and b is null;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where
-1 SIMPLE t1 ref a a 10 test.t2.a,const 2 Using where; Using index
+1 SIMPLE t1 hash_index a #hash#a:a 10:10 test.t2.a,const 15 Using where; Using index; Using join buffer (flat, BNLH join)
select * from t2,t1 where t1.a=t2.a and b is null;
a a b
7 7 NULL
@@ -409,30 +409,30 @@ EXPLAIN SELECT SQL_CALC_FOUND_ROWS * FROM t1 LEFT JOIN t2 ON t1.a=t2.a
LEFT JOIN t3 ON t2.b=t3.b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 4
-1 SIMPLE t2 ref idx idx 5 test.t1.a 1 Using where
-1 SIMPLE t3 ref idx idx 5 test.t2.b 1 Using where; Using index
+1 SIMPLE t2 hash_ALL idx #hash#idx 5 test.t1.a 2 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE t3 hash_index idx #hash#idx:idx 5:5 test.t2.b 15972 Using where; Using index; Using join buffer (incremental, BNLH join)
FLUSH STATUS ;
SELECT SQL_CALC_FOUND_ROWS * FROM t1 LEFT JOIN t2 ON t1.a=t2.a
LEFT JOIN t3 ON t2.b=t3.b;
a a b b
1 1 1 NULL
-2 NULL NULL NULL
3 3 1 NULL
+2 NULL NULL NULL
4 NULL NULL NULL
SELECT FOUND_ROWS();
FOUND_ROWS()
4
SHOW STATUS LIKE "handler_read%";
Variable_name Value
-Handler_read_first 0
-Handler_read_key 6
+Handler_read_first 1
+Handler_read_key 0
Handler_read_last 0
-Handler_read_next 2
+Handler_read_next 15972
Handler_read_prev 0
Handler_read_retry 0
Handler_read_rnd 0
Handler_read_rnd_deleted 0
-Handler_read_rnd_next 5
+Handler_read_rnd_next 8
DROP TABLE t1,t2,t3,t4;
CREATE TABLE t1 (
a int(11) default NULL,
diff --git a/mysql-test/r/opt_tvc.result b/mysql-test/r/opt_tvc.result
index 0ecae5bf157..f80e607830d 100644
--- a/mysql-test/r/opt_tvc.result
+++ b/mysql-test/r/opt_tvc.result
@@ -47,7 +47,7 @@ a b
explain extended select * from t1 where a in (1,2);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 2 100.00
-1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY t1 hash_ALL NULL #hash#$hj 5 tvc_0.1 6 100.00 Using where; Using join buffer (flat, BNLH join)
2 MATERIALIZED <derived3> ALL NULL NULL NULL NULL 2 100.00
3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
@@ -60,7 +60,7 @@ from (values (1),(2)) as tvc_0
);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 2 100.00
-1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY t1 hash_ALL NULL #hash#$hj 5 tvc_0.1 6 100.00 Using where; Using join buffer (flat, BNLH join)
2 MATERIALIZED <derived3> ALL NULL NULL NULL NULL 2 100.00
3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
@@ -91,7 +91,7 @@ where a in (1,2) and
b in (1,5);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <subquery4> ALL distinct_key NULL NULL NULL 2 100.00
-1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY t1 hash_ALL NULL #hash#$hj 5 tvc_1.1 6 100.00 Using where; Using join buffer (flat, BNLH join)
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
4 MATERIALIZED <derived5> ALL NULL NULL NULL NULL 2 100.00
2 MATERIALIZED <derived3> ALL NULL NULL NULL NULL 2 100.00
@@ -112,7 +112,7 @@ from (values (1),(5)) as tvc_1
);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <subquery4> ALL distinct_key NULL NULL NULL 2 100.00
-1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY t1 hash_ALL NULL #hash#$hj 5 tvc_1.1 6 100.00 Using where; Using join buffer (flat, BNLH join)
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
4 MATERIALIZED <derived5> ALL NULL NULL NULL NULL 2 100.00
2 MATERIALIZED <derived3> ALL NULL NULL NULL NULL 2 100.00
@@ -151,7 +151,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
2 MATERIALIZED <derived4> ALL NULL NULL NULL NULL 2 100.00
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 6 100.00 Using where; Using join buffer (flat, BNL join)
+2 MATERIALIZED t2 hash_ALL NULL #hash#$hj 5 tvc_0.3 6 100.00 Using where; Using join buffer (flat, BNLH join)
4 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join ((values (3),(4)) `tvc_0` join `test`.`t2`) where `test`.`t2`.`b` = `tvc_0`.`3`
@@ -169,7 +169,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
2 MATERIALIZED <derived4> ALL NULL NULL NULL NULL 2 100.00
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 6 100.00 Using where; Using join buffer (flat, BNL join)
+2 MATERIALIZED t2 hash_ALL NULL #hash#$hj 5 tvc_0.3 6 100.00 Using where; Using join buffer (flat, BNLH join)
4 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join ((values (3),(4)) `tvc_0` join `test`.`t2`) where `test`.`t2`.`b` = `tvc_0`.`3`
@@ -207,7 +207,7 @@ where a in (1,2)
) as dr_table;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <subquery3> ALL distinct_key NULL NULL NULL 2 100.00
-1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY t1 hash_ALL NULL #hash#$hj 5 tvc_0.1 6 100.00 Using where; Using join buffer (flat, BNLH join)
3 MATERIALIZED <derived4> ALL NULL NULL NULL NULL 2 100.00
4 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
@@ -225,7 +225,7 @@ as tvc_0
) as dr_table;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <subquery3> ALL distinct_key NULL NULL NULL 2 100.00
-1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY t1 hash_ALL NULL #hash#$hj 5 tvc_0.1 6 100.00 Using where; Using join buffer (flat, BNLH join)
3 MATERIALIZED <derived4> ALL NULL NULL NULL NULL 2 100.00
4 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
@@ -266,7 +266,7 @@ where a in (1,2)
select * from tvc_0;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <subquery3> ALL distinct_key NULL NULL NULL 2 100.00
-1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY t1 hash_ALL NULL #hash#$hj 5 tvc_0.1 6 100.00 Using where; Using join buffer (flat, BNLH join)
3 MATERIALIZED <derived4> ALL NULL NULL NULL NULL 2 100.00
4 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
@@ -284,7 +284,7 @@ as tvc_0
) as dr_table;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <subquery3> ALL distinct_key NULL NULL NULL 2 100.00
-1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY t1 hash_ALL NULL #hash#$hj 5 tvc_0.1 6 100.00 Using where; Using join buffer (flat, BNLH join)
3 MATERIALIZED <derived4> ALL NULL NULL NULL NULL 2 100.00
4 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
@@ -317,7 +317,7 @@ a b
explain extended select * from v1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <subquery3> ALL distinct_key NULL NULL NULL 2 100.00
-1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY t1 hash_ALL NULL #hash#$hj 5 tvc_0.1 6 100.00 Using where; Using join buffer (flat, BNLH join)
3 MATERIALIZED <derived4> ALL NULL NULL NULL NULL 2 100.00
4 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
@@ -325,7 +325,7 @@ Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` fr
explain extended select * from v2;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <subquery3> ALL distinct_key NULL NULL NULL 2 100.00
-1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY t1 hash_ALL NULL #hash#$hj 5 tvc_0.1 6 100.00 Using where; Using join buffer (flat, BNLH join)
3 MATERIALIZED <derived4> ALL NULL NULL NULL NULL 2 100.00
4 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
@@ -383,7 +383,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
2 MATERIALIZED <derived5> ALL NULL NULL NULL NULL 2 100.00
-2 MATERIALIZED t1 ALL NULL NULL NULL NULL 6 100.00 Using where; Using join buffer (flat, BNL join)
+2 MATERIALIZED t1 hash_ALL NULL #hash#$hj 5 tvc_0.1 6 100.00 Using where; Using join buffer (flat, BNLH join)
5 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join ((values (1),(2)) `tvc_0` join `test`.`t1`) where `test`.`t1`.`a` = 1 and `test`.`t1`.`a` = `tvc_0`.`1`
@@ -408,7 +408,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
2 MATERIALIZED <derived5> ALL NULL NULL NULL NULL 2 100.00
-2 MATERIALIZED t1 ALL NULL NULL NULL NULL 6 100.00 Using where; Using join buffer (flat, BNL join)
+2 MATERIALIZED t1 hash_ALL NULL #hash#$hj 5 tvc_0.1 6 100.00 Using where; Using join buffer (flat, BNLH join)
5 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join ((values (1),(2)) `tvc_0` join `test`.`t1`) where `test`.`t1`.`a` = 1 and `test`.`t1`.`a` = `tvc_0`.`1`
@@ -502,14 +502,14 @@ set @@in_predicate_conversion_threshold= 2;
select * from t3 where a in (1,4,10);
a b
1 abc
+10 abc
1 todd
1 sm
4 yq
-10 abc
explain extended select * from t3 where a in (1,4,10);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 2 100.00
-1 PRIMARY t3 ref idx idx 5 tvc_0.1 3 100.00
+1 PRIMARY t3 hash_ALL idx #hash#idx 5 tvc_0.1 28 11.67 Using join buffer (flat, BNLH join)
2 MATERIALIZED <derived3> ALL NULL NULL NULL NULL 2 100.00
3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
@@ -522,7 +522,7 @@ a b
explain extended select * from t1 where (a,b) in ((1,2),(3,4));
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 2 100.00
-1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY t1 hash_ALL NULL #hash#$hj 10 tvc_0.1,tvc_0.2 6 100.00 Using where; Using join buffer (flat, BNLH join)
2 MATERIALIZED <derived3> ALL NULL NULL NULL NULL 2 100.00
3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
@@ -541,7 +541,7 @@ where (a,b) in ((1,2),(8,9)) and
(a,c) in ((1,3),(8,0),(5,1));
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 2 100.00
-1 PRIMARY t2 ALL NULL NULL NULL NULL 6 100.00 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY t2 hash_ALL NULL #hash#$hj 10 tvc_0.1,tvc_0.3 6 100.00 Using where; Using join buffer (flat, BNLH join)
2 MATERIALIZED <derived3> ALL NULL NULL NULL NULL 2 100.00
3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result
index e2b05ccec9e..b5b0d457f9a 100644
--- a/mysql-test/r/order_by.result
+++ b/mysql-test/r/order_by.result
@@ -506,25 +506,25 @@ gid sid uid
EXPLAIN select t1.gid, t2.sid, t3.uid from t3, t2, t1 where t2.gid = t1.gid and t2.uid = t3.uid order by t1.gid, t3.uid;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL PRIMARY,uid NULL NULL NULL 6 Using temporary; Using filesort
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 2 test.t2.uid 1 Using where; Using index
-1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.gid 1 Using index
+1 SIMPLE t3 hash_index PRIMARY #hash#PRIMARY:PRIMARY 2:2 test.t2.uid 6 Using where; Using index; Using join buffer (flat, BNLH join)
+1 SIMPLE t1 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t2.gid 6 Using index; Using join buffer (incremental, BNLH join)
EXPLAIN SELECT t1.gid, t3.uid from t1, t3 where t1.gid = t3.uid order by t1.gid,t3.skr;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t3 ALL PRIMARY NULL NULL NULL 6 Using temporary; Using filesort
-1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t3.uid 1 Using where; Using index
+1 SIMPLE t1 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t3.uid 6 Using where; Using index; Using join buffer (flat, BNLH join)
EXPLAIN SELECT t1.gid, t2.sid, t3.uid from t2, t1, t3 where t2.gid = t1.gid and t2.uid = t3.uid order by t3.uid, t1.gid;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL PRIMARY,uid NULL NULL NULL 6 Using temporary; Using filesort
-1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.gid 1 Using index
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 2 test.t2.uid 1 Using where; Using index
+1 SIMPLE t1 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t2.gid 6 Using index; Using join buffer (flat, BNLH join)
+1 SIMPLE t3 hash_index PRIMARY #hash#PRIMARY:PRIMARY 2:2 test.t2.uid 6 Using where; Using index; Using join buffer (incremental, BNLH join)
EXPLAIN SELECT t1.gid, t3.uid from t1, t3 where t1.gid = t3.uid order by t3.skr,t1.gid;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t3 ALL PRIMARY NULL NULL NULL 6 Using temporary; Using filesort
-1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t3.uid 1 Using where; Using index
+1 SIMPLE t1 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t3.uid 6 Using where; Using index; Using join buffer (flat, BNLH join)
EXPLAIN SELECT t1.gid, t3.uid from t1, t3 where t1.skr = t3.uid order by t1.gid,t3.skr;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 2 test.t1.skr 1 Using index condition
+1 SIMPLE t3 hash_ALL PRIMARY #hash#PRIMARY 2 test.t1.skr 6 Using where; Using join buffer (flat, BNLH join)
drop table t1,t2,t3;
CREATE TABLE t1 (
`titre` char(80) NOT NULL default '',
@@ -1503,7 +1503,7 @@ WHERE t2.b=14 AND t2.a=t1.a AND 5.1<t2.c AND t1.b='DE'
ORDER BY t2.c LIMIT 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref a,b b 4 const 4 Using index condition; Using where; Using temporary; Using filesort
-1 SIMPLE t2 ref a,b,c a 40 test.t1.a,const 11 Using index condition
+1 SIMPLE t2 hash_ALL a,b,c #hash#a 40 test.t1.a,const 526 Using where; Using join buffer (flat, BNLH join)
SELECT d FROM t1, t2
WHERE t2.b=14 AND t2.a=t1.a AND 5.1<t2.c AND t1.b='DE'
ORDER BY t2.c LIMIT 1;
@@ -1514,8 +1514,8 @@ SELECT d FROM t3 AS t1, t2 AS t2
WHERE t2.b=14 AND t2.a=t1.a AND 5.1<t2.c AND t1.b='DE'
ORDER BY t2.c LIMIT 1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 range a,b,c c 5 NULL 420 Using where
-1 SIMPLE t1 ref a a 39 test.t2.a,const 10 Using where; Using index
+1 SIMPLE t2 ref a,b,c b 5 const 139 Using where; Using temporary; Using filesort
+1 SIMPLE t1 hash_index a #hash#a:a 39:39 test.t2.a,const 991 Using where; Using index; Using join buffer (flat, BNLH join)
SELECT d FROM t3 AS t1, t2 AS t2
WHERE t2.b=14 AND t2.a=t1.a AND 5.1<t2.c AND t1.b='DE'
ORDER BY t2.c LIMIT 1;
@@ -2556,7 +2556,7 @@ ORDER by c
LIMIT 2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL a 8 NULL 10 Using index; Using temporary; Using filesort
-1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 Using where
+1 SIMPLE t2 hash_ALL PRIMARY #hash#PRIMARY 4 test.t1.b 10 Using where; Using join buffer (flat, BNLH join)
DROP TABLE t1, t2;
#
# Bug #707848: WHERE condition with OR + ORDER BY + field substitution
@@ -2569,8 +2569,8 @@ SELECT * FROM t1 r JOIN t1 s ON r.a = s.a
WHERE s.a IN (2,9) OR s.a < 100 AND s.a != 0
ORDER BY 1 LIMIT 10;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE r range PRIMARY PRIMARY 4 NULL 12 100.00 Using where; Using index
-1 SIMPLE s eq_ref PRIMARY PRIMARY 4 test.r.a 1 100.00 Using index
+1 SIMPLE r index PRIMARY PRIMARY 4 NULL 12 100.00 Using where; Using index; Using temporary; Using filesort
+1 SIMPLE s hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.r.a 12 8.33 Using index; Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`r`.`a` AS `a`,`test`.`s`.`a` AS `a` from `test`.`t1` `r` join `test`.`t1` `s` where `test`.`s`.`a` = `test`.`r`.`a` and (`test`.`r`.`a` in (2,9) or `test`.`r`.`a` < 100 and `test`.`r`.`a` <> 0) order by 1 limit 10
SELECT * FROM t1 r JOIN t1 s ON r.a = s.a
@@ -2635,9 +2635,9 @@ SELECT t1.*, t2.* FROM t1 JOIN t2 ON t1.i1 = t2.i2
LEFT JOIN t3 ON t2.i2 = t3.i3
ORDER BY t1.i1 LIMIT 5;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t3 system NULL NULL NULL NULL 0 0.00 Const row not found
-1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 5 100.00 Using index
-1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.i1 1 100.00 Using index
+1 SIMPLE t3 system NULL NULL NULL NULL 0 0.00 Const row not found; Using temporary; Using filesort
+1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 12 100.00 Using index
+1 SIMPLE t2 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t1.i1 12 8.33 Using index; Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t1`.`i1` AS `i1`,`test`.`t2`.`i2` AS `i2` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`i2` = `test`.`t1`.`i1` order by `test`.`t1`.`i1` limit 5
SELECT t1.*, t2.* FROM t1 JOIN t2 ON t1.i1 = t2.i2
@@ -2678,28 +2678,28 @@ explain extended
SELECT t2.b AS field1 FROM t1, t2 WHERE t1.b = t2.a GROUP BY field1 ORDER BY t1.b, field1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where; Using temporary; Using filesort
-1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00
+1 SIMPLE t2 hash_ALL PRIMARY #hash#PRIMARY 4 test.t1.b 15 6.67 Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t2`.`b` AS `field1` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`b` group by `test`.`t2`.`b` order by `test`.`t1`.`b`
explain extended
SELECT t2.b, t1.b FROM t1, t2 WHERE t1.b = t2.a GROUP BY t2.b ORDER BY t1.b, t2.b;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where; Using temporary; Using filesort
-1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00
+1 SIMPLE t2 hash_ALL PRIMARY #hash#PRIMARY 4 test.t1.b 15 6.67 Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t2`.`b` AS `b`,`test`.`t1`.`b` AS `b` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`b` group by `test`.`t2`.`b` order by `test`.`t1`.`b`
explain extended
SELECT t2.b,t1.b FROM t1, t2 WHERE t1.b = t2.a GROUP BY t2.b ORDER BY t1.b;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where; Using temporary; Using filesort
-1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00
+1 SIMPLE t2 hash_ALL PRIMARY #hash#PRIMARY 4 test.t1.b 15 6.67 Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t2`.`b` AS `b`,`test`.`t1`.`b` AS `b` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`b` group by `test`.`t2`.`b` order by `test`.`t1`.`b`
explain extended
SELECT t2.b FROM t1, t2 WHERE t1.b = t2.a GROUP BY t2.b ORDER BY t1.b;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where; Using temporary; Using filesort
-1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00
+1 SIMPLE t2 hash_ALL PRIMARY #hash#PRIMARY 4 test.t1.b 15 6.67 Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`b` group by `test`.`t2`.`b` order by `test`.`t1`.`b`
drop table t1,t2;
@@ -2900,18 +2900,18 @@ INSERT INTO t2 VALUES
EXPLAIN
SELECT t1.a FROM t1 LEFT JOIN t2 ON t1.a=t2.a ORDER BY t1.a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL PRIMARY 4 NULL 8 Using index
-1 SIMPLE t2 ref i_a i_a 5 test.t1.a 2 Using index
+1 SIMPLE t1 index NULL PRIMARY 4 NULL 8 Using index; Using temporary; Using filesort
+1 SIMPLE t2 hash_index i_a #hash#i_a:i_a 5:5 test.t1.a 10 Using index; Using join buffer (flat, BNLH join)
EXPLAIN
SELECT t1.a FROM t1 LEFT JOIN t2 ON t1.a=t2.a ORDER BY t1.a LIMIT 8;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL PRIMARY 4 NULL 4 Using index
-1 SIMPLE t2 ref i_a i_a 5 test.t1.a 2 Using index
+1 SIMPLE t1 index NULL PRIMARY 4 NULL 8 Using index; Using temporary; Using filesort
+1 SIMPLE t2 hash_index i_a #hash#i_a:i_a 5:5 test.t1.a 10 Using index; Using join buffer (flat, BNLH join)
EXPLAIN
SELECT t1.a FROM t1 LEFT JOIN t2 ON t1.a=t2.a ORDER BY t1.a LIMIT 100;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL PRIMARY 4 NULL 8 Using index
-1 SIMPLE t2 ref i_a i_a 5 test.t1.a 2 Using index
+1 SIMPLE t1 index NULL PRIMARY 4 NULL 8 Using index; Using temporary; Using filesort
+1 SIMPLE t2 hash_index i_a #hash#i_a:i_a 5:5 test.t1.a 10 Using index; Using join buffer (flat, BNLH join)
DROP TABLE t1,t2;
#
# MDEV-4974 memory leak in 5.5.32-MariaDB-1~wheezy-log
@@ -2989,8 +2989,8 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1 100.00 Using temporary; Using filesort
1 PRIMARY t1 system NULL NULL NULL NULL 1 100.00
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00
-1 PRIMARY t3a ALL NULL NULL NULL NULL 2 100.00 Using where; Start temporary
-1 PRIMARY t3b ref f3_key f3_key 6 test.t3a.f3 1 100.00 Using where; End temporary
+1 PRIMARY t3a ALL NULL NULL NULL NULL 2 100.00 Using where; Start temporary; Using join buffer (flat, BNL join)
+1 PRIMARY t3b hash_ALL f3_key #hash#f3_key 6 test.t3a.f3 2 50.00 Using where; End temporary; Using join buffer (incremental, BNLH join)
Warnings:
Note 1003 select concat('foo',`test`.`t2`.`f2`) AS `field` from `test`.`t2` semi join ((`test`.`t3` `t3a` join `test`.`t3` `t3b`)) where `test`.`t3a`.`f3` < 'foo' or `test`.`t3b`.`f3` <> 'foo' order by concat('foo',`test`.`t2`.`f2`)
DROP TABLE t1,t2,t3;
@@ -3076,8 +3076,8 @@ explain
select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b
from t2, t3 where t2.a=t3.a order by t2.a limit 5;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 index a a 5 NULL 5 Using where
-1 SIMPLE t3 ref a a 5 test.t2.a 1
+1 SIMPLE t2 ALL a NULL NULL NULL 200 Using where; Using temporary; Using filesort
+1 SIMPLE t3 hash_ALL a #hash#a 5 test.t2.a 2000 Using join buffer (flat, BNLH join)
#
# This is Q2 which used to have "Using temporary; using filesort" but
# has the same query plan as Q1:
@@ -3086,8 +3086,8 @@ explain
select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b
from t2, t3 where t2.a=t3.a order by t3.a limit 5;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 index a a 5 NULL 5 Using where
-1 SIMPLE t3 ref a a 5 test.t2.a 1
+1 SIMPLE t2 ALL a NULL NULL NULL 200 Using where; Using temporary; Using filesort
+1 SIMPLE t3 hash_ALL a #hash#a 5 test.t2.a 2000 Using join buffer (flat, BNLH join)
select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b
from t2, t3 where t2.a=t3.a order by t2.a limit 5;
pk a b pk a b
@@ -3111,14 +3111,14 @@ explain
select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b
from t2, t3 where t2.a=t3.a order by t2.a limit 25;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ALL a NULL NULL NULL 200 Using where; Using filesort
-1 SIMPLE t3 ref a a 5 test.t2.a 1
+1 SIMPLE t2 ALL a NULL NULL NULL 200 Using where; Using temporary; Using filesort
+1 SIMPLE t3 hash_ALL a #hash#a 5 test.t2.a 2000 Using join buffer (flat, BNLH join)
explain
select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b
from t2, t3 where t2.a=t3.a order by t3.a limit 25;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ALL a NULL NULL NULL 200 Using where; Using filesort
-1 SIMPLE t3 ref a a 5 test.t2.a 1
+1 SIMPLE t2 ALL a NULL NULL NULL 200 Using where; Using temporary; Using filesort
+1 SIMPLE t3 hash_ALL a #hash#a 5 test.t2.a 2000 Using join buffer (flat, BNLH join)
select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b
from t2, t3 where t2.a=t3.a order by t2.a limit 25;
pk a b pk a b
@@ -3247,7 +3247,7 @@ books.scheduled_for_removal=0 )
ORDER BY wings.id;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 1 100.00 Using temporary; Using filesort
-1 PRIMARY wings eq_ref PRIMARY PRIMARY 4 test.books.wings_id 1 100.00
+1 PRIMARY wings hash_ALL PRIMARY #hash#PRIMARY 4 test.books.wings_id 2 50.00 Using join buffer (flat, BNLH join)
2 MATERIALIZED books ref library_idx library_idx 4 const 1 100.00 Using where
Warnings:
Note 1003 select `test`.`wings`.`id` AS `wing_id`,`test`.`wings`.`department_id` AS `department_id` from `test`.`wings` semi join (`test`.`books`) where `test`.`books`.`library_id` = 8663 and `test`.`books`.`scheduled_for_removal` = 0 and `test`.`wings`.`id` = `test`.`books`.`wings_id` order by `test`.`wings`.`id`
diff --git a/mysql-test/r/pool_of_threads.result b/mysql-test/r/pool_of_threads.result
index b25d8d1e50e..e016d3d090a 100644
--- a/mysql-test/r/pool_of_threads.result
+++ b/mysql-test/r/pool_of_threads.result
@@ -600,19 +600,19 @@ fld3
explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by t3.t2nr,fld3;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL fld1 NULL NULL NULL 1199 Using where; Using temporary; Using filesort
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.fld1 1 Using where; Using index
+1 SIMPLE t3 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t2.fld1 41810 Using where; Using index; Using join buffer (flat, BNLH join)
explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using filesort
-1 SIMPLE t3 ref period period 4 test.t1.period 4181
+1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using temporary; Using filesort
+1 SIMPLE t3 hash_ALL period #hash#period 4 test.t1.period 41810 Using join buffer (flat, BNLH join)
explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t3 index period period 4 NULL 1
-1 SIMPLE t1 ref period period 4 test.t3.period 4181
+1 SIMPLE t3 ALL period NULL NULL NULL 41810 Using temporary; Using filesort
+1 SIMPLE t1 hash_ALL period #hash#period 4 test.t3.period 41810 Using join buffer (flat, BNLH join)
explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index period period 4 NULL 1
-1 SIMPLE t3 ref period period 4 test.t1.period 4181
+1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using temporary; Using filesort
+1 SIMPLE t3 hash_ALL period #hash#period 4 test.t1.period 41810 Using join buffer (flat, BNLH join)
select period from t1;
period
9410
@@ -1381,15 +1381,15 @@ delete from t2 where fld1=999999;
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
-1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
+1 SIMPLE t4 hash_ALL PRIMARY #hash#PRIMARY 1 test.t2.companynr 12 Using join buffer (flat, BNLH join)
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
-1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
+1 SIMPLE t4 hash_ALL PRIMARY #hash#PRIMARY 1 test.t2.companynr 12 Using join buffer (flat, BNLH join)
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
-1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
+1 SIMPLE t4 hash_ALL PRIMARY #hash#PRIMARY 1 test.t2.companynr 12 Using join buffer (flat, BNLH join)
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
@@ -1434,7 +1434,7 @@ companynr companynr
explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using index; Using temporary
-1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 1 func 1199 Using where; Using join buffer (flat, BNLH join)
select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008;
fld1 companynr fld3 period
038008 37 reporters 1008
diff --git a/mysql-test/r/select_jcl6.result b/mysql-test/r/select_jcl6.result
index d78fad15da1..9235fc5b1c5 100644
--- a/mysql-test/r/select_jcl6.result
+++ b/mysql-test/r/select_jcl6.result
@@ -5562,7 +5562,7 @@ End of 10.0 tests
set join_cache_level=default;
show variables like 'join_cache_level';
Variable_name Value
-join_cache_level 2
+join_cache_level 4
set @@optimizer_switch=@save_optimizer_switch_jcl6;
set @optimizer_switch_for_select_test=NULL;
set @join_cache_level_for_select_test=NULL;
diff --git a/mysql-test/r/select_safe.result b/mysql-test/r/select_safe.result
index 60364b8c4ec..fc048906f86 100644
--- a/mysql-test/r/select_safe.result
+++ b/mysql-test/r/select_safe.result
@@ -69,12 +69,12 @@ insert into t1 values (null,"x"),(null,"x"),(null,"y"),(null,"y"),(null,"z"),(nu
explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL b NULL NULL NULL 41 Using where
-1 SIMPLE t2 ref b b 21 test.t1.b 6
+1 SIMPLE t2 hash_ALL b #hash#b 21 test.t1.b 41 Using join buffer (flat, BNLH join)
set MAX_SEEKS_FOR_KEY=1;
explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL b NULL NULL NULL 41 Using where
-1 SIMPLE t2 ref b b 21 test.t1.b 6
+1 SIMPLE t2 hash_ALL b #hash#b 21 test.t1.b 41 Using join buffer (flat, BNLH join)
SET MAX_SEEKS_FOR_KEY=DEFAULT;
drop table t1;
create table t1 (a int);
diff --git a/mysql-test/r/signal_demo1.result b/mysql-test/r/signal_demo1.result
index 752f23a48d6..fea4be81bcc 100644
--- a/mysql-test/r/signal_demo1.result
+++ b/mysql-test/r/signal_demo1.result
@@ -250,9 +250,9 @@ left join ab_physical_person pp on po.cust_id = pp.person_id
left join ab_moral_person mp on po.cust_id = company_id
;
PO# Sold to
+3 Local school
1 John A Doe
2 Marry B Smith
-3 Local school
select po_id as "PO#",
ol.line_no as "Line",
ol.item_id as "Item",
diff --git a/mysql-test/r/ssl.result b/mysql-test/r/ssl.result
index 5de9e5174d8..2a554d6dbee 100644
--- a/mysql-test/r/ssl.result
+++ b/mysql-test/r/ssl.result
@@ -608,19 +608,19 @@ fld3
explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by t3.t2nr,fld3;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL fld1 NULL NULL NULL 1199 Using where; Using temporary; Using filesort
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.fld1 1 Using where; Using index
+1 SIMPLE t3 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t2.fld1 41810 Using where; Using index; Using join buffer (flat, BNLH join)
explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using filesort
-1 SIMPLE t3 ref period period 4 test.t1.period 4181
+1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using temporary; Using filesort
+1 SIMPLE t3 hash_ALL period #hash#period 4 test.t1.period 41810 Using join buffer (flat, BNLH join)
explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t3 index period period 4 NULL 1
-1 SIMPLE t1 ref period period 4 test.t3.period 4181
+1 SIMPLE t3 ALL period NULL NULL NULL 41810 Using temporary; Using filesort
+1 SIMPLE t1 hash_ALL period #hash#period 4 test.t3.period 41810 Using join buffer (flat, BNLH join)
explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index period period 4 NULL 1
-1 SIMPLE t3 ref period period 4 test.t1.period 4181
+1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using temporary; Using filesort
+1 SIMPLE t3 hash_ALL period #hash#period 4 test.t1.period 41810 Using join buffer (flat, BNLH join)
select period from t1;
period
9410
@@ -1389,15 +1389,15 @@ delete from t2 where fld1=999999;
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
-1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
+1 SIMPLE t4 hash_ALL PRIMARY #hash#PRIMARY 1 test.t2.companynr 12 Using join buffer (flat, BNLH join)
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
-1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
+1 SIMPLE t4 hash_ALL PRIMARY #hash#PRIMARY 1 test.t2.companynr 12 Using join buffer (flat, BNLH join)
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
-1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
+1 SIMPLE t4 hash_ALL PRIMARY #hash#PRIMARY 1 test.t2.companynr 12 Using join buffer (flat, BNLH join)
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
@@ -1442,7 +1442,7 @@ companynr companynr
explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using index; Using temporary
-1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 1 func 1199 Using where; Using join buffer (flat, BNLH join)
select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008;
fld1 companynr fld3 period
038008 37 reporters 1008
diff --git a/mysql-test/r/ssl_compress.result b/mysql-test/r/ssl_compress.result
index 4e37cc68a24..697354843b5 100644
--- a/mysql-test/r/ssl_compress.result
+++ b/mysql-test/r/ssl_compress.result
@@ -605,19 +605,19 @@ fld3
explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by t3.t2nr,fld3;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL fld1 NULL NULL NULL 1199 Using where; Using temporary; Using filesort
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.fld1 1 Using where; Using index
+1 SIMPLE t3 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t2.fld1 41810 Using where; Using index; Using join buffer (flat, BNLH join)
explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using filesort
-1 SIMPLE t3 ref period period 4 test.t1.period 4181
+1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using temporary; Using filesort
+1 SIMPLE t3 hash_ALL period #hash#period 4 test.t1.period 41810 Using join buffer (flat, BNLH join)
explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t3 index period period 4 NULL 1
-1 SIMPLE t1 ref period period 4 test.t3.period 4181
+1 SIMPLE t3 ALL period NULL NULL NULL 41810 Using temporary; Using filesort
+1 SIMPLE t1 hash_ALL period #hash#period 4 test.t3.period 41810 Using join buffer (flat, BNLH join)
explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index period period 4 NULL 1
-1 SIMPLE t3 ref period period 4 test.t1.period 4181
+1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using temporary; Using filesort
+1 SIMPLE t3 hash_ALL period #hash#period 4 test.t1.period 41810 Using join buffer (flat, BNLH join)
select period from t1;
period
9410
@@ -1386,15 +1386,15 @@ delete from t2 where fld1=999999;
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
-1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
+1 SIMPLE t4 hash_ALL PRIMARY #hash#PRIMARY 1 test.t2.companynr 12 Using join buffer (flat, BNLH join)
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
-1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
+1 SIMPLE t4 hash_ALL PRIMARY #hash#PRIMARY 1 test.t2.companynr 12 Using join buffer (flat, BNLH join)
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
-1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
+1 SIMPLE t4 hash_ALL PRIMARY #hash#PRIMARY 1 test.t2.companynr 12 Using join buffer (flat, BNLH join)
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
@@ -1439,7 +1439,7 @@ companynr companynr
explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using index; Using temporary
-1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 1 func 1199 Using where; Using join buffer (flat, BNLH join)
select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008;
fld1 companynr fld3 period
038008 37 reporters 1008
diff --git a/mysql-test/r/stat_tables_disabled.result b/mysql-test/r/stat_tables_disabled.result
index f57abc34e0c..36e8606e95d 100644
--- a/mysql-test/r/stat_tables_disabled.result
+++ b/mysql-test/r/stat_tables_disabled.result
@@ -30,8 +30,8 @@ order by revenue desc, o_orderdate
limit 10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE orders ALL PRIMARY,i_o_orderdate,i_o_custkey NULL NULL NULL # Using where; Using temporary; Using filesort
-1 SIMPLE customer eq_ref PRIMARY PRIMARY 4 dbt3_s001.orders.o_custkey # Using where
-1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey # Using where
+1 SIMPLE customer hash_ALL PRIMARY #hash#PRIMARY 4 dbt3_s001.orders.o_custkey # Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE lineitem hash_ALL PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity #hash#PRIMARY 4 dbt3_s001.orders.o_orderkey # Using where; Using join buffer (incremental, BNLH join)
set use_stat_tables='preferably';
EXPLAIN select sql_calc_found_rows straight_join
l_orderkey, sum(l_extendedprice*(1-l_discount)) as revenue,
@@ -45,8 +45,8 @@ order by revenue desc, o_orderdate
limit 10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE orders ALL PRIMARY,i_o_orderdate,i_o_custkey NULL NULL NULL 1500 Using where; Using temporary; Using filesort
-1 SIMPLE customer eq_ref PRIMARY PRIMARY 4 dbt3_s001.orders.o_custkey 1 Using where
-1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 Using where
+1 SIMPLE customer hash_ALL PRIMARY #hash#PRIMARY 4 dbt3_s001.orders.o_custkey 150 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE lineitem hash_ALL PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity #hash#PRIMARY 4 dbt3_s001.orders.o_orderkey 6005 Using where; Using join buffer (incremental, BNLH join)
flush tables customer, orders, lineitem;
EXPLAIN select sql_calc_found_rows straight_join
l_orderkey, sum(l_extendedprice*(1-l_discount)) as revenue,
@@ -60,8 +60,8 @@ order by revenue desc, o_orderdate
limit 10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE orders ALL PRIMARY,i_o_orderdate,i_o_custkey NULL NULL NULL 1500 Using where; Using temporary; Using filesort
-1 SIMPLE customer eq_ref PRIMARY PRIMARY 4 dbt3_s001.orders.o_custkey 1 Using where
-1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 Using where
+1 SIMPLE customer hash_ALL PRIMARY #hash#PRIMARY 4 dbt3_s001.orders.o_custkey 150 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE lineitem hash_ALL PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity #hash#PRIMARY 4 dbt3_s001.orders.o_orderkey 6005 Using where; Using join buffer (incremental, BNLH join)
# End of the test case for mdev-503
set optimizer_switch=@save_optimizer_switch;
DROP DATABASE dbt3_s001;
diff --git a/mysql-test/r/stat_tables_innodb.result b/mysql-test/r/stat_tables_innodb.result
index 42443bfcb72..369faf6d01f 100644
--- a/mysql-test/r/stat_tables_innodb.result
+++ b/mysql-test/r/stat_tables_innodb.result
@@ -68,11 +68,11 @@ group by n_name
order by revenue desc;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE orders range PRIMARY,i_o_orderdate,i_o_custkey i_o_orderdate 4 NULL 213 Using where; Using temporary; Using filesort
-1 SIMPLE customer eq_ref PRIMARY,i_c_nationkey PRIMARY 4 dbt3_s001.orders.o_custkey 1 Using where
-1 SIMPLE nation eq_ref PRIMARY,i_n_regionkey PRIMARY 4 dbt3_s001.customer.c_nationkey 1
-1 SIMPLE supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.customer.c_nationkey 1 Using index
-1 SIMPLE region ALL PRIMARY NULL NULL NULL 5 Using where; Using join buffer (flat, BNL join)
-1 SIMPLE lineitem ref PRIMARY,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 Using where
+1 SIMPLE customer hash_index PRIMARY,i_c_nationkey #hash#PRIMARY:i_c_nationkey 4:5 dbt3_s001.orders.o_custkey 150 Using where; Using index; Using join buffer (flat, BNLH join)
+1 SIMPLE nation hash_ALL PRIMARY,i_n_regionkey #hash#PRIMARY 4 dbt3_s001.customer.c_nationkey 25 Using join buffer (incremental, BNLH join)
+1 SIMPLE supplier hash_index PRIMARY,i_s_nationkey #hash#i_s_nationkey:i_s_nationkey 5:5 dbt3_s001.customer.c_nationkey 10 Using index; Using join buffer (incremental, BNLH join)
+1 SIMPLE region ALL PRIMARY NULL NULL NULL 5 Using where; Using join buffer (incremental, BNL join)
+1 SIMPLE lineitem hash_ALL PRIMARY,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity #hash#PRIMARY 4 dbt3_s001.orders.o_orderkey 6005 Using where; Using join buffer (incremental, BNLH join)
select n_name, sum(l_extendedprice * (1 - l_discount)) as revenue
from customer, orders, lineitem, supplier, nation, region
where c_custkey = o_custkey and l_orderkey = o_orderkey
@@ -83,8 +83,8 @@ and r_name = 'AMERICA' and o_orderdate >= date '1995-01-01'
group by n_name
order by revenue desc;
n_name revenue
-PERU 321915.8715
-ARGENTINA 69817.1451
+PERU 321915.87149999995
+ARGENTINA 69817.14510000001
set optimizer_switch=@save_optimizer_switch;
delete from mysql.index_stats;
select * from mysql.table_stats;
@@ -199,11 +199,11 @@ group by n_name
order by revenue desc;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE orders range PRIMARY,i_o_orderdate,i_o_custkey i_o_orderdate 4 NULL 213 Using where; Using temporary; Using filesort
-1 SIMPLE customer eq_ref PRIMARY,i_c_nationkey PRIMARY 4 dbt3_s001.orders.o_custkey 1 Using where
-1 SIMPLE nation eq_ref PRIMARY,i_n_regionkey PRIMARY 4 dbt3_s001.customer.c_nationkey 1
-1 SIMPLE supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.customer.c_nationkey 1 Using index
-1 SIMPLE region ALL PRIMARY NULL NULL NULL 5 Using where; Using join buffer (flat, BNL join)
-1 SIMPLE lineitem ref PRIMARY,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 Using where
+1 SIMPLE customer hash_index PRIMARY,i_c_nationkey #hash#PRIMARY:i_c_nationkey 4:5 dbt3_s001.orders.o_custkey 150 Using where; Using index; Using join buffer (flat, BNLH join)
+1 SIMPLE nation hash_ALL PRIMARY,i_n_regionkey #hash#PRIMARY 4 dbt3_s001.customer.c_nationkey 25 Using join buffer (incremental, BNLH join)
+1 SIMPLE supplier hash_index PRIMARY,i_s_nationkey #hash#i_s_nationkey:i_s_nationkey 5:5 dbt3_s001.customer.c_nationkey 10 Using index; Using join buffer (incremental, BNLH join)
+1 SIMPLE region ALL PRIMARY NULL NULL NULL 5 Using where; Using join buffer (incremental, BNL join)
+1 SIMPLE lineitem hash_ALL PRIMARY,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity #hash#PRIMARY 4 dbt3_s001.orders.o_orderkey 6005 Using where; Using join buffer (incremental, BNLH join)
select n_name, sum(l_extendedprice * (1 - l_discount)) as revenue
from customer, orders, lineitem, supplier, nation, region
where c_custkey = o_custkey and l_orderkey = o_orderkey
@@ -214,8 +214,8 @@ and r_name = 'AMERICA' and o_orderdate >= date '1995-01-01'
group by n_name
order by revenue desc;
n_name revenue
-PERU 321915.8715
-ARGENTINA 69817.1451
+PERU 321915.87149999995
+ARGENTINA 69817.14510000001
set optimizer_switch=@save_optimizer_switch;
EXPLAIN select o_year,
sum(case when nation = 'UNITED STATES' then volume else 0 end) /
@@ -235,13 +235,13 @@ group by o_year
order by o_year;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE orders ALL PRIMARY,i_o_orderdate,i_o_custkey NULL NULL NULL 1500 Using where; Using temporary; Using filesort
-1 SIMPLE customer eq_ref PRIMARY,i_c_nationkey PRIMARY 4 dbt3_s001.orders.o_custkey 1 Using where
-1 SIMPLE n1 eq_ref PRIMARY,i_n_regionkey PRIMARY 4 dbt3_s001.customer.c_nationkey 1
-1 SIMPLE region ALL PRIMARY NULL NULL NULL 5 Using where; Using join buffer (flat, BNL join)
-1 SIMPLE lineitem ref PRIMARY,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 Using where
-1 SIMPLE part eq_ref PRIMARY PRIMARY 4 dbt3_s001.lineitem.l_partkey 1 Using where
-1 SIMPLE supplier eq_ref PRIMARY,i_s_nationkey PRIMARY 4 dbt3_s001.lineitem.l_suppkey 1 Using where
-1 SIMPLE n2 eq_ref PRIMARY PRIMARY 4 dbt3_s001.supplier.s_nationkey 1
+1 SIMPLE customer hash_index PRIMARY,i_c_nationkey #hash#PRIMARY:i_c_nationkey 4:5 dbt3_s001.orders.o_custkey 150 Using where; Using index; Using join buffer (flat, BNLH join)
+1 SIMPLE n1 hash_index PRIMARY,i_n_regionkey #hash#PRIMARY:i_n_regionkey 4:5 dbt3_s001.customer.c_nationkey 25 Using index; Using join buffer (incremental, BNLH join)
+1 SIMPLE region ALL PRIMARY NULL NULL NULL 5 Using where; Using join buffer (incremental, BNL join)
+1 SIMPLE lineitem hash_ALL PRIMARY,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity #hash#PRIMARY 4 dbt3_s001.orders.o_orderkey 6005 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE part hash_ALL PRIMARY #hash#PRIMARY 4 dbt3_s001.lineitem.l_partkey 200 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE supplier hash_index PRIMARY,i_s_nationkey #hash#PRIMARY:i_s_nationkey 4:5 dbt3_s001.lineitem.l_suppkey 10 Using where; Using index; Using join buffer (incremental, BNLH join)
+1 SIMPLE n2 hash_ALL PRIMARY #hash#PRIMARY 4 dbt3_s001.supplier.s_nationkey 25 Using join buffer (incremental, BNLH join)
select o_year,
sum(case when nation = 'UNITED STATES' then volume else 0 end) /
sum(volume) as mkt_share
@@ -260,7 +260,7 @@ group by o_year
order by o_year;
o_year mkt_share
1995 0.4495521838895718
-1996 0.024585468215352495
+1996 0.0245854682153525
EXPLAIN select nation, o_year, sum(amount) as sum_profit
from (select n_name as nation,
extract(year from o_orderdate) as o_year,
@@ -274,11 +274,11 @@ group by nation, o_year
order by nation, o_year desc;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE supplier index PRIMARY,i_s_nationkey i_s_nationkey 5 NULL 10 Using where; Using index; Using temporary; Using filesort
-1 SIMPLE nation eq_ref PRIMARY PRIMARY 4 dbt3_s001.supplier.s_nationkey 1
-1 SIMPLE partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey i_ps_suppkey 4 dbt3_s001.supplier.s_suppkey 70
-1 SIMPLE part eq_ref PRIMARY PRIMARY 4 dbt3_s001.partsupp.ps_partkey 1 Using where
-1 SIMPLE lineitem ref PRIMARY,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.supplier.s_suppkey 8
-1 SIMPLE orders eq_ref PRIMARY PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1
+1 SIMPLE nation hash_ALL PRIMARY #hash#PRIMARY 4 dbt3_s001.supplier.s_nationkey 25 Using join buffer (flat, BNLH join)
+1 SIMPLE partsupp hash_ALL PRIMARY,i_ps_partkey,i_ps_suppkey #hash#i_ps_suppkey 4 dbt3_s001.supplier.s_suppkey 700 Using join buffer (incremental, BNLH join)
+1 SIMPLE part hash_ALL PRIMARY #hash#PRIMARY 4 dbt3_s001.partsupp.ps_partkey 200 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE lineitem hash_ALL PRIMARY,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity #hash#i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.supplier.s_suppkey 6005 Using join buffer (incremental, BNLH join)
+1 SIMPLE orders hash_index PRIMARY #hash#PRIMARY:i_o_orderdate 4:4 dbt3_s001.lineitem.l_orderkey 1500 Using index; Using join buffer (incremental, BNLH join)
select nation, o_year, sum(amount) as sum_profit
from (select n_name as nation,
extract(year from o_orderdate) as o_year,
@@ -316,38 +316,38 @@ IRAQ 1994 36010.728599999995
IRAQ 1993 33221.9399
IRAQ 1992 47755.05900000001
KENYA 1998 44194.831999999995
-KENYA 1997 57578.36259999999
-KENYA 1996 59195.90210000001
+KENYA 1997 57578.362599999986
+KENYA 1996 59195.9021
KENYA 1995 79262.6278
KENYA 1994 102360.66609999999
KENYA 1993 128422.0196
KENYA 1992 181517.2089
MOROCCO 1998 41797.823199999984
-MOROCCO 1997 23685.801799999994
-MOROCCO 1996 62115.19579999998
+MOROCCO 1997 23685.801799999997
+MOROCCO 1996 62115.195799999994
MOROCCO 1995 42442.64300000001
MOROCCO 1994 48655.878000000004
MOROCCO 1993 22926.744400000003
MOROCCO 1992 32239.8088
-PERU 1998 86999.36459999997
-PERU 1997 121110.41070000001
+PERU 1998 86999.36459999999
+PERU 1997 121110.41070000002
PERU 1996 177040.40759999995
-PERU 1995 122247.94520000002
+PERU 1995 122247.94519999999
PERU 1994 88046.25329999998
PERU 1993 49379.813799999996
PERU 1992 80646.86050000001
UNITED KINGDOM 1998 50577.25560000001
UNITED KINGDOM 1997 114288.8605
UNITED KINGDOM 1996 147684.46480000002
-UNITED KINGDOM 1995 225267.65759999998
-UNITED KINGDOM 1994 140595.5864
+UNITED KINGDOM 1995 225267.6576
+UNITED KINGDOM 1994 140595.58639999997
UNITED KINGDOM 1993 322548.49210000003
UNITED KINGDOM 1992 67747.88279999999
UNITED STATES 1998 3957.0431999999996
UNITED STATES 1997 94729.5704
-UNITED STATES 1996 79297.85670000002
+UNITED STATES 1996 79297.8567
UNITED STATES 1995 62201.23360000001
-UNITED STATES 1994 43075.629899999985
+UNITED STATES 1994 43075.6299
UNITED STATES 1993 27168.486199999996
UNITED STATES 1992 34092.366
set @save_optimizer_switch=@@optimizer_switch;
@@ -358,8 +358,8 @@ where p_retailprice > 1100 and o_orderdate='1997-01-01'
and o_orderkey=l_orderkey and p_partkey=l_partkey;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE part range PRIMARY,i_p_retailprice i_p_retailprice 9 NULL 1 Using where; Using index
-1 SIMPLE orders ref PRIMARY,i_o_orderdate i_o_orderdate 4 const 1 Using index
-1 SIMPLE lineitem ref PRIMARY,i_l_suppkey_partkey,i_l_partkey,i_l_orderkey,i_l_orderkey_quantity i_l_partkey 9 dbt3_s001.part.p_partkey,dbt3_s001.orders.o_orderkey 1 Using index
+1 SIMPLE orders hash_range PRIMARY,i_o_orderdate #hash#i_o_orderdate:i_o_orderdate 4:4 const 1 Using where; Using index; Using join buffer (flat, BNLH join)
+1 SIMPLE lineitem hash_index PRIMARY,i_l_suppkey_partkey,i_l_partkey,i_l_orderkey,i_l_orderkey_quantity #hash#i_l_partkey:i_l_partkey 9:5 dbt3_s001.part.p_partkey,dbt3_s001.orders.o_orderkey 6005 Using index; Using join buffer (incremental, BNLH join)
select o_orderkey, p_partkey
from part, lineitem, orders
where p_retailprice > 1100 and o_orderdate='1997-01-01'
diff --git a/mysql-test/r/subselect2.result b/mysql-test/r/subselect2.result
index 31e7774734e..f151ce00a5a 100644
--- a/mysql-test/r/subselect2.result
+++ b/mysql-test/r/subselect2.result
@@ -126,13 +126,13 @@ c373e9f5ad07993f3859444553544200 Last Discussion c373e9f5ad079174ff1744455354420
EXPLAIN SELECT t2.*, t4.DOCTYPENAME, t1.CONTENTSIZE,t1.MIMETYPE FROM t2 INNER JOIN t4 ON t2.DOCTYPEID = t4.DOCTYPEID LEFT OUTER JOIN t1 ON t2.DOCID = t1.DOCID WHERE t2.FOLDERID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID='2f6161e879db43c1a5b82c21ddc49089' AND t3.FOLDERNAME = 'Level1') AND t3.FOLDERNAME = 'Level2') AND t3.FOLDERNAME = 'Level3') AND t3.FOLDERNAME = 'CopiedFolder') AND t3.FOLDERNAME = 'Movie Reviews') AND t2.DOCNAME = 'Last Discussion';
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL DDOCTYPEID_IDX,DFOLDERID_IDX NULL NULL NULL 9 Using where
-1 PRIMARY t1 eq_ref PRIMARY PRIMARY 34 test.t2.DOCID 1
-1 PRIMARY t4 eq_ref PRIMARY PRIMARY 34 test.t2.DOCTYPEID 1
-1 PRIMARY t3 eq_ref PRIMARY,FFOLDERID_IDX,CMFLDRPARNT_IDX PRIMARY 34 test.t2.FOLDERID 1 Using where
-1 PRIMARY t3 eq_ref PRIMARY,FFOLDERID_IDX,CMFLDRPARNT_IDX PRIMARY 34 test.t3.PARENTID 1 Using where
-1 PRIMARY t3 eq_ref PRIMARY,FFOLDERID_IDX,CMFLDRPARNT_IDX PRIMARY 34 test.t3.PARENTID 1 Using where
-1 PRIMARY t3 eq_ref PRIMARY,FFOLDERID_IDX,CMFLDRPARNT_IDX PRIMARY 34 test.t3.PARENTID 1 Using where
-1 PRIMARY t3 eq_ref PRIMARY,FFOLDERID_IDX,CMFLDRPARNT_IDX PRIMARY 34 test.t3.PARENTID 1 Using where
+1 PRIMARY t1 hash_ALL PRIMARY #hash#PRIMARY 34 test.t2.DOCID 2 Using join buffer (flat, BNLH join)
+1 PRIMARY t4 hash_ALL PRIMARY #hash#PRIMARY 34 test.t2.DOCTYPEID 10 Using join buffer (incremental, BNLH join)
+1 PRIMARY t3 hash_ALL PRIMARY,FFOLDERID_IDX,CMFLDRPARNT_IDX #hash#PRIMARY 34 test.t2.FOLDERID 21 Using where; Using join buffer (incremental, BNLH join)
+1 PRIMARY t3 hash_ALL PRIMARY,FFOLDERID_IDX,CMFLDRPARNT_IDX #hash#PRIMARY 34 test.t3.PARENTID 21 Using where; Using join buffer (incremental, BNLH join)
+1 PRIMARY t3 hash_ALL PRIMARY,FFOLDERID_IDX,CMFLDRPARNT_IDX #hash#PRIMARY 34 test.t3.PARENTID 21 Using where; Using join buffer (incremental, BNLH join)
+1 PRIMARY t3 hash_ALL PRIMARY,FFOLDERID_IDX,CMFLDRPARNT_IDX #hash#PRIMARY 34 test.t3.PARENTID 21 Using where; Using join buffer (incremental, BNLH join)
+1 PRIMARY t3 hash_ALL PRIMARY,FFOLDERID_IDX,CMFLDRPARNT_IDX #hash#PRIMARY 34 test.t3.PARENTID 21 Using where; Using join buffer (incremental, BNLH join)
drop table t1, t2, t3, t4;
CREATE TABLE t1 (a int(10) , PRIMARY KEY (a)) Engine=InnoDB;
INSERT INTO t1 VALUES (1),(2);
@@ -162,7 +162,7 @@ EXPLAIN
SELECT * FROM t2,t3 WHERE (2,9) IN (SELECT DISTINCT a,pk FROM t1) OR a = b;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 index a a 5 NULL 2 Using where; Using index
-1 PRIMARY t3 ref b b 5 test.t2.a 2 Using index
+1 PRIMARY t3 hash_index b #hash#b:b 5:5 test.t2.a 4 Using index; Using join buffer (flat, BNLH join)
2 SUBQUERY t1 const PRIMARY,a PRIMARY 4 const 1 Using where
SELECT * FROM t2,t3 WHERE (2,9) IN (SELECT DISTINCT a,pk FROM t1) OR a = b;
pk a b
@@ -171,7 +171,7 @@ EXPLAIN
SELECT * FROM t2,t3 WHERE (2,9) IN (SELECT DISTINCT a,pk FROM v1) OR a = b;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 index a a 5 NULL 2 Using where; Using index
-1 PRIMARY t3 ref b b 5 test.t2.a 2 Using index
+1 PRIMARY t3 hash_index b #hash#b:b 5:5 test.t2.a 4 Using index; Using join buffer (flat, BNLH join)
2 SUBQUERY t1 const PRIMARY,a PRIMARY 4 const 1 Using where
SELECT * FROM t2,t3 WHERE (2,9) IN (SELECT DISTINCT a,pk FROM v1) OR a = b;
pk a b
@@ -258,8 +258,8 @@ WHERE t2c.c2 = t2b.c2 AND ( t2a.m = t2b.n OR 0 ) AND
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
2 DEPENDENT SUBQUERY t2a ALL NULL NULL NULL NULL 2 100.00 Using where
-2 DEPENDENT SUBQUERY t2b ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join)
-2 DEPENDENT SUBQUERY t2c ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join)
+2 DEPENDENT SUBQUERY t2b hash_ALL NULL #hash#$hj 5 test.t2a.m 2 100.00 Using where; Using join buffer (flat, BNLH join)
+2 DEPENDENT SUBQUERY t2c hash_ALL NULL #hash#$hj 4 test.t2b.c2 2 100.00 Using where; Using join buffer (incremental, BNLH join)
Warnings:
Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`c1` AS `c1` from `test`.`t1` where !<expr_cache><`test`.`t1`.`c1`,`test`.`t1`.`a`>(<in_optimizer>(`test`.`t1`.`c1`,<exists>(/* select#2 */ select `test`.`t2a`.`c2` from `test`.`t2` `t2a` join `test`.`t2` `t2b` join `test`.`t2` `t2c` where (`test`.`t2b`.`m` <> `test`.`t1`.`a` or `test`.`t2b`.`m` = `test`.`t2a`.`m`) and trigcond(<cache>(`test`.`t1`.`c1`) = `test`.`t2a`.`c2` or `test`.`t2a`.`c2` is null) and `test`.`t2c`.`c2` = `test`.`t2b`.`c2` and `test`.`t2b`.`n` = `test`.`t2a`.`m` having trigcond(`test`.`t2a`.`c2` is null))))
@@ -339,7 +339,7 @@ where t1.a = t2.a and ( t1.a = ( select min(a) from t1 ) or 0 );
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join)
-1 PRIMARY t3 ref idx idx 6 func 2 100.00 Using where; Using index
+1 PRIMARY t3 hash_index idx #hash#idx:idx 6:6 func 3 66.67 Using where; Using index; Using join buffer (incremental, BNLH join)
2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00
Warnings:
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a`,`test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` left join `test`.`t3` on(`test`.`t3`.`a` = `test`.`t1`.`a`) where `test`.`t1`.`a` = (/* select#2 */ select min(`test`.`t1`.`a`) from `test`.`t1`) and `test`.`t2`.`a` = (/* select#2 */ select min(`test`.`t1`.`a`) from `test`.`t1`)
diff --git a/mysql-test/r/subselect3_jcl6.result b/mysql-test/r/subselect3_jcl6.result
index adb3ec80394..53c14539641 100644
--- a/mysql-test/r/subselect3_jcl6.result
+++ b/mysql-test/r/subselect3_jcl6.result
@@ -1558,6 +1558,6 @@ set @@optimizer_switch=@subselect3_tmp;
set join_cache_level=default;
show variables like 'join_cache_level';
Variable_name Value
-join_cache_level 2
+join_cache_level 4
set @@optimizer_switch=@save_optimizer_switch;
set @join_cache_level_for_subselect3_test=NULL;
diff --git a/mysql-test/r/subselect4.result b/mysql-test/r/subselect4.result
index d3f46429cf7..c8dbf76af26 100644
--- a/mysql-test/r/subselect4.result
+++ b/mysql-test/r/subselect4.result
@@ -1828,8 +1828,8 @@ WHERE t2.f2 = (SELECT f2 FROM t3
WHERE EXISTS (SELECT DISTINCT f1 FROM t4))
AND t2.f2 = t1.f1;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ref f1 f1 5 const 0 Using where
-1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY t1 ref f1 f1 5 const 0 Using index condition; Using where
+1 PRIMARY t2 hash_ALL NULL #hash#$hj 5 test.t1.f1 2 Using where; Using join buffer (flat, BNLH join)
2 SUBQUERY t3 ALL NULL NULL NULL NULL 2
3 SUBQUERY t4 index NULL f1 5 NULL 2 Using index
SELECT *
@@ -1845,8 +1845,8 @@ WHERE t2.f2 = (SELECT f2 FROM t3
WHERE EXISTS (SELECT DISTINCT f1 FROM t4) LIMIT 1)
AND t2.f2 = t1.f1;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ref f1 f1 5 const 0 Using where
-1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY t1 ref f1 f1 5 const 0 Using index condition; Using where
+1 PRIMARY t2 hash_ALL NULL #hash#$hj 5 test.t1.f1 2 Using where; Using join buffer (flat, BNLH join)
2 SUBQUERY t3 ALL NULL NULL NULL NULL 2
3 SUBQUERY t4 index NULL f1 5 NULL 2 Using index
SELECT *
diff --git a/mysql-test/r/subselect_cache.result b/mysql-test/r/subselect_cache.result
index 813d668c88c..6904d4a5889 100644
--- a/mysql-test/r/subselect_cache.result
+++ b/mysql-test/r/subselect_cache.result
@@ -2014,19 +2014,19 @@ flush status;
select * from t1 where a in (select pk from t2);
a b
0 0
-1 1
-2 2
0 0
-1 1
-2 2
0 0
-1 1
-2 2
0 0
-1 1
-2 2
0 0
1 1
+1 1
+1 1
+1 1
+1 1
+2 2
+2 2
+2 2
+2 2
2 2
show status like "subquery_cache%";
Variable_name Value
@@ -2034,10 +2034,10 @@ Subquery_cache_hit 0
Subquery_cache_miss 0
show status like '%Handler_read%';
Variable_name Value
-Handler_read_first 0
-Handler_read_key 15
+Handler_read_first 1
+Handler_read_key 0
Handler_read_last 0
-Handler_read_next 0
+Handler_read_next 10
Handler_read_prev 0
Handler_read_retry 0
Handler_read_rnd 0
diff --git a/mysql-test/r/subselect_exists2in.result b/mysql-test/r/subselect_exists2in.result
index 95fc1c19b82..4e4de8a92b8 100644
--- a/mysql-test/r/subselect_exists2in.result
+++ b/mysql-test/r/subselect_exists2in.result
@@ -383,7 +383,7 @@ explain extended
SELECT * FROM t1 WHERE EXISTS ( SELECT * FROM t3 WHERE t3.b = t1.a and t3.b1 = t1.a1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3 index bb bb 8 NULL 2 100.00 Using where; Using index; LooseScan
-1 PRIMARY t1 ref aa aa 8 test.t3.b,test.t3.b1 2 100.00 Using index
+1 PRIMARY t1 hash_index aa #hash#aa:aa 8:8 test.t3.b,test.t3.b1 2 100.00 Using index; Using join buffer (flat, BNLH join)
Warnings:
Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
Note 1276 Field or reference 'test.t1.a1' of SELECT #2 was resolved in SELECT #1
@@ -900,7 +900,7 @@ WHERE sq1.`pk` IN ( SELECT f1 FROM t1 ) AND sq2.f1 = sq1.f1 );
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
3 DEPENDENT SUBQUERY <subquery4> eq_ref distinct_key distinct_key 4 func 1 100.00
-3 DEPENDENT SUBQUERY sq2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join)
+3 DEPENDENT SUBQUERY sq2 hash_ALL NULL #hash#$hj 4 test.t1.f1 2 100.00 Using where; Using join buffer (flat, BNLH join)
4 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 100.00
Warnings:
Note 1276 Field or reference 'sq1.pk' of SELECT #3 was resolved in SELECT #1
@@ -920,7 +920,7 @@ WHERE sq1.`pk` IN ( SELECT f1 FROM t1 ) AND sq2.f1 = sq1.f1 );
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
3 DEPENDENT SUBQUERY <subquery4> eq_ref distinct_key distinct_key 4 func 1 100.00
-3 DEPENDENT SUBQUERY sq2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join)
+3 DEPENDENT SUBQUERY sq2 hash_ALL NULL #hash#$hj 4 func 2 100.00 Using where; Using join buffer (flat, BNLH join)
4 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 100.00
Warnings:
Note 1276 Field or reference 'sq1.pk' of SELECT #3 was resolved in SELECT #1
diff --git a/mysql-test/r/subselect_extra.result b/mysql-test/r/subselect_extra.result
index 73642c09324..7a9615cd425 100644
--- a/mysql-test/r/subselect_extra.result
+++ b/mysql-test/r/subselect_extra.result
@@ -383,13 +383,13 @@ a b
9 3
SELECT a FROM t1 WHERE (a,b) IN (SELECT * FROM v1);
a
-9
2
+9
EXPLAIN
SELECT a FROM t1 WHERE (a,b) IN (SELECT * FROM v1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
-1 PRIMARY <derived3> ref key0 key0 10 test.t1.a,test.t1.b 2 FirstMatch(t1)
+1 PRIMARY <derived3> hash_ALL key0 #hash#key0 10 test.t1.a,test.t1.b 6 FirstMatch(t1); Using join buffer (flat, BNLH join)
3 DERIVED t2 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort
SELECT * FROM v2;
a b
@@ -409,7 +409,7 @@ EXPLAIN
SELECT a FROM t1 WHERE (a,b) IN (SELECT * FROM v2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
-1 PRIMARY <derived3> ref key0 key0 10 test.t1.a,test.t1.b 2 FirstMatch(t1)
+1 PRIMARY <derived3> hash_ALL key0 #hash#key0 10 test.t1.a,test.t1.b 10 FirstMatch(t1); Using join buffer (flat, BNLH join)
3 DERIVED t2 ALL NULL NULL NULL NULL 6
4 UNION t3 ALL NULL NULL NULL NULL 4
NULL UNION RESULT <union3,4> ALL NULL NULL NULL NULL NULL
@@ -448,7 +448,7 @@ WHERE t2.c = v1.c AND t2.c = v1.b AND v1.b = t3.c);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 system NULL NULL NULL NULL 1
1 PRIMARY <derived3> ref key1 key1 8 const,const 0 Start temporary
-1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where; End temporary; Using join buffer (flat, BNL join)
+1 PRIMARY t3 hash_ALL NULL #hash#$hj 8 func,func 2 Using where; End temporary; Using join buffer (flat, BNLH join)
3 DERIVED t1 ALL NULL NULL NULL NULL 3
SELECT * FROM t3
WHERE t3.b IN (SELECT v1.b FROM v1, t2
@@ -470,7 +470,7 @@ EXPLAIN
SELECT * FROM t1 WHERE t1.b IN (SELECT v2.a FROM v2 WHERE v2.b = t1.a);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
-1 PRIMARY <derived3> ref key0 key0 10 test.t1.b,test.t1.a 2 FirstMatch(t1)
+1 PRIMARY <derived3> hash_ALL key0 #hash#key0 10 test.t1.b,test.t1.a 2 FirstMatch(t1); Using join buffer (flat, BNLH join)
3 DERIVED t2 ALL NULL NULL NULL NULL 2
SELECT * FROM t1 WHERE t1.b IN (SELECT v2.a FROM v2 WHERE v2.b = t1.a);
a b
diff --git a/mysql-test/r/subselect_innodb.result b/mysql-test/r/subselect_innodb.result
index ec7f2c0a3d5..5f2ff869d35 100644
--- a/mysql-test/r/subselect_innodb.result
+++ b/mysql-test/r/subselect_innodb.result
@@ -481,7 +481,7 @@ HAVING SQ2_alias1 . col_int_key >= 7
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY SQ2_alias2 index NULL col_int_key 5 NULL 1 Using index; Using temporary; Using filesort
-2 SUBQUERY SQ2_alias1 ref col_int_key col_int_key 5 test.SQ2_alias2.col_int_key 1 Using where; Using index
+2 SUBQUERY SQ2_alias1 hash_index col_int_key #hash#col_int_key:col_int_key 5:5 test.SQ2_alias2.col_int_key 1 Using where; Using index; Using join buffer (flat, BNLH join)
SELECT 1 FROM t1 AS alias1
WHERE EXISTS ( SELECT SQ2_alias1 . col_int_key AS SQ2_field1
FROM ( t1 AS SQ2_alias1 RIGHT OUTER JOIN
diff --git a/mysql-test/r/subselect_mat_cost.result b/mysql-test/r/subselect_mat_cost.result
index a9f980fff5d..29277f85f64 100644
--- a/mysql-test/r/subselect_mat_cost.result
+++ b/mysql-test/r/subselect_mat_cost.result
@@ -133,7 +133,7 @@ Country.SurfaceArea < 3000 AND Country.SurfaceArea > 10 AND
City.name LIKE '%Island%');
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY Country ALL PRIMARY,SurfaceArea NULL NULL NULL 239 Using where
-1 PRIMARY City ref Country Country 3 world.Country.Code 18 Using where
+1 PRIMARY City hash_ALL Country #hash#Country 3 world.Country.Code 4080 Using where; Using join buffer (flat, BNLH join)
2 MATERIALIZED CountryLanguage ALL Percentage,Language NULL NULL NULL 984 Using where
SELECT *
FROM Country, City
@@ -158,7 +158,7 @@ Country.SurfaceArea < 3000 AND Country.SurfaceArea > 10 AND
Country.name LIKE '%Island%');
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY Country ALL PRIMARY,SurfaceArea NULL NULL NULL 239 Using where
-1 PRIMARY City ref Country Country 3 world.Country.Code 18
+1 PRIMARY City hash_ALL Country #hash#Country 3 world.Country.Code 4080 Using join buffer (flat, BNLH join)
2 DEPENDENT SUBQUERY CountryLanguage index_subquery Percentage,Language Language 30 func 2 Using where
SELECT *
FROM Country, City
@@ -203,7 +203,7 @@ OR
(select Country, Language from CountryLanguage));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY Country ALL PRIMARY,SurfaceArea NULL NULL NULL 239 Using where
-1 PRIMARY City ref Country Country 3 world.Country.Code 18 Using where
+1 PRIMARY City hash_ALL Country #hash#Country 3 world.Country.Code 4080 Using where; Using join buffer (flat, BNLH join)
3 MATERIALIZED CountryLanguage index PRIMARY,Language PRIMARY 33 NULL 984 Using index
2 DEPENDENT SUBQUERY CountryLanguage unique_subquery PRIMARY,Percentage,Language PRIMARY 33 func,func 1 Using where
SELECT City.Name, Country.Name
@@ -247,33 +247,33 @@ AND CountryLanguage.Language = 'French'
AND Code = Country;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY CountryLanguage ref PRIMARY,Language Language 30 const 20 Using index condition
-1 PRIMARY Country eq_ref PRIMARY PRIMARY 3 world.CountryLanguage.Country 1 Using where
-2 DEPENDENT SUBQUERY CountryLanguage unique_subquery PRIMARY,Language PRIMARY 33 func,const 1 Using index; Using where
+1 PRIMARY Country hash_ALL PRIMARY #hash#PRIMARY 3 world.CountryLanguage.Country 239 Using where; Using join buffer (flat, BNLH join)
+2 DEPENDENT SUBQUERY CountryLanguage unique_subquery PRIMARY,Language PRIMARYLanguage 3330 func,const 47 Using index; Using where
SELECT Country.Name
FROM Country, CountryLanguage
WHERE Code NOT IN (SELECT Country FROM CountryLanguage WHERE Language = 'English')
AND CountryLanguage.Language = 'French'
AND Code = Country;
Name
-France
-Saint Pierre and Miquelon
+Andorra
Belgium
Burundi
Guadeloupe
Haiti
+Italy
+Lebanon
+Luxembourg
Madagascar
Martinique
+Mauritius
Mayotte
+France
French Polynesia
Rwanda
+Saint Pierre and Miquelon
Sao Tome and Principe
Switzerland
New Caledonia
-Lebanon
-Mauritius
-Andorra
-Italy
-Luxembourg
Q2.2m:
Countries that speak French OR Spanish, but do not speak English
MATERIALIZATION because the outer query filters less rows than Q5-a,
@@ -286,7 +286,7 @@ AND (CountryLanguage.Language = 'French' OR CountryLanguage.Language = 'Spanish'
AND Code = Country;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY CountryLanguage range PRIMARY,Language Language 30 NULL 45 Using index condition; Using where; Rowid-ordered scan
-1 PRIMARY Country eq_ref PRIMARY PRIMARY 3 world.CountryLanguage.Country 1 Using where
+1 PRIMARY Country hash_ALL PRIMARY #hash#PRIMARY 3 world.CountryLanguage.Country 239 Using where; Using join buffer (flat, BNLH join)
2 MATERIALIZED CountryLanguage ref PRIMARY,Language Language 30 const 47 Using index condition
SELECT Country.Name
FROM Country, CountryLanguage
@@ -295,46 +295,46 @@ AND (CountryLanguage.Language = 'French' OR CountryLanguage.Language = 'Spanish'
AND Code = Country;
Name
Andorra
+Andorra
Argentina
+Belgium
Bolivia
+Burundi
Chile
Costa Rica
Dominican Republic
Ecuador
El Salvador
Spain
+Guadeloupe
Guatemala
+Haiti
Honduras
+Italy
Colombia
Cuba
+Lebanon
+Luxembourg
+Madagascar
+Martinique
+Mauritius
+Mayotte
Mexico
Nicaragua
Panama
Paraguay
Peru
France
-Saint Pierre and Miquelon
-Uruguay
-Venezuela
-Belgium
-Burundi
-Guadeloupe
-Haiti
-Madagascar
-Martinique
-Mayotte
+France
French Polynesia
Rwanda
+Sweden
+Saint Pierre and Miquelon
Sao Tome and Principe
Switzerland
+Uruguay
New Caledonia
-Lebanon
-Mauritius
-Andorra
-Italy
-Luxembourg
-France
-Sweden
+Venezuela
Q2.3e:
Not a very meaningful query that tests NOT IN.
@@ -349,7 +349,7 @@ AND Language IN ('English','Spanish');
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY CountryLanguage range Language Language 30 NULL 72 Using index condition; Using where; Rowid-ordered scan
2 DEPENDENT SUBQUERY City ref CityName CityName 35 func 1 Using index condition
-2 DEPENDENT SUBQUERY Country eq_ref PRIMARY PRIMARY 3 world.City.Country 1 Using where; Using index
+2 DEPENDENT SUBQUERY Country hash_index PRIMARY #hash#PRIMARY:PRIMARY 3:3 world.City.Country 239 Using where; Using index; Using join buffer (flat, BNLH join)
select count(*)
from CountryLanguage
where (Language, Country) NOT IN
@@ -372,7 +372,7 @@ HAVING City.Name LIKE "Santa%");
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY CountryLanguage index NULL PRIMARY 33 NULL 984 Using where; Using index
2 MATERIALIZED City ALL NULL NULL NULL NULL 4080
-2 MATERIALIZED Country eq_ref PRIMARY PRIMARY 3 world.City.Country 1 Using index
+2 MATERIALIZED Country hash_index PRIMARY #hash#PRIMARY:PRIMARY 3:3 world.City.Country 239 Using index; Using join buffer (flat, BNLH join)
select count(*)
from CountryLanguage
where (Language, Country) NOT IN
@@ -399,10 +399,10 @@ WHERE Code = Country GROUP BY Code)
order by Country;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY CountryLanguage index NULL PRIMARY 33 NULL 984 Using where; Using index
-3 MATERIALIZED Country index PRIMARY PRIMARY 3 NULL 239 Using index
-3 MATERIALIZED CountryLanguage ref PRIMARY PRIMARY 3 world.Country.Code 4 Using index
-2 MATERIALIZED Country index PRIMARY PRIMARY 3 NULL 239 Using index
-2 MATERIALIZED CountryLanguage ref PRIMARY PRIMARY 3 world.Country.Code 4 Using index
+3 MATERIALIZED Country index PRIMARY PRIMARY 3 NULL 239 Using index; Using temporary
+3 MATERIALIZED CountryLanguage hash_index PRIMARY #hash#PRIMARY:PRIMARY 3:33 world.Country.Code 984 Using index; Using join buffer (flat, BNLH join)
+2 MATERIALIZED Country index PRIMARY PRIMARY 3 NULL 239 Using index; Using temporary
+2 MATERIALIZED CountryLanguage hash_index PRIMARY #hash#PRIMARY:PRIMARY 3:33 world.Country.Code 984 Using index; Using join buffer (flat, BNLH join)
select count(*)
from CountryLanguage
where
@@ -428,7 +428,7 @@ GROUP BY name HAVING Count(*) > 2) OR
capital is null);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY Country ALL NULL NULL NULL NULL 239 Using where
-1 PRIMARY City eq_ref PRIMARY PRIMARY 4 world.Country.Capital 1 Using where
+1 PRIMARY City hash_ALL PRIMARY #hash#PRIMARY 4 world.Country.Capital 4080 Using where; Using join buffer (flat, BNLH join)
2 MATERIALIZED City index NULL CityName 35 NULL 4080 Using index
select * from Country, City
where capital = id and
@@ -513,7 +513,7 @@ GROUP BY City.Name
HAVING City.Name IN (select Name from Country where population < 1000000);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY Country index PRIMARY PRIMARY 3 NULL 239 Using index; Using temporary; Using filesort
-1 PRIMARY City ref Country Country 3 world.Country.Code 18
+1 PRIMARY City hash_ALL Country #hash#Country 3 world.Country.Code 4080 Using join buffer (flat, BNLH join)
2 MATERIALIZED Country ALL Name NULL NULL NULL 239 Using where
SELECT City.Name, City.Population
FROM City JOIN Country ON City.Country = Country.Code
diff --git a/mysql-test/r/subselect_mat_cost_bugs.result b/mysql-test/r/subselect_mat_cost_bugs.result
index 125da8da517..d179a57bcac 100644
--- a/mysql-test/r/subselect_mat_cost_bugs.result
+++ b/mysql-test/r/subselect_mat_cost_bugs.result
@@ -96,8 +96,8 @@ WHERE t1.pk) ;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 9 100.00 Using where
2 DEPENDENT SUBQUERY t1b ALL NULL NULL NULL NULL 9 100.00
-2 DEPENDENT SUBQUERY t1a ref c2 c2 5 test.t1b.pk 1 100.00 Using where
-2 DEPENDENT SUBQUERY t2 index c3 c3 9 NULL 2 100.00 Using where; Using index; Using join buffer (flat, BNL join)
+2 DEPENDENT SUBQUERY t1a hash_ALL c2 #hash#c2 5 test.t1b.pk 9 11.11 Using where; Using join buffer (flat, BNLH join)
+2 DEPENDENT SUBQUERY t2 index c3 c3 9 NULL 2 100.00 Using where; Using index; Using join buffer (incremental, BNL join)
Warnings:
Note 1276 Field or reference 'test.t1.pk' of SELECT #2 was resolved in SELECT #1
Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk` from `test`.`t1` where <expr_cache><`test`.`t1`.`c1`,`test`.`t1`.`pk`>(<in_optimizer>(`test`.`t1`.`c1`,<exists>(/* select#2 */ select `test`.`t1a`.`c1` from `test`.`t1b` join `test`.`t2` left join `test`.`t1a` on(`test`.`t1a`.`c2` = `test`.`t1b`.`pk` and 2) where `test`.`t1`.`pk` <> 0 and <cache>(`test`.`t1`.`c1`) = `test`.`t1a`.`c1` and `test`.`t2`.`c3` = `test`.`t1b`.`c4`)))
@@ -194,8 +194,8 @@ WHERE t1.f1 AND alias2.f10
)
ORDER BY field1 ;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 Using where; Using filesort
-1 PRIMARY alias1 eq_ref PRIMARY PRIMARY 4 alias2.f3 1 Using index
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort
+1 PRIMARY alias1 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 alias2.f3 2 Using index; Using join buffer (flat, BNLH join)
3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2
3 DEPENDENT SUBQUERY t1 index PRIMARY PRIMARY 4 NULL 2 Using where; Using index; Using join buffer (flat, BNL join)
2 DERIVED t2 ALL NULL NULL NULL NULL 2
@@ -264,7 +264,7 @@ WHERE alias1.f11 OR alias1.f3 = 50 AND alias1.f10
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where
2 MATERIALIZED alias1 ALL NULL NULL NULL NULL 2 Using where
-2 MATERIALIZED alias2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
+2 MATERIALIZED alias2 hash_ALL NULL #hash#$hj 4 test.alias1.f11 2 Using where; Using join buffer (flat, BNLH join)
SELECT * FROM t2
WHERE ( f12 ) IN (
SELECT alias2.f3
@@ -284,7 +284,7 @@ WHERE (alias2.f10 = alias1.f11) AND (alias1.f11 OR alias1.f3 = 50 AND alias1.f10
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where
2 MATERIALIZED alias1 ALL NULL NULL NULL NULL 2 Using where
-2 MATERIALIZED alias2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
+2 MATERIALIZED alias2 hash_ALL NULL #hash#$hj 4 test.alias1.f11 2 Using where; Using join buffer (flat, BNLH join)
SELECT * FROM t2
WHERE ( f12 ) IN (
SELECT alias2.f3
@@ -363,7 +363,7 @@ AND a = SOME (SELECT b FROM t5));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where
2 DEPENDENT SUBQUERY t5 index c c 10 NULL 2 Using where; Using index; Start temporary
-2 DEPENDENT SUBQUERY t4 eq_ref PRIMARY PRIMARY 4 test.t5.b 1 Using index condition; Using where; End temporary
+2 DEPENDENT SUBQUERY t4 hash_ALL PRIMARY #hash#PRIMARY 4 test.t5.b 2 Using where; End temporary; Using join buffer (flat, BNLH join)
SELECT *
FROM t3
WHERE t3.b > ALL (
diff --git a/mysql-test/r/subselect_sj2_jcl6.result b/mysql-test/r/subselect_sj2_jcl6.result
index 2955307eb86..54d02d82f10 100644
--- a/mysql-test/r/subselect_sj2_jcl6.result
+++ b/mysql-test/r/subselect_sj2_jcl6.result
@@ -1439,7 +1439,7 @@ DROP TABLE t1,t2;
set join_cache_level=default;
show variables like 'join_cache_level';
Variable_name Value
-join_cache_level 2
+join_cache_level 4
set @@optimizer_switch=@save_optimizer_switch_jcl6;
set @optimizer_switch_for_subselect_sj2_test=NULL;
set @join_cache_level_subselect_sj2_test=NULL;
diff --git a/mysql-test/r/subselect_sj_jcl6.result b/mysql-test/r/subselect_sj_jcl6.result
index 77a073ea2d3..c54ad936244 100644
--- a/mysql-test/r/subselect_sj_jcl6.result
+++ b/mysql-test/r/subselect_sj_jcl6.result
@@ -3416,7 +3416,7 @@ DROP TABLE t1,t2;
set join_cache_level=default;
show variables like 'join_cache_level';
Variable_name Value
-join_cache_level 2
+join_cache_level 4
set @@optimizer_switch=@save_optimizer_switch_jcl6;
set @optimizer_switch_for_subselect_sj_test=NULL;
set @join_cache_level_subselect_sj_test=NULL;
diff --git a/mysql-test/r/subselect_sj_nonmerged.result b/mysql-test/r/subselect_sj_nonmerged.result
index c7e04225ffe..b985b8181ce 100644
--- a/mysql-test/r/subselect_sj_nonmerged.result
+++ b/mysql-test/r/subselect_sj_nonmerged.result
@@ -9,7 +9,7 @@ create table t1 as select * from t0;
explain select * from t0 where a in (select max(a) from t1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 1
-1 PRIMARY t0 ALL NULL NULL NULL NULL 10 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY t0 hash_ALL NULL #hash#$hj 5 <subquery2>.max(a) 10 Using where; Using join buffer (flat, BNLH join)
2 MATERIALIZED t1 ALL NULL NULL NULL NULL 10
select * from t0 where a in (select max(a) from t1);
a
@@ -41,14 +41,14 @@ alter table t3 add primary key(a);
explain select * from t3 where a in (select max(t2.a) from t1, t2 group by t2.b);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 5
-1 PRIMARY t3 eq_ref PRIMARY PRIMARY 8 <subquery2>.max(t2.a) 1 Using where; Using index
+1 PRIMARY t3 hash_index PRIMARY #hash#PRIMARY:PRIMARY 8:8 <subquery2>.max(t2.a) 100 Using where; Using index; Using join buffer (flat, BNLH join)
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 Using temporary
2 MATERIALIZED t1 ALL NULL NULL NULL NULL 10 Using join buffer (flat, BNL join)
# Compare to this which really will have 50 record combinations:
explain select * from t3 where a in (select max(t2.a) from t1, t2 group by t2.b, t1.b);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 50
-1 PRIMARY t3 eq_ref PRIMARY PRIMARY 8 <subquery2>.max(t2.a) 1 Using where; Using index
+1 PRIMARY t3 hash_index PRIMARY #hash#PRIMARY:PRIMARY 8:8 <subquery2>.max(t2.a) 100 Using where; Using index; Using join buffer (flat, BNLH join)
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 Using temporary
2 MATERIALIZED t1 ALL NULL NULL NULL NULL 10 Using join buffer (flat, BNL join)
SET @save_optimizer_switch=@@optimizer_switch;
@@ -58,7 +58,7 @@ explain select * from t3
where a in (select max(t2.a) from t1 left join t2 on t1.a=t2.a group by t2.b, t1.b);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 50
-1 PRIMARY t3 eq_ref PRIMARY PRIMARY 8 <subquery2>.max(t2.a) 1 Using where; Using index
+1 PRIMARY t3 hash_index PRIMARY #hash#PRIMARY:PRIMARY 8:8 <subquery2>.max(t2.a) 100 Using where; Using index; Using join buffer (flat, BNLH join)
2 MATERIALIZED t1 ALL NULL NULL NULL NULL 10 Using temporary
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 Using where
SET optimizer_switch=@save_optimizer_switch;
@@ -67,9 +67,9 @@ insert into t4 select A.a + 10*B.a, A.a + 10*B.a, 'filler' from t0 A, t0 B;
explain select * from t0, t4 where
t4.b=t0.a and t4.a in (select max(t2.a) from t1, t2 group by t2.b);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t0 ALL NULL NULL NULL NULL 10
-1 PRIMARY t4 ALL a NULL NULL NULL 100 Using where; Using join buffer (flat, BNL join)
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 test.t4.a 1
+1 PRIMARY t0 ALL NULL NULL NULL NULL 10 Using where
+1 PRIMARY t4 hash_ALL a #hash#$hj 5 test.t0.a 100 Using where; Using join buffer (flat, BNLH join)
+1 PRIMARY <subquery2> hash_ALL distinct_key #hash#distinct_key 4 test.t4.a 5 Using join buffer (incremental, BNLH join)
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 Using temporary
2 MATERIALIZED t1 ALL NULL NULL NULL NULL 10 Using join buffer (flat, BNL join)
insert into t4 select 100 + (B.a *100 + A.a), 100 + (B.a*100 + A.a), 'filler' from t4 A, t0 B;
@@ -79,7 +79,7 @@ t4.b in (select max(t2.a) from t1, t2 group by t2.b);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <subquery3> ALL distinct_key NULL NULL NULL 5
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 5 Using join buffer (flat, BNL join)
-1 PRIMARY t4 ref a a 10 <subquery2>.max(t2.a),<subquery3>.max(t2.a) 12
+1 PRIMARY t4 hash_ALL a #hash#a 10 <subquery2>.max(t2.a),<subquery3>.max(t2.a) 1100 Using join buffer (incremental, BNLH join)
3 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 Using temporary
3 MATERIALIZED t1 ALL NULL NULL NULL NULL 10 Using join buffer (flat, BNL join)
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 Using temporary
@@ -115,8 +115,8 @@ insert into t1 select A.a + 10*B.a + 100*C.a from t0 A, t0 B, t0 C;
explain select * from t1 X join t0 Y on X.a < Y.a where X.a in (select max(a) from t0);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 1
-1 PRIMARY X ref a a 5 <subquery2>.max(a) 1 Using index
-1 PRIMARY Y ALL NULL NULL NULL NULL 10 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY X hash_index a #hash#a:a 5:5 <subquery2>.max(a) 1000 Using index; Using join buffer (flat, BNLH join)
+1 PRIMARY Y ALL NULL NULL NULL NULL 10 Using where; Using join buffer (incremental, BNL join)
2 MATERIALIZED t0 ALL NULL NULL NULL NULL 10
drop table t0, t1;
set optimizer_switch=@save_optimizer_switch;
diff --git a/mysql-test/r/table_elim.result b/mysql-test/r/table_elim.result
index cf9a4a38779..b0ffb0b8bae 100644
--- a/mysql-test/r/table_elim.result
+++ b/mysql-test/r/table_elim.result
@@ -131,7 +131,7 @@ This should use facts and a1 tables:
explain extended select id from v1 where attr1 between 12 and 14;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY a1 range PRIMARY,attr1 attr1 5 NULL 2 100.00 Using index condition
-1 PRIMARY f eq_ref PRIMARY PRIMARY 4 test.a1.id 1 100.00 Using index
+1 PRIMARY f hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.a1.id 100 1.00 Using index; Using join buffer (flat, BNLH join)
Warnings:
Note 1276 Field or reference 'test.a2.id' of SELECT #3 was resolved in SELECT #2
Note 1003 /* select#1 */ select `f`.`id` AS `id` from `test`.`t0` `f` join `test`.`t1` `a1` where `f`.`id` = `a1`.`id` and `a1`.`attr1` between 12 and 14
@@ -139,7 +139,7 @@ This should use facts, a2 and its subquery:
explain extended select id from v1 where attr2 between 12 and 14;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY a2 range PRIMARY,attr2 attr2 5 NULL 5 100.00 Using index condition; Using where
-1 PRIMARY f eq_ref PRIMARY PRIMARY 4 test.a2.id 1 100.00 Using index
+1 PRIMARY f hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.a2.id 100 1.00 Using index; Using join buffer (flat, BNLH join)
3 DEPENDENT SUBQUERY t2 ref PRIMARY PRIMARY 4 test.a2.id 2 100.00 Using index
Warnings:
Note 1276 Field or reference 'test.a2.id' of SELECT #3 was resolved in SELECT #2
@@ -159,7 +159,7 @@ This should use facts and a1 tables:
explain extended select id from v2 where attr1 between 12 and 14;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY a1 range PRIMARY,attr1 attr1 5 NULL 2 100.00 Using index condition
-1 PRIMARY f eq_ref PRIMARY PRIMARY 4 test.a1.id 1 100.00 Using index
+1 PRIMARY f hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.a1.id 100 1.00 Using index; Using join buffer (flat, BNLH join)
Warnings:
Note 1276 Field or reference 'test.f.id' of SELECT #3 was resolved in SELECT #2
Note 1003 /* select#1 */ select `f`.`id` AS `id` from `test`.`t0` `f` join `test`.`t1` `a1` where `f`.`id` = `a1`.`id` and `a1`.`attr1` between 12 and 14
@@ -167,7 +167,7 @@ This should use facts, a2 and its subquery:
explain extended select id from v2 where attr2 between 12 and 14;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY a2 range PRIMARY,attr2 attr2 5 NULL 5 100.00 Using index condition
-1 PRIMARY f eq_ref PRIMARY PRIMARY 4 test.a2.id 1 100.00 Using where; Using index
+1 PRIMARY f hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.a2.id 100 1.00 Using where; Using index; Using join buffer (flat, BNLH join)
3 DEPENDENT SUBQUERY t2 ref PRIMARY PRIMARY 4 test.f.id 2 100.00 Using index
Warnings:
Note 1276 Field or reference 'test.f.id' of SELECT #3 was resolved in SELECT #2
diff --git a/mysql-test/r/table_elim_debug.result b/mysql-test/r/table_elim_debug.result
index ae49b1433fd..973462e0bd1 100644
--- a/mysql-test/r/table_elim_debug.result
+++ b/mysql-test/r/table_elim_debug.result
@@ -10,7 +10,7 @@ set optimizer_switch='table_elimination=off';
explain select t1.a from t1 left join t2 on t2.a=t1.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 4
-1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 Using where; Using index
+1 SIMPLE t2 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t1.a 2 Using where; Using index; Using join buffer (flat, BNLH join)
set optimizer_switch='table_elimination=on';
explain select t1.a from t1 left join t2 on t2.a=t1.a;
id select_type table type possible_keys key key_len ref rows Extra
diff --git a/mysql-test/r/table_value_constr.result b/mysql-test/r/table_value_constr.result
index 39caba331ef..67981571707 100644
--- a/mysql-test/r/table_value_constr.result
+++ b/mysql-test/r/table_value_constr.result
@@ -744,7 +744,7 @@ explain extended select * from t1
where a in (values (1));
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <subquery3> ALL distinct_key NULL NULL NULL 2 100.00
-1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY t1 hash_ALL NULL #hash#$hj 5 tvc_0.1 6 100.00 Using where; Using join buffer (flat, BNLH join)
3 MATERIALIZED <derived2> ALL NULL NULL NULL NULL 2 100.00
2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
@@ -753,7 +753,7 @@ explain extended select * from t1
where a in (select * from (values (1)) as tvc_0);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 2 100.00
-1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY t1 hash_ALL NULL #hash#$hj 5 tvc_0.1 6 100.00 Using where; Using join buffer (flat, BNLH join)
2 MATERIALIZED <derived3> ALL NULL NULL NULL NULL 2 100.00
3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
@@ -979,7 +979,7 @@ explain extended select * from t1
where a = any (values (1),(2));
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <subquery3> ALL distinct_key NULL NULL NULL 2 100.00
-1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY t1 hash_ALL NULL #hash#$hj 5 tvc_0.1 6 100.00 Using where; Using join buffer (flat, BNLH join)
3 MATERIALIZED <derived2> ALL NULL NULL NULL NULL 2 100.00
2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
@@ -988,7 +988,7 @@ explain extended select * from t1
where a = any (select * from (values (1),(2)) as tvc_0);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 2 100.00
-1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY t1 hash_ALL NULL #hash#$hj 5 tvc_0.1 6 100.00 Using where; Using join buffer (flat, BNLH join)
2 MATERIALIZED <derived3> ALL NULL NULL NULL NULL 2 100.00
3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
diff --git a/mysql-test/r/tmp_table_count-7586.result b/mysql-test/r/tmp_table_count-7586.result
index 0c526e0d4a3..bfdf4d149b5 100644
--- a/mysql-test/r/tmp_table_count-7586.result
+++ b/mysql-test/r/tmp_table_count-7586.result
@@ -37,7 +37,7 @@ INSERT INTO t2 values(1),(2);
EXPLAIN SELECT * FROM t1 WHERE a IN (SELECT * FROM t2 GROUP BY a HAVING a > 1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 test.t1.a 1
+1 PRIMARY <subquery2> hash_ALL distinct_key #hash#distinct_key 4 test.t1.a 2 Using join buffer (flat, BNLH join)
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 Using temporary
truncate table performance_schema.events_statements_history_long;
flush status;
diff --git a/mysql-test/r/type_time_6065.result b/mysql-test/r/type_time_6065.result
index 56de96870b6..3913fe952bb 100644
--- a/mysql-test/r/type_time_6065.result
+++ b/mysql-test/r/type_time_6065.result
@@ -9,8 +9,8 @@ STRAIGHT_JOIN
t2 ignore INDEX (col_datetime_key)
WHERE col_time_key = col_datetime_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00
-1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 6 test.t1.col_time_key 5 100.00 Using where; Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where `test`.`t1`.`col_time_key` = `test`.`t2`.`col_datetime_key`
SELECT * FROM
@@ -30,8 +30,8 @@ STRAIGHT_JOIN
t2 ignore INDEX (col_datetime_key)
WHERE col_datetime_key = col_time_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00
-1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 6 test.t1.col_time_key 5 100.00 Using where; Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where `test`.`t2`.`col_datetime_key` = `test`.`t1`.`col_time_key`
SELECT * FROM
@@ -52,7 +52,7 @@ t2 force INDEX (col_datetime_key)
WHERE col_time_key = col_datetime_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where
-1 SIMPLE t2 ref col_datetime_key col_datetime_key 6 test.t1.col_time_key 1 100.00 Using where; Using index
+1 SIMPLE t2 hash_index col_datetime_key #hash#col_datetime_key:col_datetime_key 6:6 test.t1.col_time_key 5 20.00 Using where; Using index; Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t1`.`col_time_key` = `test`.`t2`.`col_datetime_key`
SELECT * FROM
@@ -73,7 +73,7 @@ t2 force INDEX (col_datetime_key)
WHERE col_datetime_key = col_time_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where
-1 SIMPLE t2 ref col_datetime_key col_datetime_key 6 test.t1.col_time_key 1 100.00 Using where; Using index
+1 SIMPLE t2 hash_index col_datetime_key #hash#col_datetime_key:col_datetime_key 6:6 test.t1.col_time_key 5 20.00 Using where; Using index; Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t2`.`col_datetime_key` = `test`.`t1`.`col_time_key`
SELECT * FROM
@@ -93,8 +93,8 @@ STRAIGHT_JOIN
t2 ignore INDEX (col_datetime_key)
WHERE col_time_key = col_datetime_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Using index
-1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Using where; Using index
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 6 test.t1.col_time_key 5 100.00 Using where; Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where `test`.`t1`.`col_time_key` = `test`.`t2`.`col_datetime_key`
SELECT * FROM
@@ -114,8 +114,8 @@ STRAIGHT_JOIN
t2 ignore INDEX (col_datetime_key)
WHERE col_datetime_key = col_time_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Using index
-1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Using where; Using index
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 6 test.t1.col_time_key 5 100.00 Using where; Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` IGNORE INDEX (`col_datetime_key`) where `test`.`t2`.`col_datetime_key` = `test`.`t1`.`col_time_key`
SELECT * FROM
@@ -136,7 +136,7 @@ t2 force INDEX (col_datetime_key)
WHERE col_time_key = col_datetime_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Using where; Using index
-1 SIMPLE t2 ref col_datetime_key col_datetime_key 6 test.t1.col_time_key 1 100.00 Using where; Using index
+1 SIMPLE t2 hash_index col_datetime_key #hash#col_datetime_key:col_datetime_key 6:6 test.t1.col_time_key 5 20.00 Using where; Using index; Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t1`.`col_time_key` = `test`.`t2`.`col_datetime_key`
SELECT * FROM
@@ -157,7 +157,7 @@ t2 force INDEX (col_datetime_key)
WHERE col_datetime_key = col_time_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Using where; Using index
-1 SIMPLE t2 ref col_datetime_key col_datetime_key 6 test.t1.col_time_key 1 100.00 Using where; Using index
+1 SIMPLE t2 hash_index col_datetime_key #hash#col_datetime_key:col_datetime_key 6:6 test.t1.col_time_key 5 20.00 Using where; Using index; Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t2`.`col_datetime_key` = `test`.`t1`.`col_time_key`
SELECT * FROM
@@ -177,8 +177,8 @@ STRAIGHT_JOIN
t1 ignore INDEX (col_time_key)
WHERE col_time_key = col_datetime_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00
-1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using where
+1 SIMPLE t1 hash_ALL NULL #hash#$hj 4 test.t2.col_datetime_key 5 100.00 Using where; Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where `test`.`t1`.`col_time_key` = `test`.`t2`.`col_datetime_key`
SELECT * FROM
@@ -198,8 +198,8 @@ STRAIGHT_JOIN
t1 ignore INDEX (col_time_key)
WHERE col_datetime_key = col_time_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00
-1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using where
+1 SIMPLE t1 hash_ALL NULL #hash#$hj 4 test.t2.col_datetime_key 5 100.00 Using where; Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where `test`.`t2`.`col_datetime_key` = `test`.`t1`.`col_time_key`
SELECT * FROM
@@ -220,7 +220,7 @@ t1 force INDEX (col_time_key)
WHERE col_time_key = col_datetime_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using where
-1 SIMPLE t1 ref col_time_key col_time_key 4 test.t2.col_datetime_key 2 100.00 Using where; Using index
+1 SIMPLE t1 hash_index col_time_key #hash#col_time_key:col_time_key 4:4 test.t2.col_datetime_key 5 40.00 Using where; Using index; Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t1`.`col_time_key` = `test`.`t2`.`col_datetime_key`
SELECT * FROM
@@ -241,7 +241,7 @@ t1 force INDEX (col_time_key)
WHERE col_datetime_key = col_time_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using where
-1 SIMPLE t1 ref col_time_key col_time_key 4 test.t2.col_datetime_key 2 100.00 Using where; Using index
+1 SIMPLE t1 hash_index col_time_key #hash#col_time_key:col_time_key 4:4 test.t2.col_datetime_key 5 40.00 Using where; Using index; Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t2`.`col_datetime_key` = `test`.`t1`.`col_time_key`
SELECT * FROM
@@ -261,8 +261,8 @@ STRAIGHT_JOIN
t1 ignore INDEX (col_time_key)
WHERE col_time_key = col_datetime_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index
-1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using where; Using index
+1 SIMPLE t1 hash_ALL NULL #hash#$hj 4 test.t2.col_datetime_key 5 100.00 Using where; Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where `test`.`t1`.`col_time_key` = `test`.`t2`.`col_datetime_key`
SELECT * FROM
@@ -282,8 +282,8 @@ STRAIGHT_JOIN
t1 ignore INDEX (col_time_key)
WHERE col_datetime_key = col_time_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index
-1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using where; Using index
+1 SIMPLE t1 hash_ALL NULL #hash#$hj 4 test.t2.col_datetime_key 5 100.00 Using where; Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` IGNORE INDEX (`col_time_key`) where `test`.`t2`.`col_datetime_key` = `test`.`t1`.`col_time_key`
SELECT * FROM
@@ -304,7 +304,7 @@ t1 force INDEX (col_time_key)
WHERE col_time_key = col_datetime_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using where; Using index
-1 SIMPLE t1 ref col_time_key col_time_key 4 test.t2.col_datetime_key 2 100.00 Using where; Using index
+1 SIMPLE t1 hash_index col_time_key #hash#col_time_key:col_time_key 4:4 test.t2.col_datetime_key 5 40.00 Using where; Using index; Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t1`.`col_time_key` = `test`.`t2`.`col_datetime_key`
SELECT * FROM
@@ -325,7 +325,7 @@ t1 force INDEX (col_time_key)
WHERE col_datetime_key = col_time_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using where; Using index
-1 SIMPLE t1 ref col_time_key col_time_key 4 test.t2.col_datetime_key 2 100.00 Using where; Using index
+1 SIMPLE t1 hash_index col_time_key #hash#col_time_key:col_time_key 4:4 test.t2.col_datetime_key 5 40.00 Using where; Using index; Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t2`.`col_datetime_key` = `test`.`t1`.`col_time_key`
SELECT * FROM
@@ -2344,11 +2344,11 @@ col_datetime_key col_time_key
2012-03-05 22:59:59 838:59:59
SELECT * FROM t2 STRAIGHT_JOIN t1 FORCE INDEX (col_time_key) WHERE col_time_key = col_datetime_key;
col_datetime_key col_time_key
+2011-12-27 01:00:01 -838:59:59
2011-12-29 22:00:00 -770:00:00
2011-12-30 08:00:00 -760:00:00
2012-03-02 16:00:00 760:00:00
2012-03-03 02:00:00 770:00:00
-2011-12-27 01:00:01 -838:59:59
2012-03-05 22:59:59 838:59:59
DROP TABLE t1, t2;
SET TIMESTAMP=DEFAULT;
diff --git a/mysql-test/suite/gcol/r/gcol_keys_innodb.result b/mysql-test/suite/gcol/r/gcol_keys_innodb.result
index fadbb3b8031..a24d0acd3a1 100644
--- a/mysql-test/suite/gcol/r/gcol_keys_innodb.result
+++ b/mysql-test/suite/gcol/r/gcol_keys_innodb.result
@@ -500,7 +500,7 @@ FROM (t1 AS table1 JOIN t1 AS table2 ON (table2.pk = table1.pk))
ORDER BY field1, field2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE table1 ALL PRIMARY NULL NULL NULL 1 Using temporary; Using filesort
-1 SIMPLE table2 eq_ref PRIMARY PRIMARY 4 test.table1.pk 1
+1 SIMPLE table2 hash_ALL PRIMARY #hash#PRIMARY 4 test.table1.pk 1 Using join buffer (flat, BNLH join)
SELECT table1.col_int_key + 1 AS field1, table2.col_int_key AS field2
FROM (t1 AS table1 JOIN t1 AS table2 ON (table2.pk = table1.pk))
GROUP BY field1, field2;
@@ -511,7 +511,7 @@ FROM (t1 AS table1 JOIN t1 AS table2 ON (table2.pk = table1.pk))
GROUP BY field1, field2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE table1 ALL PRIMARY NULL NULL NULL 1 Using temporary; Using filesort
-1 SIMPLE table2 eq_ref PRIMARY PRIMARY 4 test.table1.pk 1
+1 SIMPLE table2 hash_ALL PRIMARY #hash#PRIMARY 4 test.table1.pk 1 Using join buffer (flat, BNLH join)
DROP TABLE t1;
#
# Bug#21391781 ASSERT WHEN RUNNING ALTER TABLE ON A TABLE WITH INDEX
diff --git a/mysql-test/suite/heap/heap_btree.result b/mysql-test/suite/heap/heap_btree.result
index 12a011778c6..6e681466408 100644
--- a/mysql-test/suite/heap/heap_btree.result
+++ b/mysql-test/suite/heap/heap_btree.result
@@ -73,7 +73,7 @@ engine=heap;
insert into t1 values (1,1),(2,2),(1,3),(2,4),(2,5),(2,6);
explain select * from t1 where x=1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref x x 4 const 1
+1 SIMPLE t1 ref x x 4 const 1 Using where
select * from t1 where x=1;
x y
1 1
@@ -81,15 +81,15 @@ x y
select * from t1,t1 as t2 where t1.x=t2.y;
x y x y
1 1 1 1
-2 2 2 2
1 3 1 1
+2 2 2 2
2 4 2 2
2 5 2 2
2 6 2 2
explain select * from t1,t1 as t2 where t1.x=t2.y;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL x NULL NULL NULL 6
-1 SIMPLE t2 eq_ref y y 4 test.t1.x 1
+1 SIMPLE t2 hash_ALL y #hash#y 4 test.t1.x 6 Using join buffer (flat, BNLH join)
drop table t1;
create table t1 (a int) engine=heap;
insert into t1 values(1);
@@ -134,7 +134,7 @@ a b
1 1
explain select * from tx where b=x;
id select_type table type possible_keys key key_len ref rows Extra
-x SIMPLE tx ref b b x const x
+x SIMPLE tx ref b b x const x Using where
drop table t1;
create table t1 (id int unsigned not null, primary key using BTREE (id)) engine=HEAP;
insert into t1 values(1);
diff --git a/mysql-test/suite/heap/heap_hash.result b/mysql-test/suite/heap/heap_hash.result
index 55d43588403..f9b7025eded 100644
--- a/mysql-test/suite/heap/heap_hash.result
+++ b/mysql-test/suite/heap/heap_hash.result
@@ -78,15 +78,15 @@ x y
select * from t1,t1 as t2 where t1.x=t2.y;
x y x y
1 1 1 1
-2 2 2 2
1 3 1 1
+2 2 2 2
2 4 2 2
2 5 2 2
2 6 2 2
explain select * from t1,t1 as t2 where t1.x=t2.y;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL x NULL NULL NULL 6
-1 SIMPLE t2 eq_ref y y 4 test.t1.x 1
+1 SIMPLE t2 hash_ALL y #hash#y 4 test.t1.x 6 Using join buffer (flat, BNLH join)
drop table t1;
create table t1 (a int) engine=heap;
insert into t1 values(1);
@@ -354,7 +354,7 @@ t3 1 a 2 b NULL 13 NULL NULL HASH
explain select * from t1 ignore key(btree_idx), t3 where t1.name='matt' and t3.a = concat('',t1.name) and t3.b=t1.name;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref heap_idx heap_idx 22 const 7 Using where
-1 SIMPLE t3 ref a a 44 func,const 7 Using where
+1 SIMPLE t3 hash_ALL a #hash#a 44 func,const 91 Using where; Using join buffer (flat, BNLH join)
drop table t1, t2, t3;
create temporary table t1 ( a int, index (a) ) engine=memory;
insert into t1 values (1),(2),(3),(4),(5);
diff --git a/mysql-test/suite/innodb/r/innodb_bug30423.result b/mysql-test/suite/innodb/r/innodb_bug30423.result
index c7f823a06ae..538241fadeb 100644
--- a/mysql-test/suite/innodb/r/innodb_bug30423.result
+++ b/mysql-test/suite/innodb/r/innodb_bug30423.result
@@ -49,8 +49,8 @@ LEFT JOIN bug30243_2 contacts
ON orgs.org_id=contacts.org_id ;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE orgs index NULL org_id 4 NULL ROWS Using index
-1 SIMPLE sa_opportunities ref org_id org_id 5 test.orgs.org_id ROWS Using index
-1 SIMPLE contacts ref contacts$org_id contacts$org_id 5 test.orgs.org_id ROWS Using index
+1 SIMPLE sa_opportunities hash_index org_id #hash#org_id:org_id 5:5 test.orgs.org_id ROWS Using index; Using join buffer (flat, BNLH join)
+1 SIMPLE contacts hash_index contacts$org_id #hash#contacts$org_id:contacts$org_id 5:5 test.orgs.org_id ROWS Using index; Using join buffer (incremental, BNLH join)
select @@innodb_stats_method;
@@innodb_stats_method
nulls_ignored
@@ -75,8 +75,8 @@ LEFT JOIN bug30243_2 contacts
ON orgs.org_id=contacts.org_id;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE orgs index NULL org_id 4 NULL ROWS Using index
-1 SIMPLE sa_opportunities ref org_id org_id 5 test.orgs.org_id ROWS Using index
-1 SIMPLE contacts ref contacts$org_id contacts$org_id 5 test.orgs.org_id ROWS Using index
+1 SIMPLE sa_opportunities hash_index org_id #hash#org_id:org_id 5:5 test.orgs.org_id ROWS Using index; Using join buffer (flat, BNLH join)
+1 SIMPLE contacts hash_index contacts$org_id #hash#contacts$org_id:contacts$org_id 5:5 test.orgs.org_id ROWS Using index; Using join buffer (incremental, BNLH join)
SELECT COUNT(*) FROM table_bug30423 WHERE org_id IS NULL;
COUNT(*)
1024
diff --git a/mysql-test/suite/maria/icp.result b/mysql-test/suite/maria/icp.result
index d22e705e6de..6f600455767 100644
--- a/mysql-test/suite/maria/icp.result
+++ b/mysql-test/suite/maria/icp.result
@@ -508,7 +508,7 @@ WHERE (t2.pk <= 4 AND t1.pk IN (2,1)) OR
(t1.pk > 1 AND t2.pk BETWEEN 6 AND 6);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 2 Using index condition; Using where; Rowid-ordered scan
-1 SIMPLE t2 range PRIMARY PRIMARY 4 NULL 2 Using index condition; Using where; Rowid-ordered scan; Using join buffer (flat, BNL join)
+1 SIMPLE t2 hash_range PRIMARY #hash#$hj:PRIMARY 5:4 test.t1.c1 2 Using where; Rowid-ordered scan; Using join buffer (flat, BNLH join)
SELECT c2 FROM t1 JOIN t2 ON t1.c1 = t2.c1
WHERE (t2.pk <= 4 AND t1.pk IN (2,1)) OR
(t1.pk > 1 AND t2.pk BETWEEN 6 AND 6);
@@ -804,9 +804,9 @@ AND (EXISTS (SELECT * FROM t1, t2 WHERE a = f AND h <= t.e AND a > t.b)
OR a = 0 AND h < 'z' );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t ALL PRIMARY,c NULL NULL NULL 64 Using where
-1 PRIMARY t2 ref g g 5 test.t.c 19 Using where
+1 PRIMARY t2 hash_ALL g #hash#g 5 test.t.c 186 Using where; Using join buffer (flat, BNLH join)
2 DEPENDENT SUBQUERY t1 index PRIMARY PRIMARY 4 NULL 64 Using where; Using index
-2 DEPENDENT SUBQUERY t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 Using where
+2 DEPENDENT SUBQUERY t2 hash_ALL PRIMARY #hash#PRIMARY 4 test.t1.a 186 Using where; Using join buffer (flat, BNLH join)
SELECT COUNT(*) FROM t1 AS t, t2
WHERE c = g
AND (EXISTS (SELECT * FROM t1, t2 WHERE a = f AND h <= t.e AND a > t.b)
diff --git a/mysql-test/suite/optimizer_unfixed_bugs/r/bug45221.result b/mysql-test/suite/optimizer_unfixed_bugs/r/bug45221.result
index 79100ca2b48..17edbc19e0e 100644
--- a/mysql-test/suite/optimizer_unfixed_bugs/r/bug45221.result
+++ b/mysql-test/suite/optimizer_unfixed_bugs/r/bug45221.result
@@ -29,10 +29,10 @@ SELECT `int_key`
FROM t2
WHERE `date_nokey` < `datetime_nokey` XOR OUTR .`date_nokey` ) ;
pk
-9
2
5
6
+9
SELECT `pk`
FROM t1
WHERE `pk` IN (
diff --git a/mysql-test/suite/sys_vars/r/join_cache_level_basic.result b/mysql-test/suite/sys_vars/r/join_cache_level_basic.result
index eca823a5d72..f8ea6b143dd 100644
--- a/mysql-test/suite/sys_vars/r/join_cache_level_basic.result
+++ b/mysql-test/suite/sys_vars/r/join_cache_level_basic.result
@@ -1,22 +1,22 @@
SET @start_global_value = @@global.join_cache_level;
select @@global.join_cache_level;
@@global.join_cache_level
-2
+4
select @@session.join_cache_level;
@@session.join_cache_level
-2
+4
show global variables like 'join_cache_level';
Variable_name Value
-join_cache_level 2
+join_cache_level 4
show session variables like 'join_cache_level';
Variable_name Value
-join_cache_level 2
+join_cache_level 4
select * from information_schema.global_variables where variable_name='join_cache_level';
VARIABLE_NAME VARIABLE_VALUE
-JOIN_CACHE_LEVEL 2
+JOIN_CACHE_LEVEL 4
select * from information_schema.session_variables where variable_name='join_cache_level';
VARIABLE_NAME VARIABLE_VALUE
-JOIN_CACHE_LEVEL 2
+JOIN_CACHE_LEVEL 4
set global join_cache_level=4;
select @@global.join_cache_level;
@@global.join_cache_level
diff --git a/mysql-test/suite/sys_vars/r/max_seeks_for_key_func.result b/mysql-test/suite/sys_vars/r/max_seeks_for_key_func.result
index 1798bd5d6e0..ce35c463048 100644
--- a/mysql-test/suite/sys_vars/r/max_seeks_for_key_func.result
+++ b/mysql-test/suite/sys_vars/r/max_seeks_for_key_func.result
@@ -30,8 +30,8 @@ INSERT INTO t1(b) VALUES("BREc");
INSERT INTO t1(b) VALUES("CRec");
EXPLAIN SELECT STRAIGHT_JOIN * FROM t1,t1 AS t2 WHERE t1.b = t2.b;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 3
-1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 21 test.t1.b 3 Using where; Using join buffer (flat, BNLH join)
'#--------------------FN_DYNVARS_084_02-------------------------#'
CONNECT test_con2,localhost,root,,;
connection test_con2;
@@ -48,8 +48,8 @@ SELECT @@global.max_seeks_for_key;
INSERT INTO t1(b) VALUES("AREc");
EXPLAIN SELECT STRAIGHT_JOIN * FROM t1,t1 AS t2 WHERE t1.b = t2.b;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 4
-1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 21 test.t1.b 4 Using where; Using join buffer (flat, BNLH join)
SET @@session.max_seeks_for_key = 2;
SELECT @@session.max_seeks_for_key;
@@session.max_seeks_for_key
@@ -58,24 +58,24 @@ INSERT INTO t1(b) VALUES("BREc");
INSERT INTO t1(b) VALUES("CRec");
EXPLAIN SELECT STRAIGHT_JOIN * FROM t1,t1 AS t2 WHERE t1.b = t2.b;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 6
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using where
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 21 test.t1.b 6 Using where; Using join buffer (flat, BNLH join)
INSERT INTO t1 VALUES(null,"test");
INSERT INTO t1 VALUES (null,"a"),(null,"a"),(null,"a"),
(null,"a"),(null,"a"),(null,"a"),(null,"a"),
(null,"a"),(null,"a"),(null,"a");
EXPLAIN SELECT STRAIGHT_JOIN * FROM t1,t1 AS t2 WHERE t1.b = t2.b;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 17
-1 SIMPLE t2 ALL NULL NULL NULL NULL 17 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t1 ALL NULL NULL NULL NULL 17 Using where
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 21 test.t1.b 17 Using where; Using join buffer (flat, BNLH join)
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
SET MAX_SEEKS_FOR_KEY=1;
EXPLAIN SELECT STRAIGHT_JOIN * FROM t1,t1 AS t2 WHERE t1.b = t2.b;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 17
-1 SIMPLE t2 ALL NULL NULL NULL NULL 17 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t1 ALL NULL NULL NULL NULL 17 Using where
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 21 test.t1.b 17 Using where; Using join buffer (flat, BNLH join)
SET MAX_SEEKS_FOR_KEY=DEFAULT;
connection default;
disconnect test_con1;
diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
index 920796404b6..91ec36f5dce 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
@@ -1609,10 +1609,10 @@ ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME JOIN_CACHE_LEVEL
-SESSION_VALUE 2
-GLOBAL_VALUE 2
+SESSION_VALUE 4
+GLOBAL_VALUE 4
GLOBAL_VALUE_ORIGIN COMPILE-TIME
-DEFAULT_VALUE 2
+DEFAULT_VALUE 4
VARIABLE_SCOPE SESSION
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Controls what join operations can be executed with join buffers. Odd numbers are used for plain join buffers while even numbers are used for linked buffers
diff --git a/mysql-test/suite/versioning/r/derived.result b/mysql-test/suite/versioning/r/derived.result
index cd6cec7e725..02d24acc9ae 100644
--- a/mysql-test/suite/versioning/r/derived.result
+++ b/mysql-test/suite/versioning/r/derived.result
@@ -209,12 +209,12 @@ insert into t2 values (1, 2), (2, 1), (3, 1);
## Outer or inner SYSTEM_TIME produces same expression
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t2.x 5 100.00 Using where; Using join buffer (flat, BNLH join)
Query A:
Note 1003 select `test`.`t1`.`x` AS `x`,`test`.`t1`.`y` AS `y1`,`test`.`t2`.`x` AS `x2`,`test`.`t2`.`y` AS `y2` from `test`.`t1` FOR SYSTEM_TIME ALL join `test`.`t2` FOR SYSTEM_TIME ALL where `test`.`t1`.`x` = `test`.`t2`.`x` and `test`.`t1`.`row_end` > <cache>(cast(current_timestamp(6) as datetime(6))) and `test`.`t1`.`row_start` <= <cache>(cast(current_timestamp(6) as datetime(6))) and `test`.`t2`.`row_end` > <cache>(cast(current_timestamp(6) as datetime(6))) and `test`.`t2`.`row_start` <= <cache>(cast(current_timestamp(6) as datetime(6)))
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t2.x 5 100.00 Using where; Using join buffer (flat, BNLH join)
Query B:
Note 1003 select `test`.`t1`.`x` AS `x`,`test`.`t1`.`y` AS `y1`,`test`.`t2`.`x` AS `x2`,`test`.`t2`.`y` AS `y2` from `test`.`t1` FOR SYSTEM_TIME ALL join `test`.`t2` FOR SYSTEM_TIME ALL where `test`.`t1`.`x` = `test`.`t2`.`x` and `test`.`t1`.`row_end` > <cache>(cast(current_timestamp(6) as datetime(6))) and `test`.`t1`.`row_start` <= <cache>(cast(current_timestamp(6) as datetime(6))) and `test`.`t2`.`row_end` > <cache>(cast(current_timestamp(6) as datetime(6))) and `test`.`t2`.`row_start` <= <cache>(cast(current_timestamp(6) as datetime(6)))
Fine result: queries A and B are equal.
diff --git a/mysql-test/suite/versioning/r/select.result b/mysql-test/suite/versioning/r/select.result
index 1f7e0306b9b..b54bb7de1e7 100644
--- a/mysql-test/suite/versioning/r/select.result
+++ b/mysql-test/suite/versioning/r/select.result
@@ -151,23 +151,23 @@ explain extended select * from (select t1.x as IJ2_x1, t1.y as y1, t2.x as x2, t
for system_time as of timestamp @t0 as t;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t2.x 5 100.00 Using where; Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t1`.`x` AS `IJ2_x1`,`test`.`t1`.`y` AS `y1`,`test`.`t2`.`x` AS `x2`,`test`.`t2`.`y` AS `y2` from `test`.`t1` FOR SYSTEM_TIME ALL join `test`.`t2` FOR SYSTEM_TIME ALL where `test`.`t1`.`x` = `test`.`t2`.`x` and `test`.`t1`.`row_end` > <cache>(cast(@`t0` as datetime(6))) and `test`.`t1`.`row_start` <= <cache>(cast(@`t0` as datetime(6))) and `test`.`t2`.`row_end` > <cache>(cast(@`t0` as datetime(6))) and `test`.`t2`.`row_start` <= <cache>(cast(@`t0` as datetime(6)))
explain extended select * from (select t1.x as LJ2_x1, t1.y as y1, t2.x as x2, t2.y as y2 from t1 left join t2 on t1.x = t2.x)
for system_time as of timestamp @t0 as t;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00
-1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.x 3 100.00 Using where; Using join buffer (flat, BNLH join)
Warnings:
-Note 1003 select `test`.`t1`.`x` AS `LJ2_x1`,`test`.`t1`.`y` AS `y1`,`test`.`t2`.`x` AS `x2`,`test`.`t2`.`y` AS `y2` from `test`.`t1` FOR SYSTEM_TIME ALL left join `test`.`t2` FOR SYSTEM_TIME ALL on(`test`.`t2`.`x` = `test`.`t1`.`x` and `test`.`t1`.`row_end` > <cache>(cast(@`t0` as datetime(6))) and `test`.`t1`.`row_start` <= <cache>(cast(@`t0` as datetime(6))) and `test`.`t2`.`row_end` > <cache>(cast(@`t0` as datetime(6))) and `test`.`t2`.`row_start` <= <cache>(cast(@`t0` as datetime(6)))) where 1
+Note 1003 select `test`.`t1`.`x` AS `LJ2_x1`,`test`.`t1`.`y` AS `y1`,`test`.`t2`.`x` AS `x2`,`test`.`t2`.`y` AS `y2` from `test`.`t1` FOR SYSTEM_TIME ALL left join `test`.`t2` FOR SYSTEM_TIME ALL on(`test`.`t2`.`x` = `test`.`t1`.`x` and `test`.`t1`.`row_end` > <cache>(cast(@`t0` as datetime(6))) and `test`.`t1`.`row_start` <= <cache>(cast(@`t0` as datetime(6))) and `test`.`t2`.`row_end` > <cache>(cast(@`t0` as datetime(6))) and `test`.`t2`.`row_start` <= <cache>(cast(@`t0` as datetime(6))) and `test`.`t1`.`x` is not null) where 1
explain extended select * from (select t1.x as RJ2_x1, t1.y as y1, t2.x as x2, t2.y as y2 from t1 right join t2 on t1.x = t2.x)
for system_time as of timestamp @t0 as t;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00
-1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t2.x 5 100.00 Using where; Using join buffer (flat, BNLH join)
Warnings:
-Note 1003 select `test`.`t1`.`x` AS `RJ2_x1`,`test`.`t1`.`y` AS `y1`,`test`.`t2`.`x` AS `x2`,`test`.`t2`.`y` AS `y2` from `test`.`t2` FOR SYSTEM_TIME ALL left join `test`.`t1` FOR SYSTEM_TIME ALL on(`test`.`t1`.`x` = `test`.`t2`.`x` and `test`.`t1`.`row_end` > <cache>(cast(@`t0` as datetime(6))) and `test`.`t1`.`row_start` <= <cache>(cast(@`t0` as datetime(6))) and `test`.`t2`.`row_end` > <cache>(cast(@`t0` as datetime(6))) and `test`.`t2`.`row_start` <= <cache>(cast(@`t0` as datetime(6)))) where 1
+Note 1003 select `test`.`t1`.`x` AS `RJ2_x1`,`test`.`t1`.`y` AS `y1`,`test`.`t2`.`x` AS `x2`,`test`.`t2`.`y` AS `y2` from `test`.`t2` FOR SYSTEM_TIME ALL left join `test`.`t1` FOR SYSTEM_TIME ALL on(`test`.`t1`.`x` = `test`.`t2`.`x` and `test`.`t1`.`row_end` > <cache>(cast(@`t0` as datetime(6))) and `test`.`t1`.`row_start` <= <cache>(cast(@`t0` as datetime(6))) and `test`.`t2`.`row_end` > <cache>(cast(@`t0` as datetime(6))) and `test`.`t2`.`row_start` <= <cache>(cast(@`t0` as datetime(6))) and `test`.`t2`.`x` is not null) where 1
select * from (select t1.x as IJ2_x1, t1.y as y1, t2.x as x2, t2.y as y2 from t1 inner join t2 on t1.x = t2.x)
for system_time as of timestamp @t0 as t;
IJ2_x1 y1 x2 y2
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index 291f13d27f8..2663ca84492 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -5709,7 +5709,7 @@ static Sys_var_ulong Sys_join_cache_level(
"numbers are used for plain join buffers while even numbers are used "
"for linked buffers",
SESSION_VAR(join_cache_level), CMD_LINE(REQUIRED_ARG),
- VALID_RANGE(0, 8), DEFAULT(2), BLOCK_SIZE(1));
+ VALID_RANGE(0, 8), DEFAULT(4), BLOCK_SIZE(1));
static Sys_var_ulong Sys_mrr_buffer_size(
"mrr_buffer_size",