diff options
author | Sergei Petrunia <psergey@askmonty.org> | 2021-03-19 18:12:26 +0300 |
---|---|---|
committer | Sergei Petrunia <psergey@askmonty.org> | 2021-03-19 18:12:26 +0300 |
commit | b3c470a3c7e8bb497bca5bc9fca4cf52cfc9e88e (patch) | |
tree | c48a0e899c5e0c3deca6ce7091d29a2600182eef /mysql-test/main/opt_trace.result | |
parent | b9a45ba40fbf251f5635ecebad6ea7414be39d41 (diff) | |
download | mariadb-git-b3c470a3c7e8bb497bca5bc9fca4cf52cfc9e88e.tar.gz |
MDEV-23646: Optimizer trace: optimize_cond() should show ON expression processing
Print the build_equal_items() step for ON expression processing
Diffstat (limited to 'mysql-test/main/opt_trace.result')
-rw-r--r-- | mysql-test/main/opt_trace.result | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/mysql-test/main/opt_trace.result b/mysql-test/main/opt_trace.result index 192f9040c35..4d00e32c4a7 100644 --- a/mysql-test/main/opt_trace.result +++ b/mysql-test/main/opt_trace.result @@ -2320,6 +2320,13 @@ select t1.a from t1 left join t2 on t1.a=t2.a { "select_id": 1, "steps": [ { + "build_equal_items": { + "condition": "ON expr", + "attached_to": "t2", + "resulting_condition": "multiple equal(t1.a, t2.a)" + } + }, + { "table_dependencies": [ { "table": "t1", @@ -2450,6 +2457,13 @@ explain select * from t1 left join t2 on t2.a=t1.a { "select_id": 1, "steps": [ { + "build_equal_items": { + "condition": "ON expr", + "attached_to": "t2", + "resulting_condition": "multiple equal(t2.a, t1.a)" + } + }, + { "table_dependencies": [ { "table": "t1", @@ -2622,6 +2636,13 @@ explain select t1.a from t1 left join (t2 join t3 on t2.b=t3.b) on t2.a=t1.a and "select_id": 1, "steps": [ { + "build_equal_items": { + "condition": "ON expr", + "attached_to": "t3", + "resulting_condition": "multiple equal(t2.a, t1.a, t3.a) and multiple equal(t2.b, t3.b)" + } + }, + { "table_dependencies": [ { "table": "t1", @@ -9007,5 +9028,46 @@ json_detailed(json_extract(trace, '$**.substitute_best_equal')) "resulting_condition": "t2.a = t1.a and t3.a = t1.a and t1.a + t1.a < 1000" } ] +# The next query is test for: +# MDEV-23646: Optimizer trace: optimize_cond() should show ON expression processing +select +json_detailed(json_extract(trace, '$**.condition_processing')) +from +information_schema.optimizer_trace; +json_detailed(json_extract(trace, '$**.condition_processing')) +[ + + { + "condition": "WHERE", + "original_condition": "t1.b > 5555", + "steps": + [ + + { + "build_equal_items": + { + "condition": "ON expr", + "attached_to": "t3", + "resulting_condition": "t3.a + t2.a < 1000 and multiple equal(t2.a, t1.a, t3.a)" + } + }, + + { + "transformation": "equality_propagation", + "resulting_condition": "t1.b > 5555" + }, + + { + "transformation": "constant_propagation", + "resulting_condition": "t1.b > 5555" + }, + + { + "transformation": "trivial_condition_removal", + "resulting_condition": "t1.b > 5555" + } + ] + } +] drop table t1,t2,t3; set optimizer_trace='enabled=off'; |