Commit d6db6df9 authored by Varun Gupta's avatar Varun Gupta

MDEV-17903: New optimizer defaults: change optimize_join_buffer_size to be ON

optimize_join_buffer_size is switched ON.
parent f2f0c200
...@@ -143,7 +143,7 @@ ANALYZE ...@@ -143,7 +143,7 @@ ANALYZE
"attached_condition": "tbl2.b < 60" "attached_condition": "tbl2.b < 60"
}, },
"buffer_type": "flat", "buffer_type": "flat",
"buffer_size": "256Kb", "buffer_size": "1Kb",
"join_type": "BNL", "join_type": "BNL",
"r_filtered": 100 "r_filtered": 100
} }
...@@ -181,7 +181,7 @@ ANALYZE ...@@ -181,7 +181,7 @@ ANALYZE
"attached_condition": "tbl2.b < 60" "attached_condition": "tbl2.b < 60"
}, },
"buffer_type": "flat", "buffer_type": "flat",
"buffer_size": "256Kb", "buffer_size": "1Kb",
"join_type": "BNL", "join_type": "BNL",
"attached_condition": "tbl1.c > tbl2.c", "attached_condition": "tbl1.c > tbl2.c",
"r_filtered": 15.833 "r_filtered": 15.833
...@@ -625,7 +625,7 @@ ANALYZE ...@@ -625,7 +625,7 @@ ANALYZE
"attached_condition": "<in_optimizer>(t2.b,t2.b in (subquery#2))" "attached_condition": "<in_optimizer>(t2.b,t2.b in (subquery#2))"
}, },
"buffer_type": "flat", "buffer_type": "flat",
"buffer_size": "256Kb", "buffer_size": "65",
"join_type": "BNL", "join_type": "BNL",
"attached_condition": "<in_optimizer>(t2.b,t2.b in (subquery#2))", "attached_condition": "<in_optimizer>(t2.b,t2.b in (subquery#2))",
"r_filtered": null "r_filtered": null
...@@ -711,7 +711,7 @@ ANALYZE ...@@ -711,7 +711,7 @@ ANALYZE
"attached_condition": "t3.f3 in (1,2)" "attached_condition": "t3.f3 in (1,2)"
}, },
"buffer_type": "flat", "buffer_type": "flat",
"buffer_size": "256Kb", "buffer_size": "1",
"join_type": "BNL", "join_type": "BNL",
"r_filtered": null "r_filtered": null
}, },
...@@ -742,7 +742,7 @@ ANALYZE ...@@ -742,7 +742,7 @@ ANALYZE
"r_filtered": null "r_filtered": null
}, },
"buffer_type": "flat", "buffer_type": "flat",
"buffer_size": "256Kb", "buffer_size": "65",
"join_type": "BNL", "join_type": "BNL",
"attached_condition": "t2.f2 = t3.f3", "attached_condition": "t2.f2 = t3.f3",
"r_filtered": null "r_filtered": null
......
...@@ -426,7 +426,7 @@ ANALYZE ...@@ -426,7 +426,7 @@ ANALYZE
"r_filtered": 100 "r_filtered": 100
}, },
"buffer_type": "flat", "buffer_type": "flat",
"buffer_size": "256Kb", "buffer_size": "65",
"join_type": "BNL", "join_type": "BNL",
"attached_condition": "t3.a = t0.a", "attached_condition": "t3.a = t0.a",
"r_filtered": 10 "r_filtered": 10
...@@ -497,7 +497,7 @@ ANALYZE ...@@ -497,7 +497,7 @@ ANALYZE
"r_filtered": 100 "r_filtered": 100
}, },
"buffer_type": "flat", "buffer_type": "flat",
"buffer_size": "256Kb", "buffer_size": "119",
"join_type": "BNL", "join_type": "BNL",
"attached_condition": "t5.a = t6.a", "attached_condition": "t5.a = t6.a",
"r_filtered": 21.429 "r_filtered": 21.429
...@@ -537,7 +537,7 @@ EXPLAIN ...@@ -537,7 +537,7 @@ EXPLAIN
"filtered": 100 "filtered": 100
}, },
"buffer_type": "flat", "buffer_type": "flat",
"buffer_size": "256Kb", "buffer_size": "119",
"join_type": "BNL", "join_type": "BNL",
"attached_condition": "t5.a = t6.a" "attached_condition": "t5.a = t6.a"
} }
......
...@@ -1409,7 +1409,7 @@ EXPLAIN ...@@ -1409,7 +1409,7 @@ EXPLAIN
"filtered": 100 "filtered": 100
}, },
"buffer_type": "flat", "buffer_type": "flat",
"buffer_size": "256Kb", "buffer_size": "686",
"join_type": "BNL", "join_type": "BNL",
"attached_condition": "prev_gen.father = folks.`id` or prev_gen.mother = folks.`id`" "attached_condition": "prev_gen.father = folks.`id` or prev_gen.mother = folks.`id`"
} }
...@@ -1636,16 +1636,16 @@ i div 4 - (i % 4) = ps.i div 4 - (ps.i % 4) ...@@ -1636,16 +1636,16 @@ i div 4 - (i % 4) = ps.i div 4 - (ps.i % 4)
) )
SELECT regexp_replace(board,concat('(',REPEAT('.', 4),')'),'\\1\n') n_queens FROM solutions WHERE n_queens = 4; SELECT regexp_replace(board,concat('(',REPEAT('.', 4),')'),'\\1\n') n_queens FROM solutions WHERE n_queens = 4;
n_queens n_queens
-*--
---*
*---
--*-
--*- --*-
*--- *---
---* ---*
-*-- -*--
-*--
---*
*---
--*-
# #
# MDEV-10883: execution of prepared statement from SELECT # MDEV-10883: execution of prepared statement from SELECT
# with recursive CTE that renames columns # with recursive CTE that renames columns
......
...@@ -255,7 +255,7 @@ EXPLAIN ...@@ -255,7 +255,7 @@ EXPLAIN
"filtered": 100 "filtered": 100
}, },
"buffer_type": "flat", "buffer_type": "flat",
"buffer_size": "256Kb", "buffer_size": "119",
"join_type": "BNL" "join_type": "BNL"
} }
} }
...@@ -278,7 +278,7 @@ EXPLAIN ...@@ -278,7 +278,7 @@ EXPLAIN
"filtered": 100 "filtered": 100
}, },
"buffer_type": "flat", "buffer_type": "flat",
"buffer_size": "256Kb", "buffer_size": "119",
"join_type": "BNL" "join_type": "BNL"
} }
} }
...@@ -324,7 +324,7 @@ ANALYZE ...@@ -324,7 +324,7 @@ ANALYZE
"r_filtered": 100 "r_filtered": 100
}, },
"buffer_type": "flat", "buffer_type": "flat",
"buffer_size": "256Kb", "buffer_size": "119",
"join_type": "BNL", "join_type": "BNL",
"r_filtered": 100 "r_filtered": 100
} }
...@@ -358,7 +358,7 @@ ANALYZE ...@@ -358,7 +358,7 @@ ANALYZE
"r_filtered": 100 "r_filtered": 100
}, },
"buffer_type": "flat", "buffer_type": "flat",
"buffer_size": "256Kb", "buffer_size": "119",
"join_type": "BNL", "join_type": "BNL",
"r_filtered": 100 "r_filtered": 100
} }
...@@ -420,7 +420,7 @@ ANALYZE ...@@ -420,7 +420,7 @@ ANALYZE
"r_filtered": 100 "r_filtered": 100
}, },
"buffer_type": "flat", "buffer_type": "flat",
"buffer_size": "256Kb", "buffer_size": "119",
"join_type": "BNL", "join_type": "BNL",
"r_filtered": 100 "r_filtered": 100
} }
...@@ -454,7 +454,7 @@ ANALYZE ...@@ -454,7 +454,7 @@ ANALYZE
"r_filtered": 100 "r_filtered": 100
}, },
"buffer_type": "flat", "buffer_type": "flat",
"buffer_size": "256Kb", "buffer_size": "119",
"join_type": "BNL", "join_type": "BNL",
"r_filtered": 100 "r_filtered": 100
} }
......
...@@ -373,7 +373,7 @@ EXPLAIN ...@@ -373,7 +373,7 @@ EXPLAIN
"attached_condition": "tbl2.b < 5" "attached_condition": "tbl2.b < 5"
}, },
"buffer_type": "flat", "buffer_type": "flat",
"buffer_size": "256Kb", "buffer_size": "1Kb",
"join_type": "BNL", "join_type": "BNL",
"attached_condition": "tbl2.a = tbl1.a" "attached_condition": "tbl2.a = tbl1.a"
} }
...@@ -640,7 +640,7 @@ EXPLAIN ...@@ -640,7 +640,7 @@ EXPLAIN
"filtered": 100 "filtered": 100
}, },
"buffer_type": "flat", "buffer_type": "flat",
"buffer_size": "256Kb", "buffer_size": "1Kb",
"join_type": "BNL" "join_type": "BNL"
} }
} }
...@@ -674,7 +674,7 @@ EXPLAIN ...@@ -674,7 +674,7 @@ EXPLAIN
"first_match": "t2" "first_match": "t2"
}, },
"buffer_type": "flat", "buffer_type": "flat",
"buffer_size": "256Kb", "buffer_size": "141",
"join_type": "BNL", "join_type": "BNL",
"attached_condition": "t1.b = t2.b and t1.a = t2.a" "attached_condition": "t1.b = t2.b and t1.a = t2.a"
} }
...@@ -711,7 +711,7 @@ EXPLAIN ...@@ -711,7 +711,7 @@ EXPLAIN
"filtered": 100 "filtered": 100
}, },
"buffer_type": "flat", "buffer_type": "flat",
"buffer_size": "256Kb", "buffer_size": "206",
"join_type": "BNL", "join_type": "BNL",
"attached_condition": "t1.b = t2.b and t1.a = t2.a" "attached_condition": "t1.b = t2.b and t1.a = t2.a"
} }
...@@ -825,7 +825,7 @@ EXPLAIN ...@@ -825,7 +825,7 @@ EXPLAIN
"filtered": 100 "filtered": 100
}, },
"buffer_type": "flat", "buffer_type": "flat",
"buffer_size": "256Kb", "buffer_size": "65",
"join_type": "BNL", "join_type": "BNL",
"attached_condition": "t2.b <> outer_t1.a" "attached_condition": "t2.b <> outer_t1.a"
} }
...@@ -876,7 +876,7 @@ EXPLAIN ...@@ -876,7 +876,7 @@ EXPLAIN
"filtered": 100 "filtered": 100
}, },
"buffer_type": "flat", "buffer_type": "flat",
"buffer_size": "256Kb", "buffer_size": "1Kb",
"join_type": "BNL", "join_type": "BNL",
"attached_condition": "tbl2.b = tbl1.b" "attached_condition": "tbl2.b = tbl1.b"
} }
...@@ -1492,7 +1492,7 @@ EXPLAIN ...@@ -1492,7 +1492,7 @@ EXPLAIN
"index_condition_bka": "t4.b + 1 <= t3.b + 1" "index_condition_bka": "t4.b + 1 <= t3.b + 1"
}, },
"buffer_type": "flat", "buffer_type": "flat",
"buffer_size": "256Kb", "buffer_size": "400",
"join_type": "BKA", "join_type": "BKA",
"mrr_type": "Rowid-ordered scan" "mrr_type": "Rowid-ordered scan"
} }
...@@ -1535,7 +1535,7 @@ ANALYZE ...@@ -1535,7 +1535,7 @@ ANALYZE
"index_condition_bka": "t4.b + 1 <= t3.b + 1" "index_condition_bka": "t4.b + 1 <= t3.b + 1"
}, },
"buffer_type": "flat", "buffer_type": "flat",
"buffer_size": "256Kb", "buffer_size": "400",
"join_type": "BKA", "join_type": "BKA",
"mrr_type": "Rowid-ordered scan", "mrr_type": "Rowid-ordered scan",
"r_filtered": 100 "r_filtered": 100
......
...@@ -605,7 +605,7 @@ EXPLAIN ...@@ -605,7 +605,7 @@ EXPLAIN
"filtered": 100 "filtered": 100
}, },
"buffer_type": "flat", "buffer_type": "flat",
"buffer_size": "256Kb", "buffer_size": "119",
"join_type": "BNL", "join_type": "BNL",
"attached_condition": "t1.c = t3.y and t1.a is not null" "attached_condition": "t1.c = t3.y and t1.a is not null"
}, },
...@@ -1505,7 +1505,7 @@ EXPLAIN ...@@ -1505,7 +1505,7 @@ EXPLAIN
"filtered": 100 "filtered": 100
}, },
"buffer_type": "flat", "buffer_type": "flat",
"buffer_size": "256Kb", "buffer_size": "119",
"join_type": "BNL", "join_type": "BNL",
"attached_condition": "t1.a = t3.x and t1.c is not null" "attached_condition": "t1.a = t3.x and t1.c is not null"
}, },
......
...@@ -316,7 +316,7 @@ EXPLAIN ...@@ -316,7 +316,7 @@ EXPLAIN
"filtered": 100 "filtered": 100
}, },
"buffer_type": "flat", "buffer_type": "flat",
"buffer_size": "256Kb", "buffer_size": "65",
"join_type": "BNL" "join_type": "BNL"
} }
} }
...@@ -380,7 +380,7 @@ ANALYZE ...@@ -380,7 +380,7 @@ ANALYZE
"r_filtered": 100 "r_filtered": 100
}, },
"buffer_type": "flat", "buffer_type": "flat",
"buffer_size": "256Kb", "buffer_size": "65",
"join_type": "BNL", "join_type": "BNL",
"r_filtered": 100 "r_filtered": 100
} }
...@@ -459,7 +459,7 @@ ANALYZE ...@@ -459,7 +459,7 @@ ANALYZE
"r_filtered": 100 "r_filtered": 100
}, },
"buffer_type": "flat", "buffer_type": "flat",
"buffer_size": "256Kb", "buffer_size": "65",
"join_type": "BNL", "join_type": "BNL",
"r_filtered": 100 "r_filtered": 100
} }
......
--- main/myisam_mrr.result 2019-02-04 13:47:00.000000000 +0530
+++ main/myisam_mrr,64bit.reject 2019-02-04 13:50:01.000000000 +0530
@@ -617,8 +617,8 @@
show status like 'handler_mrr%';
Variable_name Value
Handler_mrr_init 1
-Handler_mrr_key_refills 0
-Handler_mrr_rowid_refills 0
+Handler_mrr_key_refills 1
+Handler_mrr_rowid_refills 1
set join_buffer_size=10;
explain select sum(t1.b) from t0,t1 where t0.a=t1.a;
id select_type table type possible_keys key key_len ref rows Extra
...@@ -12,6 +12,7 @@ set @mrr_buffer_size_save= @@mrr_buffer_size; ...@@ -12,6 +12,7 @@ set @mrr_buffer_size_save= @@mrr_buffer_size;
set mrr_buffer_size=79; set mrr_buffer_size=79;
-- source include/mrr_tests.inc -- source include/mrr_tests.inc
-- source include/word_size.inc
set @@mrr_buffer_size= @mrr_buffer_size_save; set @@mrr_buffer_size= @mrr_buffer_size_save;
......
...@@ -1571,7 +1571,7 @@ old-style-user-limits FALSE ...@@ -1571,7 +1571,7 @@ old-style-user-limits FALSE
optimizer-prune-level 1 optimizer-prune-level 1
optimizer-search-depth 62 optimizer-search-depth 62
optimizer-selectivity-sampling-limit 100 optimizer-selectivity-sampling-limit 100
optimizer-switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on optimizer-switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on
optimizer-trace optimizer-trace
optimizer-trace-max-mem-size 1048576 optimizer-trace-max-mem-size 1048576
optimizer-use-condition-selectivity 4 optimizer-use-condition-selectivity 4
......
...@@ -2743,10 +2743,10 @@ ENUM_VALUE_LIST NULL ...@@ -2743,10 +2743,10 @@ ENUM_VALUE_LIST NULL
READ_ONLY NO READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_SWITCH VARIABLE_NAME OPTIMIZER_SWITCH
SESSION_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on SESSION_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on
GLOBAL_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on GLOBAL_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on
GLOBAL_VALUE_ORIGIN COMPILE-TIME GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on DEFAULT_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on
VARIABLE_SCOPE SESSION VARIABLE_SCOPE SESSION
VARIABLE_TYPE FLAGSET VARIABLE_TYPE FLAGSET
VARIABLE_COMMENT Fine-tune the optimizer behavior VARIABLE_COMMENT Fine-tune the optimizer behavior
......
...@@ -2967,10 +2967,10 @@ ENUM_VALUE_LIST NULL ...@@ -2967,10 +2967,10 @@ ENUM_VALUE_LIST NULL
READ_ONLY NO READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_SWITCH VARIABLE_NAME OPTIMIZER_SWITCH
SESSION_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on SESSION_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on
GLOBAL_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on GLOBAL_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on
GLOBAL_VALUE_ORIGIN COMPILE-TIME GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on DEFAULT_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on
VARIABLE_SCOPE SESSION VARIABLE_SCOPE SESSION
VARIABLE_TYPE FLAGSET VARIABLE_TYPE FLAGSET
VARIABLE_COMMENT Fine-tune the optimizer behavior VARIABLE_COMMENT Fine-tune the optimizer behavior
......
...@@ -263,7 +263,8 @@ ...@@ -263,7 +263,8 @@
OPTIMIZER_SWITCH_COND_PUSHDOWN_FOR_DERIVED | \ OPTIMIZER_SWITCH_COND_PUSHDOWN_FOR_DERIVED | \
OPTIMIZER_SWITCH_SPLIT_MATERIALIZED | \ OPTIMIZER_SWITCH_SPLIT_MATERIALIZED | \
OPTIMIZER_SWITCH_COND_PUSHDOWN_FOR_SUBQUERY |\ OPTIMIZER_SWITCH_COND_PUSHDOWN_FOR_SUBQUERY |\
OPTIMIZER_SWITCH_USE_ROWID_FILTER) OPTIMIZER_SWITCH_USE_ROWID_FILTER |\
OPTIMIZER_SWITCH_OPTIMIZE_JOIN_BUFFER_SIZE)
/* /*
Replication uses 8 bytes to store SQL_MODE in the binary log. The day you Replication uses 8 bytes to store SQL_MODE in the binary log. The day you
......
drop table if exists t; drop table if exists t;
select @@optimizer_switch; select @@optimizer_switch;
@@optimizer_switch @@optimizer_switch
index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on
create table t (id int not null, x int not null, y int not null, primary key(id), key(x)) engine=innodb; create table t (id int not null, x int not null, y int not null, primary key(id), key(x)) engine=innodb;
insert into t values (0,0,0),(1,1,1),(2,2,2),(3,2,3),(4,2,4); insert into t values (0,0,0),(1,1,1),(2,2,2),(3,2,3),(4,2,4);
explain select x,id from t force index (x) where x=0 and id=0; explain select x,id from t force index (x) where x=0 and id=0;
......
drop table if exists t; drop table if exists t;
select @@optimizer_switch; select @@optimizer_switch;
@@optimizer_switch @@optimizer_switch
index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on
create table t (id int not null, x int not null, y int not null, primary key(id), key(x)) engine=tokudb; create table t (id int not null, x int not null, y int not null, primary key(id), key(x)) engine=tokudb;
insert into t values (0,0,0),(1,1,1),(2,2,2),(3,2,3),(4,2,4); insert into t values (0,0,0),(1,1,1),(2,2,2),(3,2,3),(4,2,4);
explain select x,id from t force index (x) where x=0 and id=0; explain select x,id from t force index (x) where x=0 and id=0;
......
drop table if exists t; drop table if exists t;
select @@optimizer_switch; select @@optimizer_switch;
@@optimizer_switch @@optimizer_switch
index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on
create table t (a int not null, b int not null, c int not null, d int not null, primary key(a,b), key(c,a)) engine=innodb; create table t (a int not null, b int not null, c int not null, d int not null, primary key(a,b), key(c,a)) engine=innodb;
insert into t values (0,0,0,0),(0,1,0,1); insert into t values (0,0,0,0),(0,1,0,1);
explain select c,a,b from t where c=0 and a=0 and b=1; explain select c,a,b from t where c=0 and a=0 and b=1;
......
drop table if exists t; drop table if exists t;
select @@optimizer_switch; select @@optimizer_switch;
@@optimizer_switch @@optimizer_switch
index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on
create table t (a int not null, b int not null, c int not null, d int not null, primary key(a,b), key(c,a)) engine=tokudb; create table t (a int not null, b int not null, c int not null, d int not null, primary key(a,b), key(c,a)) engine=tokudb;
insert into t values (0,0,0,0),(0,1,0,1); insert into t values (0,0,0,0),(0,1,0,1);
explain select c,a,b from t where c=0 and a=0 and b=1; explain select c,a,b from t where c=0 and a=0 and b=1;
......
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