Skip to content

Commit 357df02

Browse files
author
Olav Sandstaa
committed
WL#5692 Enable Disk-Sweep Multi-Range Read optimizer feature.
This patch contains the first part of this worklog. It changes the default value of the optimizer switch "mrr_cost_based" from being off as default to be on by default. To ensure that both non-cost-based MRR and cost-based MRR get tested the following changes are done to our MRR tests: 1. to ensure MRR code get tested: the optimizer_switch flag mrr_cost_based is set to off in test that specifically is named to test MRR (these have _mrr or _all in their name). 2. to ensure cost-based MRR get tested: New versions of existing MRR tests are added. These have added _mrr_cost in their test name.
1 parent fd0f7aa commit 357df02

File tree

105 files changed

+6154
-112
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+6154
-112
lines changed

mysql-test/r/ctype_binary.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2760,11 +2760,11 @@ KEY(date_column));
27602760
INSERT INTO t1 VALUES (1,'2010-09-01'),(2,'2010-10-01');
27612761
EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
27622762
id select_type table type possible_keys key key_len ref rows Extra
2763-
1 SIMPLE t1 range date_column date_column 4 NULL 1 Using index condition; Using MRR
2763+
1 SIMPLE t1 range date_column date_column 4 NULL 1 Using index condition
27642764
ALTER TABLE t1 MODIFY date_column DATETIME DEFAULT NULL;
27652765
EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
27662766
id select_type table type possible_keys key key_len ref rows Extra
2767-
1 SIMPLE t1 range date_column date_column 9 NULL 1 Using index condition; Using MRR
2767+
1 SIMPLE t1 range date_column date_column 9 NULL 1 Using index condition
27682768
DROP TABLE t1;
27692769
#
27702770
# Bug#52159 returning time type from function and empty left join causes debug assertion

mysql-test/r/ctype_collate.result

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -608,19 +608,19 @@ id select_type table type possible_keys key key_len ref rows Extra
608608
1 SIMPLE t1 ALL s2 NULL NULL NULL 10 Using where
609609
EXPLAIN SELECT * FROM t1 WHERE s1 BETWEEN 'a' AND 'b' COLLATE latin1_german1_ci;
610610
id select_type table type possible_keys key key_len ref rows Extra
611-
1 SIMPLE t1 range s1 s1 11 NULL 2 Using index condition; Using MRR
611+
1 SIMPLE t1 range s1 s1 11 NULL 2 Using index condition
612612
EXPLAIN SELECT * FROM t1 WHERE s2 BETWEEN 'a' AND 'b' COLLATE latin1_german1_ci;
613613
id select_type table type possible_keys key key_len ref rows Extra
614614
1 SIMPLE t1 ALL s2 NULL NULL NULL 10 Using where
615615
EXPLAIN SELECT * FROM t1 WHERE s1 IN ('a','b' COLLATE latin1_german1_ci);
616616
id select_type table type possible_keys key key_len ref rows Extra
617-
1 SIMPLE t1 range s1 s1 11 NULL 2 Using index condition; Using MRR
617+
1 SIMPLE t1 range s1 s1 11 NULL 2 Using index condition
618618
EXPLAIN SELECT * FROM t1 WHERE s2 IN ('a','b' COLLATE latin1_german1_ci);
619619
id select_type table type possible_keys key key_len ref rows Extra
620620
1 SIMPLE t1 ALL s2 NULL NULL NULL 10 Using where
621621
EXPLAIN SELECT * FROM t1 WHERE s1 LIKE 'a' COLLATE latin1_german1_ci;
622622
id select_type table type possible_keys key key_len ref rows Extra
623-
1 SIMPLE t1 range s1 s1 11 NULL 1 Using index condition; Using MRR
623+
1 SIMPLE t1 range s1 s1 11 NULL 1 Using index condition
624624
EXPLAIN SELECT * FROM t1 WHERE s2 LIKE 'a' COLLATE latin1_german1_ci;
625625
id select_type table type possible_keys key key_len ref rows Extra
626626
1 SIMPLE t1 ALL s2 NULL NULL NULL 10 Using where

