Commit 94cfcbd9 authored by Igor Babaev's avatar Igor Babaev

The main patch for MWL#128: Implement Block Nested Loop Hash Join.

parent 02c040dd
...@@ -123,6 +123,7 @@ analyze table t1; ...@@ -123,6 +123,7 @@ analyze table t1;
select count(*) from t1; select count(*) from t1;
--replace_column 9 REF --replace_column 9 REF
--replace_result i2,i1 i1,i2
explain select count(*) from t1 where explain select count(*) from t1 where
key1a = 2 and key1b is null and key2a = 2 and key2b is null; key1a = 2 and key1b is null and key2a = 2 and key2b is null;
...@@ -130,6 +131,7 @@ select count(*) from t1 where ...@@ -130,6 +131,7 @@ select count(*) from t1 where
key1a = 2 and key1b is null and key2a = 2 and key2b is null; key1a = 2 and key1b is null and key2a = 2 and key2b is null;
--replace_column 9 REF --replace_column 9 REF
--replace_result i3,i1 i1,i3
explain select count(*) from t1 where explain select count(*) from t1 where
key1a = 2 and key1b is null and key3a = 2 and key3b is null; key1a = 2 and key1b is null and key3a = 2 and key3b is null;
......
This diff is collapsed.
set @save_optimizer_switch_jcl6=@@optimizer_switch;
set @@optimizer_switch='semijoin_with_cache=on';
set @@optimizer_switch='outer_join_with_cache=on';
set join_cache_level=6; set join_cache_level=6;
show variables like 'join_cache_level'; show variables like 'join_cache_level';
Variable_name Value Variable_name Value
...@@ -1854,3 +1857,4 @@ set join_cache_level=default; ...@@ -1854,3 +1857,4 @@ set join_cache_level=default;
show variables like 'join_cache_level'; show variables like 'join_cache_level';
Variable_name Value Variable_name Value
join_cache_level 1 join_cache_level 1
set @@optimizer_switch=@save_optimizer_switch_jcl6;
set @save_optimizer_switch_jcl6=@@optimizer_switch;
set @@optimizer_switch='semijoin_with_cache=on';
set @@optimizer_switch='outer_join_with_cache=on';
set join_cache_level=6; set join_cache_level=6;
show variables like 'join_cache_level'; show variables like 'join_cache_level';
Variable_name Value Variable_name Value
...@@ -1317,3 +1320,4 @@ set join_cache_level=default; ...@@ -1317,3 +1320,4 @@ set join_cache_level=default;
show variables like 'join_cache_level'; show variables like 'join_cache_level';
Variable_name Value Variable_name Value
join_cache_level 1 join_cache_level 1
set @@optimizer_switch=@save_optimizer_switch_jcl6;
This diff is collapsed.
set @save_optimizer_switch_jcl6=@@optimizer_switch;
set @@optimizer_switch='semijoin_with_cache=on';
set @@optimizer_switch='outer_join_with_cache=on';
set join_cache_level=6; set join_cache_level=6;
show variables like 'join_cache_level'; show variables like 'join_cache_level';
Variable_name Value Variable_name Value
...@@ -4790,3 +4793,4 @@ set join_cache_level=default; ...@@ -4790,3 +4793,4 @@ set join_cache_level=default;
show variables like 'join_cache_level'; show variables like 'join_cache_level';
Variable_name Value Variable_name Value
join_cache_level 1 join_cache_level 1
set @@optimizer_switch=@save_optimizer_switch_jcl6;
drop table if exists t0, t1, t2, t3, t4, t5, t11, t12, t21, t22; drop table if exists t0, t1, t2, t3, t4, t5, t11, t12, t21, t22;
set @save_optimizer_switch=@@optimizer_switch;
create table t1 (oref int, grp int, ie int) ; create table t1 (oref int, grp int, ie int) ;
insert into t1 (oref, grp, ie) values insert into t1 (oref, grp, ie) values
(1, 1, 1), (1, 1, 1),
...@@ -1046,7 +1047,7 @@ select (select max(Y.a) from t1 Y where a in (select a from t1 Z) and a < X.a) a ...@@ -1046,7 +1047,7 @@ select (select max(Y.a) from t1 Y where a in (select a from t1 Z) and a < X.a) a
subq subq
NULL NULL
0 0
set @@optimizer_switch=default; set @@optimizer_switch=@save_optimizer_switch;
drop table t1; drop table t1;
create table t0 (a int); create table t0 (a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
...@@ -1107,7 +1108,7 @@ a ...@@ -1107,7 +1108,7 @@ a
17 17
18 18
19 19
set @@optimizer_switch=default; set @@optimizer_switch=@save_optimizer_switch;
explain select * from (select a from t0) X where a in (select a from t1); explain select * from (select a from t0) X where a in (select a from t1);
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 11 1 PRIMARY <derived2> ALL NULL NULL NULL NULL 11
...@@ -1153,7 +1154,7 @@ show status like 'Created_tmp_disk_tables'; ...@@ -1153,7 +1154,7 @@ show status like 'Created_tmp_disk_tables';
Variable_name Value Variable_name Value
Created_tmp_disk_tables 1 Created_tmp_disk_tables 1
set @save_max_heap_table_size=@@max_heap_table_size; set @save_max_heap_table_size=@@max_heap_table_size;
set @@optimizer_switch=default; set @@optimizer_switch=@save_optimizer_switch;
drop table t0, t1; drop table t0, t1;
create table t0 (a int); create table t0 (a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
...@@ -1203,7 +1204,7 @@ id select_type table type possible_keys key key_len ref rows Extra ...@@ -1203,7 +1204,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Start temporary 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Start temporary
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where; End temporary; Using join buffer 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where; End temporary; Using join buffer
drop table t1; drop table t1;
set @@optimizer_switch=default; set @@optimizer_switch=@save_optimizer_switch;
create table t1 (a int); create table t1 (a int);
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t2 as select * from t1; create table t2 as select * from t1;
...@@ -1285,7 +1286,7 @@ id select_type table type possible_keys key key_len ref rows Extra ...@@ -1285,7 +1286,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY subselect2 eq_ref unique_key unique_key 10 func 1 1 PRIMARY subselect2 eq_ref unique_key unique_key 10 func 1
2 SUBQUERY t2 ALL NULL NULL NULL NULL 100 2 SUBQUERY t2 ALL NULL NULL NULL NULL 100
set @@optimizer_search_depth=@save_optimizer_search_depth; set @@optimizer_search_depth=@save_optimizer_search_depth;
set @@optimizer_switch=default; set @@optimizer_switch=@save_optimizer_switch;
drop table t0, t1, t2; drop table t0, t1, t2;
create table t0 (a decimal(4,2)); create table t0 (a decimal(4,2));
insert into t0 values (10.24), (22.11); insert into t0 values (10.24), (22.11);
...@@ -1426,3 +1427,4 @@ CALL p1; ...@@ -1426,3 +1427,4 @@ CALL p1;
ERROR 42S22: Unknown column 'f1' in 'where clause' ERROR 42S22: Unknown column 'f1' in 'where clause'
DROP PROCEDURE p1; DROP PROCEDURE p1;
DROP TABLE t1, t2; DROP TABLE t1, t2;
set @@optimizer_switch=@save_optimizer_switch;
set @save_optimizer_switch=@@optimizer_switch;
set @@optimizer_switch='semijoin_with_cache=on';
set @@optimizer_switch='outer_join_with_cache=on';
set join_cache_level=6; set join_cache_level=6;
show variables like 'join_cache_level'; show variables like 'join_cache_level';
Variable_name Value Variable_name Value
join_cache_level 6 join_cache_level 6
drop table if exists t0, t1, t2, t3, t4, t5, t11, t12, t21, t22; drop table if exists t0, t1, t2, t3, t4, t5, t11, t12, t21, t22;
set @save_optimizer_switch=@@optimizer_switch;
create table t1 (oref int, grp int, ie int) ; create table t1 (oref int, grp int, ie int) ;
insert into t1 (oref, grp, ie) values insert into t1 (oref, grp, ie) values
(1, 1, 1), (1, 1, 1),
...@@ -1051,7 +1055,7 @@ select (select max(Y.a) from t1 Y where a in (select a from t1 Z) and a < X.a) a ...@@ -1051,7 +1055,7 @@ select (select max(Y.a) from t1 Y where a in (select a from t1 Z) and a < X.a) a
subq subq
NULL NULL
0 0
set @@optimizer_switch=default; set @@optimizer_switch=@save_optimizer_switch;
drop table t1; drop table t1;
create table t0 (a int); create table t0 (a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
...@@ -1112,7 +1116,7 @@ a ...@@ -1112,7 +1116,7 @@ a
17 17
18 18
19 19
set @@optimizer_switch=default; set @@optimizer_switch=@save_optimizer_switch;
explain select * from (select a from t0) X where a in (select a from t1); explain select * from (select a from t0) X where a in (select a from t1);
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 11 1 PRIMARY <derived2> ALL NULL NULL NULL NULL 11
...@@ -1158,7 +1162,7 @@ show status like 'Created_tmp_disk_tables'; ...@@ -1158,7 +1162,7 @@ show status like 'Created_tmp_disk_tables';
Variable_name Value Variable_name Value
Created_tmp_disk_tables 1 Created_tmp_disk_tables 1
set @save_max_heap_table_size=@@max_heap_table_size; set @save_max_heap_table_size=@@max_heap_table_size;
set @@optimizer_switch=default; set @@optimizer_switch=@save_optimizer_switch;
drop table t0, t1; drop table t0, t1;
create table t0 (a int); create table t0 (a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
...@@ -1208,7 +1212,7 @@ id select_type table type possible_keys key key_len ref rows Extra ...@@ -1208,7 +1212,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Start temporary 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Start temporary
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where; End temporary; Using join buffer 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where; End temporary; Using join buffer
drop table t1; drop table t1;
set @@optimizer_switch=default; set @@optimizer_switch=@save_optimizer_switch;
create table t1 (a int); create table t1 (a int);
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t2 as select * from t1; create table t2 as select * from t1;
...@@ -1290,7 +1294,7 @@ id select_type table type possible_keys key key_len ref rows Extra ...@@ -1290,7 +1294,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY subselect2 eq_ref unique_key unique_key 10 func 1 1 PRIMARY subselect2 eq_ref unique_key unique_key 10 func 1
2 SUBQUERY t2 ALL NULL NULL NULL NULL 100 2 SUBQUERY t2 ALL NULL NULL NULL NULL 100
set @@optimizer_search_depth=@save_optimizer_search_depth; set @@optimizer_search_depth=@save_optimizer_search_depth;
set @@optimizer_switch=default; set @@optimizer_switch=@save_optimizer_switch;
drop table t0, t1, t2; drop table t0, t1, t2;
create table t0 (a decimal(4,2)); create table t0 (a decimal(4,2));
insert into t0 values (10.24), (22.11); insert into t0 values (10.24), (22.11);
...@@ -1431,7 +1435,9 @@ CALL p1; ...@@ -1431,7 +1435,9 @@ CALL p1;
ERROR 42S22: Unknown column 'f1' in 'where clause' ERROR 42S22: Unknown column 'f1' in 'where clause'
DROP PROCEDURE p1; DROP PROCEDURE p1;
DROP TABLE t1, t2; DROP TABLE t1, t2;
set @@optimizer_switch=@save_optimizer_switch;
set join_cache_level=default; set join_cache_level=default;
show variables like 'join_cache_level'; show variables like 'join_cache_level';
Variable_name Value Variable_name Value
join_cache_level 1 join_cache_level 1
set @@optimizer_switch=@save_optimizer_switch;
drop table if exists t0, t1, t2, t3, t4, t10, t11, t12; drop table if exists t0, t1, t2, t3, t4, t10, t11, t12;
set @save_optimizer_switch=@@optimizer_switch;
create table t0 (a int); create table t0 (a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1(a int, b int); create table t1(a int, b int);
...@@ -322,7 +323,8 @@ INSERT INTO WORKS VALUES ('E3','P2',20); ...@@ -322,7 +323,8 @@ INSERT INTO WORKS VALUES ('E3','P2',20);
INSERT INTO WORKS VALUES ('E4','P2',20); INSERT INTO WORKS VALUES ('E4','P2',20);
INSERT INTO WORKS VALUES ('E4','P4',40); INSERT INTO WORKS VALUES ('E4','P4',40);
INSERT INTO WORKS VALUES ('E4','P5',80); INSERT INTO WORKS VALUES ('E4','P5',80);
set optimizer_switch='default,materialization=off'; set optimizer_switch=@save_optimizer_switch;
set optimizer_switch='materialization=off';
explain SELECT EMPNUM, EMPNAME explain SELECT EMPNUM, EMPNAME
FROM STAFF FROM STAFF
WHERE EMPNUM IN WHERE EMPNUM IN
...@@ -344,7 +346,7 @@ E1 Alice ...@@ -344,7 +346,7 @@ E1 Alice
E2 Betty E2 Betty
E3 Carmen E3 Carmen
E4 Don E4 Don
set optimizer_switch='default'; set optimizer_switch=@save_optimizer_switch;
drop table STAFF,WORKS,PROJ; drop table STAFF,WORKS,PROJ;
# End of bug#45191 # End of bug#45191
# #
...@@ -450,7 +452,7 @@ COUNT(*) ...@@ -450,7 +452,7 @@ COUNT(*)
drop table t1, t2; drop table t1, t2;
drop view v1; drop view v1;
drop procedure p1; drop procedure p1;
set SESSION optimizer_switch='default'; set SESSION optimizer_switch=@save_optimizer_switch;
# End of bug#46744 # End of bug#46744
Bug#46797 "Crash in fix_semijoin_strategies_for_picked_join_order Bug#46797 "Crash in fix_semijoin_strategies_for_picked_join_order
...@@ -601,7 +603,7 @@ v1field ...@@ -601,7 +603,7 @@ v1field
DROP TABLE t1,t2; DROP TABLE t1,t2;
DROP VIEW v1,v2; DROP VIEW v1,v2;
DROP PROCEDURE p1; DROP PROCEDURE p1;
set SESSION optimizer_switch='default'; set SESSION optimizer_switch=@save_optimizer_switch;
# End of BUG#48834 # End of BUG#48834
Bug#49097 subquery with view generates wrong result with Bug#49097 subquery with view generates wrong result with
...@@ -1075,3 +1077,4 @@ DROP TABLE t1; ...@@ -1075,3 +1077,4 @@ DROP TABLE t1;
DROP TABLE t2; DROP TABLE t2;
DROP TABLE t3; DROP TABLE t3;
# End of Bug#48623 # End of Bug#48623
set @@optimizer_switch=@save_optimizer_switch;
set @save_optimizer_switch_jcl6=@@optimizer_switch;
set @@optimizer_switch='semijoin_with_cache=on';
set @@optimizer_switch='outer_join_with_cache=on';
set join_cache_level=6; set join_cache_level=6;
show variables like 'join_cache_level'; show variables like 'join_cache_level';
Variable_name Value Variable_name Value
...@@ -733,3 +736,4 @@ set join_cache_level=default; ...@@ -733,3 +736,4 @@ set join_cache_level=default;
show variables like 'join_cache_level'; show variables like 'join_cache_level';
Variable_name Value Variable_name Value
join_cache_level 1 join_cache_level 1
set @@optimizer_switch=@save_optimizer_switch_jcl6;
set @save_optimizer_switch_jcl6=@@optimizer_switch;
set @@optimizer_switch='semijoin_with_cache=on';
set @@optimizer_switch='outer_join_with_cache=on';
set join_cache_level=6; set join_cache_level=6;
show variables like 'join_cache_level'; show variables like 'join_cache_level';
Variable_name Value Variable_name Value
join_cache_level 6 join_cache_level 6
drop table if exists t0, t1, t2, t3, t4, t10, t11, t12; drop table if exists t0, t1, t2, t3, t4, t10, t11, t12;
set @save_optimizer_switch=@@optimizer_switch;
create table t0 (a int); create table t0 (a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1(a int, b int); create table t1(a int, b int);
...@@ -326,7 +330,8 @@ INSERT INTO WORKS VALUES ('E3','P2',20); ...@@ -326,7 +330,8 @@ INSERT INTO WORKS VALUES ('E3','P2',20);
INSERT INTO WORKS VALUES ('E4','P2',20); INSERT INTO WORKS VALUES ('E4','P2',20);
INSERT INTO WORKS VALUES ('E4','P4',40); INSERT INTO WORKS VALUES ('E4','P4',40);
INSERT INTO WORKS VALUES ('E4','P5',80); INSERT INTO WORKS VALUES ('E4','P5',80);
set optimizer_switch='default,materialization=off'; set optimizer_switch=@save_optimizer_switch;
set optimizer_switch='materialization=off';
explain SELECT EMPNUM, EMPNAME explain SELECT EMPNUM, EMPNAME
FROM STAFF FROM STAFF
WHERE EMPNUM IN WHERE EMPNUM IN
...@@ -348,7 +353,7 @@ E1 Alice ...@@ -348,7 +353,7 @@ E1 Alice
E2 Betty E2 Betty
E3 Carmen E3 Carmen
E4 Don E4 Don
set optimizer_switch='default'; set optimizer_switch=@save_optimizer_switch;
drop table STAFF,WORKS,PROJ; drop table STAFF,WORKS,PROJ;
# End of bug#45191 # End of bug#45191
# #
...@@ -454,7 +459,7 @@ COUNT(*) ...@@ -454,7 +459,7 @@ COUNT(*)
drop table t1, t2; drop table t1, t2;
drop view v1; drop view v1;
drop procedure p1; drop procedure p1;
set SESSION optimizer_switch='default'; set SESSION optimizer_switch=@save_optimizer_switch;
# End of bug#46744 # End of bug#46744
Bug#46797 "Crash in fix_semijoin_strategies_for_picked_join_order Bug#46797 "Crash in fix_semijoin_strategies_for_picked_join_order
...@@ -605,7 +610,7 @@ v1field ...@@ -605,7 +610,7 @@ v1field
DROP TABLE t1,t2; DROP TABLE t1,t2;
DROP VIEW v1,v2; DROP VIEW v1,v2;
DROP PROCEDURE p1; DROP PROCEDURE p1;
set SESSION optimizer_switch='default'; set SESSION optimizer_switch=@save_optimizer_switch;
# End of BUG#48834 # End of BUG#48834
Bug#49097 subquery with view generates wrong result with Bug#49097 subquery with view generates wrong result with
...@@ -1079,6 +1084,7 @@ DROP TABLE t1; ...@@ -1079,6 +1084,7 @@ DROP TABLE t1;
DROP TABLE t2; DROP TABLE t2;
DROP TABLE t3; DROP TABLE t3;
# End of Bug#48623 # End of Bug#48623
set @@optimizer_switch=@save_optimizer_switch;
# #
# BUG#49129: Wrong result with IN-subquery with join_cache_level=6 and firstmatch=off # BUG#49129: Wrong result with IN-subquery with join_cache_level=6 and firstmatch=off
# #
...@@ -1114,3 +1120,4 @@ set join_cache_level=default; ...@@ -1114,3 +1120,4 @@ set join_cache_level=default;
show variables like 'join_cache_level'; show variables like 'join_cache_level';
Variable_name Value Variable_name Value
join_cache_level 1 join_cache_level 1
set @@optimizer_switch=@save_optimizer_switch_jcl6;
This diff is collapsed.
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
# Run join_nested.test with BKA enabled # Run join_nested.test with BKA enabled
# #
set @save_optimizer_switch_jcl6=@@optimizer_switch;
set @@optimizer_switch='semijoin_with_cache=on';
set @@optimizer_switch='outer_join_with_cache=on';
set join_cache_level=6; set join_cache_level=6;
show variables like 'join_cache_level'; show variables like 'join_cache_level';
...@@ -93,3 +97,5 @@ DROP TABLE t5,t6,t7,t8; ...@@ -93,3 +97,5 @@ DROP TABLE t5,t6,t7,t8;
set join_cache_level=default; set join_cache_level=default;
show variables like 'join_cache_level'; show variables like 'join_cache_level';
set @@optimizer_switch=@save_optimizer_switch_jcl6;
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
# Run join_outer.test with BKA enabled # Run join_outer.test with BKA enabled
# #
set @save_optimizer_switch_jcl6=@@optimizer_switch;
set @@optimizer_switch='semijoin_with_cache=on';
set @@optimizer_switch='outer_join_with_cache=on';
set join_cache_level=6; set join_cache_level=6;
show variables like 'join_cache_level'; show variables like 'join_cache_level';
...@@ -9,3 +13,5 @@ show variables like 'join_cache_level'; ...@@ -9,3 +13,5 @@ show variables like 'join_cache_level';
set join_cache_level=default; set join_cache_level=default;
show variables like 'join_cache_level'; show variables like 'join_cache_level';
set @@optimizer_switch=@save_optimizer_switch_jcl6;
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
# Run select.test with BKA enabled # Run select.test with BKA enabled
# #
set @save_optimizer_switch_jcl6=@@optimizer_switch;
set @@optimizer_switch='semijoin_with_cache=on';
set @@optimizer_switch='outer_join_with_cache=on';
set join_cache_level=6; set join_cache_level=6;
show variables like 'join_cache_level'; show variables like 'join_cache_level';
...@@ -9,3 +13,5 @@ show variables like 'join_cache_level'; ...@@ -9,3 +13,5 @@ show variables like 'join_cache_level';
set join_cache_level=default; set join_cache_level=default;
show variables like 'join_cache_level'; show variables like 'join_cache_level';
set @@optimizer_switch=@save_optimizer_switch_jcl6;
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
drop table if exists t0, t1, t2, t3, t4, t5, t11, t12, t21, t22; drop table if exists t0, t1, t2, t3, t4, t5, t11, t12, t21, t22;
--enable_warnings --enable_warnings
set @save_optimizer_switch=@@optimizer_switch;
# #
# 1. Subquery with GROUP/HAVING # 1. Subquery with GROUP/HAVING
# #
...@@ -888,7 +890,7 @@ set @@optimizer_switch='firstmatch=off'; ...@@ -888,7 +890,7 @@ set @@optimizer_switch='firstmatch=off';
explain explain
select (select max(Y.a) from t1 Y where a in (select a from t1 Z) and a < X.a) as subq from t1 X; select (select max(Y.a) from t1 Y where a in (select a from t1 Z) and a < X.a) as subq from t1 X;
select (select max(Y.a) from t1 Y where a in (select a from t1 Z) and a < X.a) as subq from t1 X; select (select max(Y.a) from t1 Y where a in (select a from t1 Z) and a < X.a) as subq from t1 X;
set @@optimizer_switch=default; set @@optimizer_switch=@save_optimizer_switch;
drop table t1; drop table t1;
...@@ -906,7 +908,7 @@ select * from t1 where 2 in (select a from t0); ...@@ -906,7 +908,7 @@ select * from t1 where 2 in (select a from t0);
set @@optimizer_switch='default,materialization=off'; set @@optimizer_switch='default,materialization=off';
explain select * from t1 where 2 in (select a from t0); explain select * from t1 where 2 in (select a from t0);
select * from t1 where 2 in (select a from t0); select * from t1 where 2 in (select a from t0);
set @@optimizer_switch=default; set @@optimizer_switch=@save_optimizer_switch;
# #
...@@ -952,7 +954,7 @@ flush status; ...@@ -952,7 +954,7 @@ flush status;
select count(*) from t0 A, t0 B, t0 C, t0 D where D.a in (select a from t1 E); select count(*) from t0 A, t0 B, t0 C, t0 D where D.a in (select a from t1 E);
show status like 'Created_tmp_disk_tables'; show status like 'Created_tmp_disk_tables';
set @save_max_heap_table_size=@@max_heap_table_size; set @save_max_heap_table_size=@@max_heap_table_size;
set @@optimizer_switch=default; set @@optimizer_switch=@save_optimizer_switch;
drop table t0, t1; drop table t0, t1;
# #
...@@ -990,7 +992,7 @@ create table t1 (a decimal); ...@@ -990,7 +992,7 @@ create table t1 (a decimal);
insert into t1 values (1),(2); insert into t1 values (1),(2);
explain select * from t1 where a in (select a from t1); explain select * from t1 where a in (select a from t1);
drop table t1; drop table t1;
set @@optimizer_switch=default; set @@optimizer_switch=@save_optimizer_switch;
# #
# SJ-Materialization-scan for non-first table # SJ-Materialization-scan for non-first table
...@@ -1051,7 +1053,7 @@ set @save_optimizer_search_depth=@@optimizer_search_depth; ...@@ -1051,7 +1053,7 @@ set @save_optimizer_search_depth=@@optimizer_search_depth;
set @@optimizer_search_depth=63; set @@optimizer_search_depth=63;
explain select * from t1 where (a,b) in (select a,b from t2); explain select * from t1 where (a,b) in (select a,b from t2);
set @@optimizer_search_depth=@save_optimizer_search_depth; set @@optimizer_search_depth=@save_optimizer_search_depth;
set @@optimizer_switch=default; set @@optimizer_switch=@save_optimizer_switch;
drop table t0, t1, t2; drop table t0, t1, t2;
...@@ -1181,3 +1183,6 @@ ALTER TABLE t2 CHANGE COLUMN f1 my_column INT; ...@@ -1181,3 +1183,6 @@ ALTER TABLE t2 CHANGE COLUMN f1 my_column INT;
CALL p1; CALL p1;
DROP PROCEDURE p1; DROP PROCEDURE p1;
DROP TABLE t1, t2; DROP TABLE t1, t2;
# The following command must be the last one the file
set @@optimizer_switch=@save_optimizer_switch;
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
# Run subselect3.test with BKA enabled # Run subselect3.test with BKA enabled
# #
set @save_optimizer_switch=@@optimizer_switch;
set @@optimizer_switch='semijoin_with_cache=on';
set @@optimizer_switch='outer_join_with_cache=on';
set join_cache_level=6; set join_cache_level=6;
show variables like 'join_cache_level'; show variables like 'join_cache_level';
...@@ -9,3 +13,5 @@ show variables like 'join_cache_level'; ...@@ -9,3 +13,5 @@ show variables like 'join_cache_level';
set join_cache_level=default; set join_cache_level=default;
show variables like 'join_cache_level'; show variables like 'join_cache_level';
set @@optimizer_switch=@save_optimizer_switch;
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
drop table if exists t0, t1, t2, t3, t4, t10, t11, t12; drop table if exists t0, t1, t2, t3, t4, t10, t11, t12;
--enable_warnings --enable_warnings
set @save_optimizer_switch=@@optimizer_switch;
# #
# 1. Subqueries that are converted into semi-joins # 1. Subqueries that are converted into semi-joins
# #
...@@ -224,7 +226,8 @@ INSERT INTO WORKS VALUES ('E4','P2',20); ...@@ -224,7 +226,8 @@ INSERT INTO WORKS VALUES ('E4','P2',20);
INSERT INTO WORKS VALUES ('E4','P4',40); INSERT INTO WORKS VALUES ('E4','P4',40);
INSERT INTO WORKS VALUES ('E4','P5',80); INSERT INTO WORKS VALUES ('E4','P5',80);
set optimizer_switch='default,materialization=off'; set optimizer_switch=@save_optimizer_switch;
set optimizer_switch='materialization=off';
explain SELECT EMPNUM, EMPNAME explain SELECT EMPNUM, EMPNAME
FROM STAFF FROM STAFF
...@@ -240,7 +243,7 @@ WHERE EMPNUM IN ...@@ -240,7 +243,7 @@ WHERE EMPNUM IN
WHERE PNUM IN WHERE PNUM IN
(SELECT PNUM FROM PROJ)); (SELECT PNUM FROM PROJ));
set optimizer_switch='default'; set optimizer_switch=@save_optimizer_switch;
drop table STAFF,WORKS,PROJ; drop table STAFF,WORKS,PROJ;
...@@ -359,7 +362,7 @@ drop table t1, t2; ...@@ -359,7 +362,7 @@ drop table t1, t2;
drop view v1; drop view v1;
drop procedure p1; drop procedure p1;
set SESSION optimizer_switch='default'; set SESSION optimizer_switch=@save_optimizer_switch;
--echo # End of bug#46744 --echo # End of bug#46744
...@@ -526,7 +529,7 @@ DROP TABLE t1,t2; ...@@ -526,7 +529,7 @@ DROP TABLE t1,t2;
DROP VIEW v1,v2; DROP VIEW v1,v2;
DROP PROCEDURE p1; DROP PROCEDURE p1;
set SESSION optimizer_switch='default'; set SESSION optimizer_switch=@save_optimizer_switch;
--echo # End of BUG#48834 --echo # End of BUG#48834
...@@ -935,3 +938,6 @@ DROP TABLE t2; ...@@ -935,3 +938,6 @@ DROP TABLE t2;
DROP TABLE t3; DROP TABLE t3;
--echo # End of Bug#48623 --echo # End of Bug#48623
# The following command must be the last one the file
set @@optimizer_switch=@save_optimizer_switch;
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
# Run subselect_sj2.test with BKA enabled # Run subselect_sj2.test with BKA enabled
# #
set @save_optimizer_switch_jcl6=@@optimizer_switch;
set @@optimizer_switch='semijoin_with_cache=on';
set @@optimizer_switch='outer_join_with_cache=on';
set join_cache_level=6; set join_cache_level=6;
show variables like 'join_cache_level'; show variables like 'join_cache_level';
...@@ -9,3 +13,6 @@ show variables like 'join_cache_level'; ...@@ -9,3 +13,6 @@ show variables like 'join_cache_level';
set join_cache_level=default; set join_cache_level=default;
show variables like 'join_cache_level'; show variables like 'join_cache_level';
set @@optimizer_switch=@save_optimizer_switch_jcl6;
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
# Run subselect_sj.test with BKA enabled # Run subselect_sj.test with BKA enabled
# #
set @save_optimizer_switch_jcl6=@@optimizer_switch;
set @@optimizer_switch='semijoin_with_cache=on';
set @@optimizer_switch='outer_join_with_cache=on';
set join_cache_level=6; set join_cache_level=6;
show variables like 'join_cache_level'; show variables like 'join_cache_level';
...@@ -37,3 +41,5 @@ drop table t0, t1, t2; ...@@ -37,3 +41,5 @@ drop table t0, t1, t2;
set join_cache_level=default; set join_cache_level=default;
show variables like 'join_cache_level'; show variables like 'join_cache_level';
set @@optimizer_switch=@save_optimizer_switch_jcl6;
...@@ -1211,6 +1211,8 @@ typedef struct st_range_seq_if ...@@ -1211,6 +1211,8 @@ typedef struct st_range_seq_if
bool (*skip_index_tuple) (range_seq_t seq, char *range_info); bool (*skip_index_tuple) (range_seq_t seq, char *range_info);
} RANGE_SEQ_IF; } RANGE_SEQ_IF;
typedef bool (*SKIP_INDEX_TUPLE_FUNC) (range_seq_t seq, char *range_info);
class COST_VECT class COST_VECT
{ {
public: public:
......
...@@ -571,12 +571,17 @@ protected: ...@@ -571,12 +571,17 @@ protected:
#define OPTIMIZER_SWITCH_PARTIAL_MATCH_ROWID_MERGE 512 #define OPTIMIZER_SWITCH_PARTIAL_MATCH_ROWID_MERGE 512
#define OPTIMIZER_SWITCH_PARTIAL_MATCH_TABLE_SCAN 1024 #define OPTIMIZER_SWITCH_PARTIAL_MATCH_TABLE_SCAN 1024
#define OPTIMIZER_SWITCH_SUBQUERY_CACHE (1<<11) #define OPTIMIZER_SWITCH_SUBQUERY_CACHE (1<<11)
#define OPTIMIZER_SWITCH_OUTER_JOIN_WITH_CACHE (1<<12)
#define OPTIMIZER_SWITCH_SEMIJOIN_WITH_CACHE (1<<13)
#define OPTIMIZER_SWITCH_JOIN_CACHE_INCREMENTAL (1<<14)
#define OPTIMIZER_SWITCH_JOIN_CACHE_HASHED (1<<15)
#define OPTIMIZER_SWITCH_JOIN_CACHE_BKA (1<<16)
#ifdef DBUG_OFF #ifdef DBUG_OFF
# define OPTIMIZER_SWITCH_LAST (1<<12) # define OPTIMIZER_SWITCH_LAST (1<<17)
#else #else
# define OPTIMIZER_SWITCH_TABLE_ELIMINATION (1<<12) # define OPTIMIZER_SWITCH_TABLE_ELIMINATION (1<<17)
# define OPTIMIZER_SWITCH_LAST (1<<13) # define OPTIMIZER_SWITCH_LAST (1<<18)
#endif #endif
#ifdef DBUG_OFF #ifdef DBUG_OFF
...@@ -592,7 +597,10 @@ protected: ...@@ -592,7 +597,10 @@ protected:
OPTIMIZER_SWITCH_SEMIJOIN | \ OPTIMIZER_SWITCH_SEMIJOIN | \
OPTIMIZER_SWITCH_PARTIAL_MATCH_ROWID_MERGE|\ OPTIMIZER_SWITCH_PARTIAL_MATCH_ROWID_MERGE|\
OPTIMIZER_SWITCH_PARTIAL_MATCH_TABLE_SCAN|\ OPTIMIZER_SWITCH_PARTIAL_MATCH_TABLE_SCAN|\
OPTIMIZER_SWITCH_SUBQUERY_CACHE) OPTIMIZER_SWITCH_SUBQUERY_CACHE | \
OPTIMIZER_SWITCH_JOIN_CACHE_INCREMENTAL | \
OPTIMIZER_SWITCH_JOIN_CACHE_HASHED | \
OPTIMIZER_SWITCH_JOIN_CACHE_BKA)
#else #else
# define OPTIMIZER_SWITCH_DEFAULT (OPTIMIZER_SWITCH_INDEX_MERGE | \ # define OPTIMIZER_SWITCH_DEFAULT (OPTIMIZER_SWITCH_INDEX_MERGE | \
OPTIMIZER_SWITCH_INDEX_MERGE_UNION | \ OPTIMIZER_SWITCH_INDEX_MERGE_UNION | \
...@@ -606,7 +614,10 @@ protected: ...@@ -606,7 +614,10 @@ protected:
OPTIMIZER_SWITCH_SEMIJOIN | \ OPTIMIZER_SWITCH_SEMIJOIN | \
OPTIMIZER_SWITCH_PARTIAL_MATCH_ROWID_MERGE|\ OPTIMIZER_SWITCH_PARTIAL_MATCH_ROWID_MERGE|\
OPTIMIZER_SWITCH_PARTIAL_MATCH_TABLE_SCAN|\ OPTIMIZER_SWITCH_PARTIAL_MATCH_TABLE_SCAN|\
OPTIMIZER_SWITCH_SUBQUERY_CACHE) OPTIMIZER_SWITCH_SUBQUERY_CACHE | \
OPTIMIZER_SWITCH_JOIN_CACHE_INCREMENTAL | \
OPTIMIZER_SWITCH_JOIN_CACHE_HASHED | \
OPTIMIZER_SWITCH_JOIN_CACHE_BKA)
#endif #endif
/* /*
......
...@@ -308,6 +308,11 @@ static const char *optimizer_switch_names[]= ...@@ -308,6 +308,11 @@ static const char *optimizer_switch_names[]=
"partial_match_rowid_merge", "partial_match_rowid_merge",
"partial_match_table_scan", "partial_match_table_scan",
"subquery_cache", "subquery_cache",
"outer_join_with_cache",
"semijoin_with_cache",
"join_cache_incremental",
"join_cache_hashed",
"join_cache_bka",
#ifndef DBUG_OFF #ifndef DBUG_OFF
"table_elimination", "table_elimination",
#endif #endif
...@@ -329,6 +334,11 @@ static const unsigned int optimizer_switch_names_len[]= ...@@ -329,6 +334,11 @@ static const unsigned int optimizer_switch_names_len[]=
sizeof("partial_match_rowid_merge") - 1, sizeof("partial_match_rowid_merge") - 1,
sizeof("partial_match_table_scan") - 1, sizeof("partial_match_table_scan") - 1,
sizeof("subquery_cache") - 1, sizeof("subquery_cache") - 1,
sizeof("outer_join_with_cache") - 1,
sizeof("semijoin_with_cache") - 1,
sizeof("join_cache_incremental") - 1,
sizeof("join_cache_hashed") - 1,
sizeof("join_cache_bka") - 1,
#ifndef DBUG_OFF #ifndef DBUG_OFF
sizeof("table_elimination") - 1, sizeof("table_elimination") - 1,
#endif #endif
...@@ -415,7 +425,10 @@ static const char *optimizer_switch_str="index_merge=on,index_merge_union=on," ...@@ -415,7 +425,10 @@ static const char *optimizer_switch_str="index_merge=on,index_merge_union=on,"
"semijoin=on," "semijoin=on,"
"partial_match_rowid_merge=on," "partial_match_rowid_merge=on,"
"partial_match_table_scan=on," "partial_match_table_scan=on,"
"subquery_cache=on" "subquery_cache=on,"
"join_cache_incremental=on,"
"join_cache_hashed=on,"
"join_cache_bka=on"
#ifndef DBUG_OFF #ifndef DBUG_OFF
",table_elimination=on"; ",table_elimination=on";
#else #else
...@@ -5865,7 +5878,8 @@ enum options_mysqld ...@@ -5865,7 +5878,8 @@ enum options_mysqld
OPT_DELAYED_INSERT_LIMIT, OPT_DELAYED_QUEUE_SIZE, OPT_DELAYED_INSERT_LIMIT, OPT_DELAYED_QUEUE_SIZE,
OPT_FLUSH_TIME, OPT_FT_MIN_WORD_LEN, OPT_FT_BOOLEAN_SYNTAX, OPT_FLUSH_TIME, OPT_FT_MIN_WORD_LEN, OPT_FT_BOOLEAN_SYNTAX,
OPT_FT_MAX_WORD_LEN, OPT_FT_QUERY_EXPANSION_LIMIT, OPT_FT_STOPWORD_FILE, OPT_FT_MAX_WORD_LEN, OPT_FT_QUERY_EXPANSION_LIMIT, OPT_FT_STOPWORD_FILE,
OPT_INTERACTIVE_TIMEOUT, OPT_JOIN_BUFF_SIZE, OPT_JOIN_CACHE_LEVEL, OPT_INTERACTIVE_TIMEOUT, OPT_JOIN_BUFF_SIZE,
OPT_JOIN_BUFF_SPACE_LIMIT, OPT_JOIN_CACHE_LEVEL,
OPT_KEY_BUFFER_SIZE, OPT_KEY_CACHE_BLOCK_SIZE, OPT_KEY_BUFFER_SIZE, OPT_KEY_CACHE_BLOCK_SIZE,
OPT_KEY_CACHE_DIVISION_LIMIT, OPT_KEY_CACHE_AGE_THRESHOLD, OPT_KEY_CACHE_DIVISION_LIMIT, OPT_KEY_CACHE_AGE_THRESHOLD,
OPT_KEY_CACHE_PARTITIONS, OPT_KEY_CACHE_PARTITIONS,
...@@ -6958,11 +6972,17 @@ log and this option does nothing anymore.", ...@@ -6958,11 +6972,17 @@ log and this option does nothing anymore.",
(uchar**) &max_system_variables.net_interactive_timeout, 0, (uchar**) &max_system_variables.net_interactive_timeout, 0,
GET_ULONG, REQUIRED_ARG, NET_WAIT_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0}, GET_ULONG, REQUIRED_ARG, NET_WAIT_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0},
{"join_buffer_size", OPT_JOIN_BUFF_SIZE, {"join_buffer_size", OPT_JOIN_BUFF_SIZE,
"The size of the buffer that is used for full joins.", "The size of the buffer that is used for joins.",
(uchar**) &global_system_variables.join_buff_size, (uchar**) &global_system_variables.join_buff_size,
(uchar**) &max_system_variables.join_buff_size, 0, GET_ULONG, (uchar**) &max_system_variables.join_buff_size, 0, GET_ULONG,
REQUIRED_ARG, 128*1024L, 128+MALLOC_OVERHEAD, (longlong) ULONG_MAX, REQUIRED_ARG, 128*1024L, 128+MALLOC_OVERHEAD, (longlong) ULONG_MAX,
MALLOC_OVERHEAD, 128, 0}, MALLOC_OVERHEAD, 128, 0},
{"join_buffer_space_limit", OPT_JOIN_BUFF_SPACE_LIMIT,
"The limit of the space for all join buffers used by a query.",
(uchar**) &global_system_variables.join_buff_space_limit,
(uchar**) &max_system_variables.join_buff_space_limit, 0, GET_ULL,
REQUIRED_ARG, 8*128*1024L, 2048+MALLOC_OVERHEAD, (longlong) ULONGLONG_MAX,
MALLOC_OVERHEAD, 2048, 0},
{"join_cache_level", OPT_JOIN_CACHE_LEVEL, {"join_cache_level", OPT_JOIN_CACHE_LEVEL,
"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", "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",
(uchar**) &global_system_variables.join_cache_level, (uchar**) &global_system_variables.join_cache_level,
...@@ -7235,7 +7255,8 @@ The minimum value for this variable is 4096.", ...@@ -7235,7 +7255,8 @@ The minimum value for this variable is 4096.",
"index_merge_union, index_merge_sort_union, index_merge_intersection, " "index_merge_union, index_merge_sort_union, index_merge_intersection, "
"index_condition_pushdown, firstmatch, loosescan, materialization, " "index_condition_pushdown, firstmatch, loosescan, materialization, "
"semijoin, partial_match_rowid_merge, partial_match_table_scan, " "semijoin, partial_match_rowid_merge, partial_match_table_scan, "
"subquery_cache" "subquery_cache, outer_join_with_cache, semijoin_with_cache, "
"join_cache_incremental, join_cache_hashed, join_cache_bka"
#ifndef DBUG_OFF #ifndef DBUG_OFF
", table_elimination" ", table_elimination"
#endif #endif
......
...@@ -199,7 +199,8 @@ public: ...@@ -199,7 +199,8 @@ public:
double records= rows2double(s->table->file->stats.records); double records= rows2double(s->table->file->stats.records);
/* The cost is entire index scan cost (divided by 2) */ /* The cost is entire index scan cost (divided by 2) */
double read_time= s->table->file->keyread_read_time(key, 1, records); double read_time=
s->table->file->keyread_read_time(key, 1, (ha_rows) records);
/* /*
Now find out how many different keys we will get (for now we Now find out how many different keys we will get (for now we
......
...@@ -319,6 +319,9 @@ static sys_var_thd_ulong sys_interactive_timeout(&vars, "interactive_timeout", ...@@ -319,6 +319,9 @@ static sys_var_thd_ulong sys_interactive_timeout(&vars, "interactive_timeout",
&SV::net_interactive_timeout); &SV::net_interactive_timeout);
static sys_var_thd_ulong sys_join_buffer_size(&vars, "join_buffer_size", static sys_var_thd_ulong sys_join_buffer_size(&vars, "join_buffer_size",
&SV::join_buff_size); &SV::join_buff_size);
static sys_var_thd_ulonglong sys_join_buffer_space_limit(&vars,
"join_buffer_space_limit",
&SV::join_buff_space_limit);
static sys_var_thd_ulong sys_join_cache_level(&vars, "join_cache_level", static sys_var_thd_ulong sys_join_cache_level(&vars, "join_cache_level",
&SV::join_cache_level); &SV::join_cache_level);
static sys_var_key_buffer_size sys_key_buffer_size(&vars, "key_buffer_size"); static sys_var_key_buffer_size sys_key_buffer_size(&vars, "key_buffer_size");
...@@ -4045,7 +4048,7 @@ bool ...@@ -4045,7 +4048,7 @@ bool
sys_var_thd_optimizer_switch:: sys_var_thd_optimizer_switch::
symbolic_mode_representation(THD *thd, ulonglong val, LEX_STRING *rep) symbolic_mode_representation(THD *thd, ulonglong val, LEX_STRING *rep)
{ {
char buff[STRING_BUFFER_USUAL_SIZE*8]; char buff[STRING_BUFFER_USUAL_SIZE*18];
String tmp(buff, sizeof(buff), &my_charset_latin1); String tmp(buff, sizeof(buff), &my_charset_latin1);
int i; int i;
ulonglong bit; ulonglong bit;
......
...@@ -376,6 +376,7 @@ struct system_variables ...@@ -376,6 +376,7 @@ struct system_variables
ulonglong max_heap_table_size; ulonglong max_heap_table_size;
ulonglong tmp_table_size; ulonglong tmp_table_size;
ulonglong long_query_time; ulonglong long_query_time;
ulonglong join_buff_space_limit;
ha_rows select_limit; ha_rows select_limit;
ha_rows max_join_size; ha_rows max_join_size;
ulong auto_increment_increment, auto_increment_offset; ulong auto_increment_increment, auto_increment_offset;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -6458,6 +6458,7 @@ ha_innobase::info( ...@@ -6458,6 +6458,7 @@ ha_innobase::info(
} }
stats.check_time = 0; stats.check_time = 0;
stats.mrr_length_per_rec= ref_length + 8; // 8 = max(sizeof(void *));
if (stats.records == 0) { if (stats.records == 0) {
stats.mean_rec_length = 0; stats.mean_rec_length = 0;
......
...@@ -7534,6 +7534,8 @@ ha_innobase::info( ...@@ -7534,6 +7534,8 @@ ha_innobase::info(
} }
stats.check_time = 0; stats.check_time = 0;
stats.mrr_length_per_rec= ref_length + 8; // 8 = max(sizeof(void *));
if (stats.records == 0) { if (stats.records == 0) {
stats.mean_rec_length = 0; stats.mean_rec_length = 0;
......
...@@ -7639,6 +7639,7 @@ ha_innobase::info( ...@@ -7639,6 +7639,7 @@ ha_innobase::info(
} }
stats.check_time = 0; stats.check_time = 0;
stats.mrr_length_per_rec= ref_length + 8; // 8 = max(sizeof(void *));
if (stats.records == 0) { if (stats.records == 0) {
stats.mean_rec_length = 0; stats.mean_rec_length = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment