diff --git a/mysql-test/include/optimizer_trace_no_costs.inc b/mysql-test/include/optimizer_trace_no_costs.inc new file mode 100644 index 00000000000..540ce06e685 --- /dev/null +++ b/mysql-test/include/optimizer_trace_no_costs.inc @@ -0,0 +1,11 @@ +# Mask the cost value from any field that looks like +# "xxx_cost" : double_number +# Print the +# "xxx_cost" : "REPLACED" +# instead +--replace_regex /(_cost": )[0-9.e-]+/\1"REPLACED"/ +#--replace_regex /(_cost": )[0-9.e-]+/"REPLACED"/ +#--replace_regex /[0-9]+/BBB/ + +#--replace_regex /("r_engine_stats":) {[^}]*}/\1 REPLACED/ + diff --git a/mysql-test/main/order_by_limit_join.result b/mysql-test/main/order_by_limit_join.result index 3f48aa3f65f..2b9fb6b97da 100644 --- a/mysql-test/main/order_by_limit_join.result +++ b/mysql-test/main/order_by_limit_join.result @@ -108,9 +108,9 @@ JS } ], "can_skip_filesort": true, - "full_join_cost": 46064.98442, + "full_join_cost": "REPLACED", "risk_ratio": 10, - "shortcut_join_cost": 97.28224614, + "shortcut_join_cost": "REPLACED", "shortcut_cost_with_risk": 972.8224614, "use_shortcut_cost": true } @@ -160,9 +160,9 @@ JS "test_if_skip_sort_order_early": [], "can_skip_filesort": false, - "full_join_cost": 46064.98442, + "full_join_cost": "REPLACED", "risk_ratio": 10, - "shortcut_join_cost": 2097.281246, + "shortcut_join_cost": "REPLACED", "shortcut_cost_with_risk": 20972.81246, "use_shortcut_cost": true } @@ -244,9 +244,9 @@ JS } ], "can_skip_filesort": false, - "full_join_cost": 46064.98442, + "full_join_cost": "REPLACED", "risk_ratio": 10, - "shortcut_join_cost": 24059.12698, + "shortcut_join_cost": "REPLACED", "shortcut_cost_with_risk": 240591.2698, "use_shortcut_cost": false } @@ -363,9 +363,9 @@ JS } ], "can_skip_filesort": true, - "full_join_cost": 47079.71684, + "full_join_cost": "REPLACED", "risk_ratio": 10, - "shortcut_join_cost": 98.29697856, + "shortcut_join_cost": "REPLACED", "shortcut_cost_with_risk": 982.9697856, "use_shortcut_cost": true } @@ -448,9 +448,9 @@ JS } ], "can_skip_filesort": true, - "full_join_cost": 46064.98442, + "full_join_cost": "REPLACED", "risk_ratio": 10, - "shortcut_join_cost": 97.28224614, + "shortcut_join_cost": "REPLACED", "shortcut_cost_with_risk": 972.8224614, "use_shortcut_cost": true } diff --git a/mysql-test/main/order_by_limit_join.test b/mysql-test/main/order_by_limit_join.test index da05cdc30c3..3b60581871c 100644 --- a/mysql-test/main/order_by_limit_join.test +++ b/mysql-test/main/order_by_limit_join.test @@ -68,6 +68,7 @@ set optimizer_join_limit_pref_ratio=10; eval $query; set @trace=(select trace from information_schema.optimizer_trace); +--source include/optimizer_trace_no_costs.inc select json_detailed(json_extract(@trace, '$**.join_limit_shortcut_choice')) as JS; --echo # @@ -95,6 +96,7 @@ set optimizer_join_limit_pref_ratio=10; eval $query; set @trace=(select trace from information_schema.optimizer_trace); +--source include/optimizer_trace_no_costs.inc select json_detailed(json_extract(@trace, '$**.join_limit_shortcut_choice')) as JS; --echo # @@ -121,6 +123,7 @@ set optimizer_join_limit_pref_ratio=10; eval $query; set @trace=(select trace from information_schema.optimizer_trace); +--source include/optimizer_trace_no_costs.inc select json_detailed(json_extract(@trace, '$**.join_limit_shortcut_choice')) as JS; --echo # @@ -140,6 +143,7 @@ limit 10; set @trace=(select trace from information_schema.optimizer_trace); --echo # This will show nothing as limit shortcut code figures that --echo # it's not possible to use t1 to construct shortcuts: +--source include/optimizer_trace_no_costs.inc select json_detailed(json_extract(@trace, '$**.join_limit_shortcut_choice')) as JS; --echo # @@ -169,6 +173,7 @@ set optimizer_join_limit_pref_ratio=10; eval $query; set @trace=(select trace from information_schema.optimizer_trace); +--source include/optimizer_trace_no_costs.inc select json_detailed(json_extract(@trace, '$**.join_limit_shortcut_choice')) as JS; --echo # @@ -197,6 +202,7 @@ set optimizer_join_limit_pref_ratio=10; eval $query; set @trace=(select trace from information_schema.optimizer_trace); +--source include/optimizer_trace_no_costs.inc select json_detailed(json_extract(@trace, '$**.join_limit_shortcut_choice')) as JS;