mysql-test/r/ctype_cp1251.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2842,11 +2842,11 @@ KEY(date_column));
28422842
INSERT INTO t1 VALUES (1,'2010-09-01'),(2,'2010-10-01');
28432843
EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
28442844
id select_type table type possible_keys key key_len ref rows Extra
2845-
1 SIMPLE t1 range date_column date_column 4 NULL 1 Using index condition; Using MRR
2845+
1 SIMPLE t1 range date_column date_column 4 NULL 1 Using index condition
28462846
ALTER TABLE t1 MODIFY date_column DATETIME DEFAULT NULL;
28472847
EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
28482848
id select_type table type possible_keys key key_len ref rows Extra
2849-
1 SIMPLE t1 range date_column date_column 9 NULL 1 Using index condition; Using MRR
2849+
1 SIMPLE t1 range date_column date_column 9 NULL 1 Using index condition
28502850
DROP TABLE t1;
28512851
#
28522852
# Bug#52159 returning time type from function and empty left join causes debug assertion

mysql-test/r/ctype_latin1.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3170,11 +3170,11 @@ KEY(date_column));
31703170
INSERT INTO t1 VALUES (1,'2010-09-01'),(2,'2010-10-01');
31713171
EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
31723172
id select_type table type possible_keys key key_len ref rows Extra
3173-
1 SIMPLE t1 range date_column date_column 4 NULL 1 Using index condition; Using MRR
3173+
1 SIMPLE t1 range date_column date_column 4 NULL 1 Using index condition
31743174
ALTER TABLE t1 MODIFY date_column DATETIME DEFAULT NULL;
31753175
EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
31763176
id select_type table type possible_keys key key_len ref rows Extra
3177-
1 SIMPLE t1 range date_column date_column 9 NULL 1 Using index condition; Using MRR
3177+
1 SIMPLE t1 range date_column date_column 9 NULL 1 Using index condition
31783178
DROP TABLE t1;
31793179
#
31803180
# Bug#52159 returning time type from function and empty left join causes debug assertion

mysql-test/r/ctype_utf8.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4951,11 +4951,11 @@ KEY(date_column));
49514951
INSERT INTO t1 VALUES (1,'2010-09-01'),(2,'2010-10-01');
49524952
EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
49534953
id select_type table type possible_keys key key_len ref rows Extra
4954-
1 SIMPLE t1 range date_column date_column 4 NULL 1 Using index condition; Using MRR
4954+
1 SIMPLE t1 range date_column date_column 4 NULL 1 Using index condition
49554955
ALTER TABLE t1 MODIFY date_column DATETIME DEFAULT NULL;
49564956
EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
49574957
id select_type table type possible_keys key key_len ref rows Extra
4958-
1 SIMPLE t1 range date_column date_column 9 NULL 1 Using index condition; Using MRR
4958+
1 SIMPLE t1 range date_column date_column 9 NULL 1 Using index condition
49594959
DROP TABLE t1;
49604960
#
49614961
# Bug#52159 returning time type from function and empty left join causes debug assertion

mysql-test/r/func_in_all.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
set optimizer_switch='semijoin=on,materialization=on,firstmatch=on,loosescan=on,index_condition_pushdown=on,mrr=on';
1+
set optimizer_switch='semijoin=on,materialization=on,firstmatch=on,loosescan=on,index_condition_pushdown=on,mrr=on,mrr_cost_based=off';
22
drop table if exists t1, t2;
33
select 1 in (1,2,3);
44
1 in (1,2,3)

mysql-test/r/func_in_icp_mrr.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
set optimizer_switch='index_condition_pushdown=on,mrr=on';
1+
set optimizer_switch='index_condition_pushdown=on,mrr=on,mrr_cost_based=off';
22
drop table if exists t1, t2;
33
select 1 in (1,2,3);
44
1 in (1,2,3)

mysql-test/r/func_in_mrr.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
set optimizer_switch='mrr=on';
1+
set optimizer_switch='mrr=on,mrr_cost_based=off';
22
drop table if exists t1, t2;
33
select 1 in (1,2,3);
44
1 in (1,2,3)

0 commit comments

Comments
 (0)