diff options
author | Sergei Petrunia <sergey@mariadb.com> | 2022-11-19 21:00:23 +0300 |
---|---|---|
committer | Sergei Petrunia <sergey@mariadb.com> | 2022-11-21 17:35:46 +0300 |
commit | 05e28a8cbf6c2c5f52a7ccc245f34b6b9dd1550d (patch) | |
tree | 105b17cb05dc4102d76bb713851a486ad9998bfc | |
parent | b6c754e04c6b0dda9efc74703f30431cdf7f0f10 (diff) | |
download | mariadb-git-05e28a8cbf6c2c5f52a7ccc245f34b6b9dd1550d.tar.gz |
MDEV-30032: EXPLAIN FORMAT=JSON output: print costs
Basic printout for join and table execution costs.
91 files changed, 3436 insertions, 14 deletions
diff --git a/mysql-test/include/analyze-format.inc b/mysql-test/include/analyze-format.inc index f9579555d7b..e65450ff001 100644 --- a/mysql-test/include/analyze-format.inc +++ b/mysql-test/include/analyze-format.inc @@ -1,3 +1,3 @@ # The time on ANALYSE FORMAT=JSON is rather variable ---replace_regex /("(r_total_time_ms|r_table_time_ms|r_other_time_ms|r_buffer_size|r_filling_time_ms|r_query_time_in_progress_ms|r_unpack_time_ms)": )[^, \n]*/\1"REPLACED"/ +--replace_regex /("(r_total_time_ms|r_table_time_ms|r_other_time_ms|r_buffer_size|r_filling_time_ms|r_query_time_in_progress_ms|r_unpack_time_ms|cost)": )[^, \n]*/\1"REPLACED"/ diff --git a/mysql-test/include/analyze-no-filtered.inc b/mysql-test/include/analyze-no-filtered.inc new file mode 100644 index 00000000000..eb1663167b2 --- /dev/null +++ b/mysql-test/include/analyze-no-filtered.inc @@ -0,0 +1,2 @@ +--replace_regex /("(filtered|r_total_time_ms|r_table_time_ms|r_other_time_ms|r_buffer_size|r_filling_time_ms|r_query_time_in_progress_ms|r_unpack_time_ms|cost)": )[^, \n]*/\1"REPLACED"/ + diff --git a/mysql-test/include/explain-no-costs-filtered.inc b/mysql-test/include/explain-no-costs-filtered.inc new file mode 100644 index 00000000000..585d8b3fdcc --- /dev/null +++ b/mysql-test/include/explain-no-costs-filtered.inc @@ -0,0 +1 @@ +--replace_regex /("(cost|filtered)": )[^, \n]*/\1"REPLACED"/ diff --git a/mysql-test/include/explain-no-costs.inc b/mysql-test/include/explain-no-costs.inc new file mode 100644 index 00000000000..f2f362b8cbe --- /dev/null +++ b/mysql-test/include/explain-no-costs.inc @@ -0,0 +1 @@ +--replace_regex /("(cost)": )[^, \n]*/\1"COST_REPLACED"/ diff --git a/mysql-test/main/analyze_format_json.result b/mysql-test/main/analyze_format_json.result index 99ac42d34bd..32e6ae0a67e 100644 --- a/mysql-test/main/analyze_format_json.result +++ b/mysql-test/main/analyze_format_json.result @@ -10,6 +10,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -20,6 +21,7 @@ ANALYZE "r_loops": 1, "rows": 10, "r_rows": 10, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -46,6 +48,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -56,6 +59,7 @@ ANALYZE "r_loops": 1, "rows": 10, "r_rows": 10, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -75,6 +79,7 @@ ANALYZE "r_loops": 0, "rows": 1, "r_rows": null, + "cost": "REPLACED", "filtered": 100, "r_filtered": null } @@ -96,6 +101,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -106,6 +112,7 @@ ANALYZE "r_loops": 1, "rows": 10, "r_rows": 10, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -125,6 +132,7 @@ ANALYZE "r_loops": 10, "rows": 1, "r_rows": 1, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -149,6 +157,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -159,6 +168,7 @@ ANALYZE "r_loops": 1, "rows": 100, "r_rows": 100, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -174,6 +184,7 @@ ANALYZE "r_loops": 1, "rows": 100, "r_rows": 100, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -199,6 +210,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -209,6 +221,7 @@ ANALYZE "r_loops": 1, "rows": 100, "r_rows": 100, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -224,6 +237,7 @@ ANALYZE "r_loops": 1, "rows": 100, "r_rows": 100, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -258,6 +272,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -268,6 +283,7 @@ ANALYZE "r_loops": 1, "rows": 10, "r_rows": 10, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -287,6 +303,7 @@ ANALYZE "r_loops": 10, "rows": 2, "r_rows": 0.2, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -319,6 +336,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -329,6 +347,7 @@ ANALYZE "r_loops": 1, "rows": 10, "r_rows": 10, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -383,6 +402,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -397,6 +417,7 @@ ANALYZE "r_loops": 1, "rows": 10, "r_rows": 10, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -463,6 +484,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -473,6 +495,7 @@ ANALYZE "r_loops": 1, "rows": 5, "r_rows": 5, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -499,6 +522,7 @@ ANALYZE "r_loops": 5, "rows": 1010, "r_rows": 203.8, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -533,6 +557,7 @@ ANALYZE { "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -543,6 +568,7 @@ ANALYZE "r_loops": 1, "rows": 10, "r_rows": 10, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -557,6 +583,7 @@ ANALYZE "query_block": { "select_id": 2, "operation": "UNION", + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -567,6 +594,7 @@ ANALYZE "r_loops": 1, "rows": 10, "r_rows": 10, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -604,6 +632,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "having_condition": "TOP > t2.a", @@ -624,6 +653,7 @@ ANALYZE "r_loops": 1, "rows": 256, "r_rows": 256, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -644,6 +674,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "filesort": { @@ -663,6 +694,7 @@ ANALYZE "r_loops": 1, "rows": 256, "r_rows": 256, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -697,6 +729,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "filesort": { @@ -716,6 +749,7 @@ ANALYZE "r_loops": 1, "rows": 256, "r_rows": 256, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -743,6 +777,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -753,6 +788,7 @@ ANALYZE "r_loops": 1, "rows": 2, "r_rows": 2, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -767,6 +803,7 @@ ANALYZE "r_loops": 1, "rows": 2, "r_rows": 2, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -786,6 +823,7 @@ ANALYZE { "query_block": { "select_id": 2, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -796,6 +834,7 @@ ANALYZE "r_loops": 1, "rows": 2, "r_rows": 2, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -832,6 +871,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "filesort": { @@ -860,6 +900,7 @@ ANALYZE "r_loops": 1, "rows": 2, "r_rows": 2, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -874,6 +915,7 @@ ANALYZE "r_loops": 1, "rows": 2, "r_rows": 2, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -895,6 +937,7 @@ ANALYZE "r_loops": 0, "query_block": { "select_id": 2, + "cost": "REPLACED", "nested_loop": [ { "table": { @@ -903,6 +946,7 @@ ANALYZE "r_loops": 0, "rows": 2, "r_rows": null, + "cost": "REPLACED", "filtered": 100, "r_filtered": null } @@ -915,6 +959,7 @@ ANALYZE "r_loops": 0, "rows": 2, "r_rows": null, + "cost": "REPLACED", "filtered": 100, "r_filtered": null }, @@ -954,6 +999,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -964,6 +1010,7 @@ ANALYZE "r_loops": 1, "rows": 10, "r_rows": 10, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -979,6 +1026,7 @@ ANALYZE "r_loops": 0, "query_block": { "select_id": 2, + "cost": "REPLACED", "nested_loop": [ { "read_sorted_file": { @@ -996,6 +1044,7 @@ ANALYZE "r_loops": 0, "rows": 10, "r_rows": null, + "cost": "REPLACED", "filtered": 100, "r_filtered": null, "attached_condition": "t2.a < t1.a" diff --git a/mysql-test/main/analyze_format_json.test b/mysql-test/main/analyze_format_json.test index 8c0948daac9..84625f125fb 100644 --- a/mysql-test/main/analyze_format_json.test +++ b/mysql-test/main/analyze_format_json.test @@ -154,6 +154,7 @@ drop table t0, t1; --echo # --echo # MDEV-7970: EXPLAIN FORMAT=JSON does not print HAVING +--source include/explain-no-costs.inc --echo # create table t0(a int); insert into t0 values (0),(1),(2),(3); diff --git a/mysql-test/main/analyze_stmt_orderby.result b/mysql-test/main/analyze_stmt_orderby.result index e188f93c160..80c630217ca 100644 --- a/mysql-test/main/analyze_stmt_orderby.result +++ b/mysql-test/main/analyze_stmt_orderby.result @@ -182,6 +182,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t2.b", "temporary_table": { @@ -191,6 +192,7 @@ EXPLAIN "table_name": "t0", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t0.a is not null" } @@ -205,6 +207,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t0.a"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -222,6 +225,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "filesort": { @@ -241,6 +245,7 @@ ANALYZE "r_loops": 1, "rows": 10, "r_rows": 10, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -260,6 +265,7 @@ ANALYZE "r_loops": 10, "rows": 1, "r_rows": 0.4, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -285,6 +291,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "read_sorted_file": { @@ -294,6 +301,7 @@ EXPLAIN "table_name": "t0", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t0.a is not null" } @@ -310,6 +318,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t0.a"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -325,6 +334,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -345,6 +355,7 @@ ANALYZE "r_loops": 1, "rows": 10, "r_rows": 10, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -366,6 +377,7 @@ ANALYZE "r_loops": 10, "rows": 1, "r_rows": 0.4, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -396,6 +408,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "filesort": { @@ -415,6 +428,7 @@ ANALYZE "r_loops": 1, "rows": 1000, "r_rows": 1000, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -459,6 +473,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "duplicate_removal": { @@ -471,6 +486,7 @@ ANALYZE "r_loops": 1, "rows": 10, "r_rows": 10, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -485,6 +501,7 @@ ANALYZE "r_loops": 1, "rows": 10, "r_rows": 10, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -527,6 +544,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "filesort": { @@ -555,6 +573,7 @@ ANALYZE "r_loops": 1, "rows": 5, "r_rows": 5, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -570,6 +589,7 @@ ANALYZE "r_loops": 1, "rows": 7, "r_rows": 7, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -598,6 +618,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "count(distinct t5.b)", "temporary_table": { @@ -610,6 +631,7 @@ EXPLAIN "table_name": "t6", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t6.b > 0 and t6.a <= 5" } @@ -620,6 +642,7 @@ EXPLAIN "table_name": "t5", "access_type": "ALL", "rows": 7, + "cost": "COST_REPLACED", "filtered": 100 }, "buffer_type": "flat", @@ -666,6 +689,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -679,6 +703,7 @@ ANALYZE "r_loops": 1, "rows": 7, "r_rows": 20, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, diff --git a/mysql-test/main/analyze_stmt_orderby.test b/mysql-test/main/analyze_stmt_orderby.test index ecee8040ed5..519cae45a97 100644 --- a/mysql-test/main/analyze_stmt_orderby.test +++ b/mysql-test/main/analyze_stmt_orderby.test @@ -21,6 +21,7 @@ insert into t2 select A.a*1000 + B.a, A.a*1000 + B.a from t0 A, t1 B; --echo # explain update t2 set b=b+1 order by b limit 5; +--source include/explain-no-costs.inc explain format=json update t2 set b=b+1 order by b limit 5; --source include/analyze-format.inc @@ -32,6 +33,7 @@ update t2 set b=b+1 order by b limit 5; --echo # explain update t2 set a=a+1 where a<10; +--source include/explain-no-costs.inc explain format=json update t2 set a=a+1 where a<10; --source include/analyze-format.inc @@ -43,6 +45,7 @@ update t2 set a=a+1 where a<10; --echo # explain delete from t2 order by b limit 5; +--source include/explain-no-costs.inc explain format=json delete from t2 order by b limit 5; --source include/analyze-format.inc @@ -54,6 +57,7 @@ delete from t2 order by b limit 5; --echo # explain select * from t0,t2 where t2.a=t0.a order by t2.b limit 4; +--source include/explain-no-costs.inc explain format=json select * from t0,t2 where t2.a=t0.a order by t2.b limit 4; --source include/analyze-format.inc @@ -66,6 +70,7 @@ select * from t0,t2 where t2.a=t0.a order by t2.b limit 4; --echo # explain select * from t0,t2 where t2.a=t0.a order by t0.a limit 4; +--source include/explain-no-costs.inc explain format=json select * from t0,t2 where t2.a=t0.a order by t0.a limit 4; --source include/analyze-format.inc @@ -143,6 +148,7 @@ select count(distinct t5.b) as sum from t5, t6 where t5.a=t6.a and t6.b > 0 and t5.a <= 5 group by t5.a order by sum limit 1; +--source include/explain-no-costs.inc explain format=json select count(distinct t5.b) as sum from t5, t6 where t5.a=t6.a and t6.b > 0 and t5.a <= 5 diff --git a/mysql-test/main/brackets.result b/mysql-test/main/brackets.result index f87afdc0f47..73917dd635b 100644 --- a/mysql-test/main/brackets.result +++ b/mysql-test/main/brackets.result @@ -261,6 +261,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "read_sorted_file": { @@ -270,6 +271,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -291,6 +293,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "read_sorted_file": { @@ -300,6 +303,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -329,12 +333,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 20" } @@ -346,12 +352,14 @@ EXPLAIN "query_block": { "select_id": 2, "operation": "UNION", + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -383,12 +391,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 20" } @@ -400,12 +410,14 @@ EXPLAIN "query_block": { "select_id": 2, "operation": "UNION", + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -445,6 +457,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "read_sorted_file": { @@ -454,6 +467,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -466,12 +480,14 @@ EXPLAIN "query_block": { "select_id": 2, "operation": "UNION", + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.pk > 4" } diff --git a/mysql-test/main/brackets.test b/mysql-test/main/brackets.test index 9a0c204e271..4300e8a0592 100644 --- a/mysql-test/main/brackets.test +++ b/mysql-test/main/brackets.test @@ -117,24 +117,28 @@ let $q1= select a from t1 order by a desc limit 1; eval $q1; eval explain extended $q1; +--source include/explain-no-costs.inc eval explain format=json $q1; let $q2= (select a from t1 order by a desc) limit 1; eval $q2; eval explain extended $q2; +--source include/explain-no-costs.inc eval explain format=json $q2; let $q1= (select a from t1 where a=20 union select a from t1) order by a desc limit 1; eval $q1; eval explain extended $q1; +--source include/explain-no-costs.inc eval explain format=json $q1; let $q2= ((select a from t1 where a=20 union select a from t1) order by a desc) limit 1; eval $q2; eval explain extended $q2; +--source include/explain-no-costs.inc eval explain format=json $q2; drop table t1; @@ -150,6 +154,7 @@ let $q= ((select * from t1 order by pk) limit 2) union (select * from t1 where pk > 4); eval $q; eval explain extended $q; +--source include/explain-no-costs.inc eval explain format=json $q; drop table t1; diff --git a/mysql-test/main/cte_recursive.result b/mysql-test/main/cte_recursive.result index 3262c662bfc..48420e3baac 100644 --- a/mysql-test/main/cte_recursive.result +++ b/mysql-test/main/cte_recursive.result @@ -1339,12 +1339,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived4>", "access_type": "ALL", "rows": 24, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { @@ -1355,12 +1357,14 @@ EXPLAIN { "query_block": { "select_id": 4, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "folks", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "folks.`name` = 'Me2'" } @@ -1372,12 +1376,14 @@ EXPLAIN "query_block": { "select_id": 6, "operation": "UNION", + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived3>", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "prev_gen.`id` < 345", "materialized": { @@ -1389,12 +1395,14 @@ EXPLAIN { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "folks", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "folks.`name` = 'Me'" } @@ -1406,6 +1414,7 @@ EXPLAIN "query_block": { "select_id": 2, "operation": "UNION", + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -1413,6 +1422,7 @@ EXPLAIN "access_type": "ALL", "possible_keys": ["PRIMARY"], "rows": 12, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -1422,6 +1432,7 @@ EXPLAIN "table_name": "<derived3>", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100 }, "buffer_type": "flat", @@ -1446,12 +1457,14 @@ EXPLAIN "query_block": { "select_id": 5, "operation": "UNION", + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived4>", "access_type": "ALL", "rows": 24, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "ancestors.`id` < 234" } @@ -1499,12 +1512,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived3>", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { @@ -1515,12 +1530,14 @@ EXPLAIN { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "v", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v.`name` = 'Me' and v.father is not null and v.mother is not null" } @@ -1535,6 +1552,7 @@ EXPLAIN "used_key_parts": ["id"], "ref": ["test.v.father"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -1548,6 +1566,7 @@ EXPLAIN "used_key_parts": ["id"], "ref": ["test.v.mother"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1558,12 +1577,14 @@ EXPLAIN "query_block": { "select_id": 2, "operation": "UNION", + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived4>", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "a.father is not null and a.mother is not null" } @@ -1578,6 +1599,7 @@ EXPLAIN "used_key_parts": ["id"], "ref": ["a.father"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -1591,6 +1613,7 @@ EXPLAIN "used_key_parts": ["id"], "ref": ["a.mother"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1824,12 +1847,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived2>", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { @@ -1840,12 +1865,14 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1856,12 +1883,14 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "UNION", + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived2>", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t.a < 1000" } @@ -2460,6 +2489,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -2470,6 +2500,7 @@ ANALYZE "r_loops": 1, "rows": 2, "r_rows": 10, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -2494,6 +2525,7 @@ ANALYZE "query_block": { "select_id": 3, "operation": "UNION", + "cost": "REPLACED", "r_loops": 10, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -2504,6 +2536,7 @@ ANALYZE "r_loops": 10, "rows": 2, "r_rows": 1, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -3869,6 +3902,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -3879,6 +3913,7 @@ ANALYZE "r_loops": 1, "rows": 3, "r_rows": 3, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -3898,6 +3933,7 @@ ANALYZE "r_loops": 3, "rows": 1, "r_rows": 0.333333333, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -3914,6 +3950,7 @@ ANALYZE { "query_block": { "select_id": 3, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -3941,6 +3978,7 @@ ANALYZE "query_block": { "select_id": 4, "operation": "UNION", + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -3952,6 +3990,7 @@ ANALYZE "r_loops": 1, "rows": 14, "r_rows": 14, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -3971,6 +4010,7 @@ ANALYZE "r_loops": 14, "rows": 1, "r_rows": 0.071428571, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -4145,6 +4185,7 @@ ANALYZE "query_block": { "select_id": 4, "operation": "UNION", + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -4155,6 +4196,7 @@ ANALYZE "r_loops": 1, "rows": 4, "r_rows": 4, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -4170,6 +4212,7 @@ ANALYZE { "query_block": { "select_id": 2, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -4180,6 +4223,7 @@ ANALYZE "r_loops": 1, "rows": 4, "r_rows": 4, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -4193,6 +4237,7 @@ ANALYZE "query_block": { "select_id": 3, "operation": "UNION", + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -4203,6 +4248,7 @@ ANALYZE "r_loops": 1, "rows": 4, "r_rows": 4, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -4222,6 +4268,7 @@ ANALYZE "r_loops": 4, "rows": 2, "r_rows": 0.5, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -4300,6 +4347,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -4310,6 +4358,7 @@ ANALYZE "r_loops": 1, "rows": 4, "r_rows": 4, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, diff --git a/mysql-test/main/cte_recursive.test b/mysql-test/main/cte_recursive.test index 069997b0288..ee829ee20eb 100644 --- a/mysql-test/main/cte_recursive.test +++ b/mysql-test/main/cte_recursive.test @@ -1110,6 +1110,7 @@ as ) select ancestors.name, ancestors.dob from ancestors; +--source include/explain-no-costs.inc explain FORMAT=JSON with recursive prev_gen @@ -1139,6 +1140,7 @@ as select ancestors.name, ancestors.dob from ancestors; --echo # +--source include/explain-no-costs.inc explain format=json with recursive ancestor_couples(h_id, h_name, h_dob, h_father, h_mother, @@ -1343,6 +1345,7 @@ drop table folks; create table t1(a int); insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +--source include/explain-no-costs.inc explain format=json with recursive t as (select a from t1 union select a+10 from t where a < 1000) select * from t; diff --git a/mysql-test/main/derived_cond_pushdown.result b/mysql-test/main/derived_cond_pushdown.result index bf3b8591f0f..76e3b45dd3f 100644 --- a/mysql-test/main/derived_cond_pushdown.result +++ b/mysql-test/main/derived_cond_pushdown.result @@ -122,12 +122,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -137,6 +139,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.max_c > 214" }, @@ -147,6 +150,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707 and max_c > 214", "filesort": { "sort_key": "t1.a, t1.b", @@ -157,6 +161,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -208,12 +213,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a is not null" } @@ -228,11 +235,13 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.max_c > 300", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707 and max_c > 300", "filesort": { "sort_key": "t1.a, t1.b", @@ -243,6 +252,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -297,12 +307,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -312,6 +324,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.max_c > 400 or v1.max_c < 135" }, @@ -322,6 +335,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707 and (max_c > 400 or max_c < 135)", "filesort": { "sort_key": "t1.a, t1.b", @@ -332,6 +346,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -375,12 +390,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -390,6 +407,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.max_c > 300 or v1.max_c < 135" }, @@ -400,6 +418,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707 and (max_c > 300 or max_c < 135)", "filesort": { "sort_key": "t1.a, t1.b", @@ -410,6 +429,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -442,12 +462,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -457,6 +479,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a > 6" }, @@ -467,6 +490,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -477,6 +501,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 6" } @@ -519,12 +544,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -534,6 +561,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v2.b > 25" }, @@ -544,6 +572,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -554,6 +583,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 5 and t1.b > 25" } @@ -617,12 +647,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -632,6 +664,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a > 7 or v1.a < 2" }, @@ -642,6 +675,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -652,6 +686,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 7 or t1.a < 2" } @@ -708,12 +743,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -723,6 +760,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v2.a > 7 or v2.a > 5" }, @@ -733,6 +771,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -743,6 +782,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 5 and (t1.a > 7 or t1.a > 5)" } @@ -785,12 +825,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -800,6 +842,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a > 4 or v1.a < 2" }, @@ -810,6 +853,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -820,6 +864,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 4 or t1.a < 2" } @@ -855,12 +900,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -870,6 +917,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a < 2 and v1.max_c > 400" }, @@ -880,6 +928,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707 and max_c > 400", "filesort": { "sort_key": "t1.a, t1.b", @@ -890,6 +939,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 2" } @@ -936,12 +986,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t.a is not null" } @@ -956,11 +1008,13 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v.avg_a > 0.45 and v.b > 10", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "avg_a < 22.333 and avg_a > 0.45", "filesort": { "sort_key": "t1_double.b, t1_double.c", @@ -971,6 +1025,7 @@ EXPLAIN "table_name": "t1_double", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1_double.b > 12.2 and t1_double.b > 10" } @@ -1005,12 +1060,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t.a is not null" } @@ -1025,11 +1082,13 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v.avg_c > 15 and v.b > 1", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "avg_c > 12 and avg_c > 15", "filesort": { "sort_key": "t1_decimal.a, t1_decimal.b", @@ -1040,6 +1099,7 @@ EXPLAIN "table_name": "t1_decimal", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1_decimal.b > 1" } @@ -1097,12 +1157,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -1112,6 +1174,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a > 7 and v1.max_c > 300 or v1.a < 4 and v1.max_c < 500" }, @@ -1122,6 +1185,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707 and (t1.a > 7 and max_c > 300 or t1.a < 4 and max_c < 500)", "filesort": { "sort_key": "t1.a, t1.b", @@ -1132,6 +1196,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 7 or t1.a < 4" } @@ -1196,12 +1261,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -1211,6 +1278,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a < 2 and v1.max_c > 120 or v1.a > 7" }, @@ -1221,6 +1289,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707 and (t1.a < 2 and max_c > 120 or t1.a > 7)", "filesort": { "sort_key": "t1.a, t1.b", @@ -1231,6 +1300,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 2 or t1.a > 7" } @@ -1284,12 +1354,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -1299,6 +1371,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a < 2 and v1.max_c > 120 or v1.a > 7" }, @@ -1309,6 +1382,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707 and (t1.a < 2 and max_c > 120 or t1.a > 7)", "filesort": { "sort_key": "t1.a, t1.b", @@ -1319,6 +1393,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 2 or t1.a > 7" } @@ -1361,12 +1436,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -1376,6 +1453,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a < 2 and v1.max_c < 200 or v1.a > 4" }, @@ -1386,6 +1464,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707 and (t1.a < 2 and max_c < 200 or t1.a > 4 and max_c < 500)", "filesort": { "sort_key": "t1.a, t1.b", @@ -1396,6 +1475,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 2 or t1.a > 4" } @@ -1448,12 +1528,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -1463,6 +1545,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.max_c > 400 or v1.max_c < 135" }, @@ -1473,6 +1556,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707 and (max_c > 400 or max_c < 135)", "filesort": { "sort_key": "t1.a, t1.b", @@ -1483,6 +1567,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1501,12 +1586,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -1516,6 +1603,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.max_c > 400 or v1.max_c < 135" }, @@ -1526,6 +1614,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707 and (max_c > 400 or max_c < 135)", "filesort": { "sort_key": "t1.a, t1.b", @@ -1536,6 +1625,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1570,12 +1660,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a = 1 and t2.b is not null" } @@ -1590,11 +1682,13 @@ EXPLAIN "used_key_parts": ["b"], "ref": ["test.t2.b"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a = 1", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.b", @@ -1605,6 +1699,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 1" } @@ -1635,12 +1730,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.d is not null" } @@ -1655,11 +1752,13 @@ EXPLAIN "used_key_parts": ["max_c"], "ref": ["test.t2.d"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a = 5 and v1.max_c = t2.d", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.b", @@ -1670,6 +1769,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 5" } @@ -1707,12 +1807,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a < 5 and t2.a is not null" } @@ -1727,10 +1829,12 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -1741,6 +1845,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 5" } @@ -1769,12 +1874,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a is not null and t2.a is not null" } @@ -1789,10 +1896,12 @@ EXPLAIN "used_key_parts": ["a", "b"], "ref": ["test.t2.a", "test.t2.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -1803,6 +1912,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b = t1.a" } @@ -1836,12 +1946,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.c > 150 and t2.c is not null" } @@ -1856,10 +1968,12 @@ EXPLAIN "used_key_parts": ["max_c"], "ref": ["test.t2.c"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707 and max_c > 150", "filesort": { "sort_key": "t1.a, t1.b", @@ -1870,6 +1984,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1899,12 +2014,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a = 3" } @@ -1915,6 +2032,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a = 3 and v1.b = 3" }, @@ -1924,6 +2042,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "nested_loop": [ { @@ -1931,6 +2050,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 3 and t1.b = 3" } @@ -1959,12 +2079,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a = 2" } @@ -1975,6 +2097,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a = 1 and v1.b = 21" }, @@ -1984,6 +2107,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "nested_loop": [ { @@ -1991,6 +2115,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 1 and t1.b = 21" } @@ -2025,17 +2150,20 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived2>", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v.a = 'c' and v.b < 'Hermes'", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 9", "filesort": { "sort_key": "t1_char.b", @@ -2046,6 +2174,7 @@ EXPLAIN "table_name": "t1_char", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1_char.a = 'c' and t1_char.b < 'Hermes'" } @@ -2063,6 +2192,7 @@ EXPLAIN "table_name": "t", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100 }, "buffer_type": "flat", @@ -2108,12 +2238,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(t.b > 1 or t.b = 1) and t.b is not null and t.b is not null" } @@ -2128,10 +2260,12 @@ EXPLAIN "used_key_parts": ["a", "b"], "ref": ["test.t.b", "test.t.b"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "avg_c > 12", "filesort": { "sort_key": "t1_decimal.a, t1_decimal.b", @@ -2142,6 +2276,7 @@ EXPLAIN "table_name": "t1_decimal", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1_decimal.b = t1_decimal.a and (t1_decimal.a > 1 or t1_decimal.a = 1)" } @@ -2187,12 +2322,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a < 4 or t2.c > 150" } @@ -2203,6 +2340,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100 }, "buffer_type": "flat", @@ -2212,6 +2350,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707 and (t1.a < 4 or max_c > 150)", "filesort": { "sort_key": "t1.a, t1.b", @@ -2222,6 +2361,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -2256,12 +2396,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a > 5 and t2.c > 250 and t2.a is not null and t2.c is not null" } @@ -2276,10 +2418,12 @@ EXPLAIN "used_key_parts": ["a", "max_c"], "ref": ["test.t2.a", "test.t2.c"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707 and max_c > 250", "filesort": { "sort_key": "t1.a, t1.b", @@ -2290,6 +2434,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 5" } @@ -2336,12 +2481,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a = 8" } @@ -2352,6 +2499,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a = 8 and v1.max_c = 404" }, @@ -2361,6 +2509,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c = 404", "filesort": { "sort_key": "t1.b", @@ -2371,6 +2520,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 8" } @@ -2406,12 +2556,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.d is not null" } @@ -2426,11 +2578,13 @@ EXPLAIN "used_key_parts": ["max_c"], "ref": ["test.t2.d"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a > 3 and v1.max_c > 200 and t2.b < v1.b and t2.d = v1.max_c", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707 and max_c > 200", "filesort": { "sort_key": "t1.a, t1.b", @@ -2441,6 +2595,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 3" } @@ -2476,12 +2631,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t.c is not null and t.c is not null" } @@ -2496,11 +2653,13 @@ EXPLAIN "used_key_parts": ["b", "c"], "ref": ["test.t.c", "test.t.c"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t.c > 10 or v.a = 1", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "avg_a < 22.333 and (t1_double.b > 10 or t1_double.a = 1)", "filesort": { "sort_key": "t1_double.b, t1_double.c", @@ -2511,6 +2670,7 @@ EXPLAIN "table_name": "t1_double", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1_double.c = t1_double.b and t1_double.b > 12.2" } @@ -2551,12 +2711,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t.c > 18 and t.c is not null" } @@ -2571,11 +2733,13 @@ EXPLAIN "used_key_parts": ["c"], "ref": ["test.t.c"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v.a > 0.2 or v.b < 17 or t.c > 17", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "avg_a < 22.333 and (t1_double.a > 0.2 or t1_double.b < 17 or t1_double.c > 17)", "filesort": { "sort_key": "t1_double.b, t1_double.c", @@ -2586,6 +2750,7 @@ EXPLAIN "table_name": "t1_double", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1_double.b > 12.2 and t1_double.c > 18" } @@ -2657,17 +2822,20 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived2>", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(v.a > 4 or v.a = 2 or v.b > 3) and v.avg_c = 13", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "avg_c > 12 and avg_c = 13", "filesort": { "sort_key": "t1_decimal.a, t1_decimal.b", @@ -2678,6 +2846,7 @@ EXPLAIN "table_name": "t1_decimal", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1_decimal.a > 4 or t1_decimal.a = 2 or t1_decimal.b > 3" } @@ -2695,6 +2864,7 @@ EXPLAIN "table_name": "t", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100 }, "buffer_type": "flat", @@ -2731,12 +2901,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a is not null and t2.a is not null" } @@ -2751,11 +2923,13 @@ EXPLAIN "used_key_parts": ["a", "b"], "ref": ["test.t2.a", "test.t2.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.max_c > 300", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707 and max_c > 300", "filesort": { "sort_key": "t1.a, t1.b", @@ -2766,6 +2940,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b = t1.a and t1.a > 5" } @@ -2807,12 +2982,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a < 2 and t2.c > 900" } @@ -2823,6 +3000,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100 }, "buffer_type": "flat", @@ -2831,6 +3009,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -2841,6 +3020,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -2874,12 +3054,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a is not null and t2.b is not null" } @@ -2894,10 +3076,12 @@ EXPLAIN "used_key_parts": ["a", "b"], "ref": ["test.t2.a", "test.t2.b"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -2908,6 +3092,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -2955,12 +3140,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -2970,6 +3157,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100 }, "buffer_type": "flat", @@ -2979,6 +3167,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -2989,6 +3178,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -3060,12 +3250,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -3075,6 +3267,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100 }, "buffer_type": "flat", @@ -3084,6 +3277,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -3094,6 +3288,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -3137,12 +3332,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a < 2 and t2.c > 900" } @@ -3153,6 +3350,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100 }, "buffer_type": "flat", @@ -3162,6 +3360,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -3172,6 +3371,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -3214,12 +3414,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a is not null and t2.a is not null" } @@ -3234,10 +3436,12 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -3248,6 +3452,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -3268,11 +3473,13 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v2.b < 50", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -3283,6 +3490,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 5 and t1.b < 50" } @@ -3345,12 +3553,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.b < 50" } @@ -3361,6 +3571,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100 }, "buffer_type": "flat", @@ -3370,6 +3581,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -3380,6 +3592,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -3400,11 +3613,13 @@ EXPLAIN "used_key_parts": ["b"], "ref": ["v1.b"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v2.a = v1.a or v1.a = t2.a", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -3415,6 +3630,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 5" } @@ -3457,12 +3673,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -3472,6 +3690,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100 }, "buffer_type": "flat", @@ -3481,6 +3700,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -3491,6 +3711,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -3507,6 +3728,7 @@ EXPLAIN "table_name": "<derived3>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100 }, "buffer_type": "incremental", @@ -3516,6 +3738,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -3526,6 +3749,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 5" } @@ -3572,12 +3796,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -3587,6 +3813,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.max_c < 300" }, @@ -3596,6 +3823,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707 and max_c < 300", "filesort": { "sort_key": "t1.a, t1.b", @@ -3606,6 +3834,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -3622,6 +3851,7 @@ EXPLAIN "table_name": "<derived3>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v2.b < 50 or v2.b = 19" }, @@ -3632,6 +3862,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -3642,6 +3873,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 5 and (t1.b < 50 or t1.b = 19)" } @@ -3679,12 +3911,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a is not null and t2.a is not null and t2.a is not null" } @@ -3699,10 +3933,12 @@ EXPLAIN "used_key_parts": ["a", "b"], "ref": ["test.t2.a", "test.t2.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -3713,6 +3949,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b = t1.a" } @@ -3734,11 +3971,13 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v2.max_c < 300", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "max_c < 707 and max_c < 300", "filesort": { "sort_key": "t1.a, t1.b", @@ -3749,6 +3988,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 5" } @@ -3783,12 +4023,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -3798,6 +4040,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a = 1 and v1.b > 10" }, @@ -3808,6 +4051,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.b", @@ -3818,6 +4062,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 1 and t1.b > 10" } @@ -3839,10 +4084,12 @@ EXPLAIN "used_key_parts": ["b"], "ref": ["v1.b"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -3853,6 +4100,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 5 and t1.b > 10" } @@ -3898,17 +4146,20 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived2>", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v.a = 'b' and (v.b = 'Vika' or v.b = 'Ali')", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 9", "filesort": { "sort_key": "t1_char.b", @@ -3919,6 +4170,7 @@ EXPLAIN "table_name": "t1_char", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1_char.a = 'b' and (t1_char.b = 'Vika' or t1_char.b = 'Ali')" } @@ -3936,6 +4188,7 @@ EXPLAIN "table_name": "t", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t.a = 'b'" }, @@ -4005,12 +4258,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a is not null" } @@ -4025,11 +4280,13 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v3.b < 50 or v3.b = 33", "materialized": { "query_block": { "select_id": 4, + "cost": "COST_REPLACED", "having_condition": "min_c > 109", "filesort": { "sort_key": "t1.a, t1.b", @@ -4040,6 +4297,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 10 and (t1.b < 50 or t1.b = 33)" } @@ -4057,6 +4315,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.max_c < 500" }, @@ -4066,6 +4325,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707 and max_c < 500", "filesort": { "sort_key": "t1.a, t1.b", @@ -4076,6 +4336,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -4092,6 +4353,7 @@ EXPLAIN "table_name": "<derived3>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v2.max_c > 300" }, @@ -4102,6 +4364,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "max_c < 707 and max_c > 300", "filesort": { "sort_key": "t1.a, t1.b", @@ -4112,6 +4375,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 5" } @@ -4164,12 +4428,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.b is not null" } @@ -4184,11 +4450,13 @@ EXPLAIN "used_key_parts": ["b"], "ref": ["test.t2.b"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.max_c > 130 and v1.a is not null", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707 and max_c > 130", "filesort": { "sort_key": "t1.a, t1.b", @@ -4199,6 +4467,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 5" } @@ -4220,11 +4489,13 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["v1.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v2.min_c < 130", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "min_c < 707 and min_c < 130", "filesort": { "sort_key": "t1.a, t1.b", @@ -4235,6 +4506,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 5" } @@ -4320,12 +4592,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -4335,6 +4609,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.avg_c < 400 or v1.a > 1" }, @@ -4345,6 +4620,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707 and (avg_c < 400 or t1.a > 1)", "filesort": { "sort_key": "t1.a, t1.b", @@ -4355,6 +4631,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 5" } @@ -4376,11 +4653,13 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["v1.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v2.min_c < 200", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "min_c < 707 and min_c < 200", "filesort": { "sort_key": "t1.a, t1.b", @@ -4391,6 +4670,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 5" } @@ -4412,11 +4692,13 @@ EXPLAIN "used_key_parts": ["b"], "ref": ["v1.b"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v3.avg_c > 170 or v3.a < 5", "materialized": { "query_block": { "select_id": 4, + "cost": "COST_REPLACED", "having_condition": "avg_c > 170 or t1.a < 5", "filesort": { "sort_key": "t1.a, t1.b", @@ -4427,6 +4709,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 8" } @@ -4487,12 +4770,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -4502,6 +4787,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(v1.a = 1 or v1.max_c < 300) and v1.b > 25" }, @@ -4512,6 +4798,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707 and (t1.a = 1 or max_c < 300)", "filesort": { "sort_key": "t1.a, t1.b", @@ -4522,6 +4809,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 25" } @@ -4568,12 +4856,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a is not null" } @@ -4588,11 +4878,13 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.max_c > 300 and v1.b < 30", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 707 and max_c > 300", "filesort": { "sort_key": "t1.a, t1.b", @@ -4603,6 +4895,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 5 and t1.b < 30" } @@ -4656,12 +4949,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.c > 800 and t2.b is not null" } @@ -4676,11 +4971,13 @@ EXPLAIN "used_key_parts": ["b"], "ref": ["test.t2.b"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a < 5", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -4691,6 +4988,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 5" } @@ -4709,12 +5007,14 @@ EXPLAIN "query_block": { "select_id": 2, "operation": "UNION", + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.d > 800" } @@ -4725,6 +5025,7 @@ EXPLAIN "table_name": "<derived4>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.max_c > 100 and v1.a > 7" }, @@ -4734,6 +5035,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 4, + "cost": "COST_REPLACED", "having_condition": "max_c < 707 and max_c > 100", "filesort": { "sort_key": "t1.a, t1.b", @@ -4744,6 +5046,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 7" } @@ -4820,12 +5123,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.b = 19" } @@ -4836,6 +5141,7 @@ EXPLAIN "table_name": "<derived3>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.b = 19 and v1.a < 5" }, @@ -4845,6 +5151,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a", @@ -4855,6 +5162,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b = 19 and t1.a < 5" } @@ -4873,12 +5181,14 @@ EXPLAIN "query_block": { "select_id": 2, "operation": "UNION", + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -4888,6 +5198,7 @@ EXPLAIN "table_name": "<derived4>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.max_c > 400 or v1.avg_c > 270" }, @@ -4898,6 +5209,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 4, + "cost": "COST_REPLACED", "having_condition": "max_c < 707 and (max_c > 400 or avg_c > 270)", "filesort": { "sort_key": "t1.a, t1.b", @@ -4908,6 +5220,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -4995,12 +5308,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -5010,6 +5325,7 @@ EXPLAIN "table_name": "<derived3>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a = 1 or v1.a = 6" }, @@ -5020,6 +5336,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -5030,6 +5347,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 1 or t1.a = 6" } @@ -5048,12 +5366,14 @@ EXPLAIN "query_block": { "select_id": 2, "operation": "UNION", + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -5063,6 +5383,7 @@ EXPLAIN "table_name": "<derived4>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a > 3 and v1.b > 27 or v1.max_c > 550" }, @@ -5073,6 +5394,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 4, + "cost": "COST_REPLACED", "having_condition": "max_c < 707 and (t1.a > 3 and t1.b > 27 or max_c > 550)", "filesort": { "sort_key": "t1.a, t1.b", @@ -5083,6 +5405,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -5171,12 +5494,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a = 1" } @@ -5187,6 +5512,7 @@ EXPLAIN "table_name": "<derived4>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a = 1 and (v1.max_c < 500 or v1.avg_c > 500)" }, @@ -5197,6 +5523,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 4, + "cost": "COST_REPLACED", "having_condition": "max_c < 707 and (max_c < 500 or avg_c > 500)", "filesort": { "sort_key": "t1.b", @@ -5207,6 +5534,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 1" } @@ -5225,12 +5553,14 @@ EXPLAIN "query_block": { "select_id": 2, "operation": "UNION", + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a < 2" } @@ -5241,6 +5571,7 @@ EXPLAIN "table_name": "<derived5>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v2.b > 10" }, @@ -5251,6 +5582,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 5, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -5261,6 +5593,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 5 and t1.b > 10" } @@ -5279,12 +5612,14 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "UNION", + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.c is not null" } @@ -5299,11 +5634,13 @@ EXPLAIN "used_key_parts": ["max_c"], "ref": ["test.t2.c"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v2.b < 10", "materialized": { "query_block": { "select_id": 6, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -5314,6 +5651,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 5 and t1.b < 10" } @@ -5368,12 +5706,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -5383,6 +5723,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 40, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v_union.a < 3 and v_union.c > 100" }, @@ -5398,6 +5739,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "c > 109 and c > 100", "filesort": { "sort_key": "t1.a, t1.b", @@ -5408,6 +5750,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 10 and t1.a < 3" } @@ -5421,6 +5764,7 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "UNION", + "cost": "COST_REPLACED", "having_condition": "c < 300 and c > 100", "filesort": { "sort_key": "t1.a, t1.b", @@ -5431,6 +5775,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 10 and t1.a < 3" } @@ -5490,12 +5835,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -5505,6 +5852,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 40, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(v_union.a < 2 or v_union.c > 800) and v_union.b > 12" }, @@ -5521,6 +5869,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "c > 109 and (t1.a < 2 or c > 800)", "filesort": { "sort_key": "t1.a, t1.b", @@ -5531,6 +5880,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 10 and t1.b > 12" } @@ -5544,6 +5894,7 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "UNION", + "cost": "COST_REPLACED", "having_condition": "c < 300 and (t1.a < 2 or c > 800)", "filesort": { "sort_key": "t1.a, t1.b", @@ -5554,6 +5905,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 10 and t1.b > 12" } @@ -5600,12 +5952,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a = 1" } @@ -5616,6 +5970,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 40, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v_union.a = 1 and v_union.c < 200" }, @@ -5631,6 +5986,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "c > 109 and c < 200", "filesort": { "sort_key": "t1.b", @@ -5641,6 +5997,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 1" } @@ -5654,6 +6011,7 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "UNION", + "cost": "COST_REPLACED", "having_condition": "c < 300 and c < 200", "filesort": { "sort_key": "t1.b", @@ -5664,6 +6022,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 1 and t1.b > 10" } @@ -5708,12 +6067,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t.a is not null" } @@ -5728,11 +6089,13 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v.b = 'Vika' and v.max_c > 2", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 9 and max_c > 2", "filesort": { "sort_key": "t1_char.a", @@ -5743,6 +6106,7 @@ EXPLAIN "table_name": "t1_char", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1_char.b = 'Vika'" } @@ -5791,12 +6155,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a = 1" } @@ -5807,6 +6173,7 @@ EXPLAIN "table_name": "<derived4>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a = 1" }, @@ -5816,6 +6183,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 4, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.b", @@ -5826,6 +6194,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 1" } @@ -5843,6 +6212,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 40, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v_union.a = 1" }, @@ -5859,6 +6229,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "c > 109", "filesort": { "sort_key": "t1.b", @@ -5869,6 +6240,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 1" } @@ -5882,6 +6254,7 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "UNION", + "cost": "COST_REPLACED", "having_condition": "c < 300", "filesort": { "sort_key": "t1.b", @@ -5892,6 +6265,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 1 and t1.b > 10" } @@ -5947,12 +6321,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(t2.a = 6 or t2.a = 8) and t2.a is not null" } @@ -5967,6 +6343,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 6, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v.c > 200", "materialized": { @@ -5978,6 +6355,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "c > 109 and c > 200", "filesort": { "sort_key": "t1.a, t1.b", @@ -5988,6 +6366,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 10 and (t1.a = 6 or t1.a = 8)" } @@ -6001,6 +6380,7 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "UNION", + "cost": "COST_REPLACED", "having_condition": "c < 300 and c > 200", "filesort": { "sort_key": "t1.a, t1.b", @@ -6011,6 +6391,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 10 and (t1.a = 6 or t1.a = 8)" } @@ -6024,6 +6405,7 @@ EXPLAIN "query_block": { "select_id": 4, "operation": "UNION", + "cost": "COST_REPLACED", "having_condition": "c < 707 and c > 200", "filesort": { "sort_key": "t1.a, t1.b", @@ -6034,6 +6416,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.c > 300 and (t1.a = 6 or t1.a = 8)" } @@ -6134,12 +6517,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a is not null" } @@ -6154,6 +6539,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 4, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v.c > 6", "materialized": { @@ -6165,12 +6551,14 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 10 and t1.a + 1 > 6" } @@ -6182,12 +6570,14 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "UNION", + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 10 and t1.c > 100 and t1.c > 6" } @@ -6266,12 +6656,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a is not null" } @@ -6286,6 +6678,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 4, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a > 1 or v.b < 20", "materialized": { @@ -6297,12 +6690,14 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 10 and (t1.a > 1 or t1.b < 20)" } @@ -6314,12 +6709,14 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "UNION", + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 10 and t1.c > 100 and (t1.a > 1 or t1.b < 20)" } @@ -6366,12 +6763,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a is not null" } @@ -6386,6 +6785,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 4, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(v.b = 19 or v.b = 21) and (v.c < 3 or v.c > 600)", "materialized": { @@ -6397,12 +6797,14 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 10 and (t1.b = 19 or t1.b = 21) and (t1.a + 1 < 3 or t1.a + 1 > 600)" } @@ -6414,12 +6816,14 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "UNION", + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 10 and t1.c > 100 and (t1.b = 19 or t1.b = 21) and (t1.c < 3 or t1.c > 600)" } @@ -6463,12 +6867,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a is not null" } @@ -6483,6 +6889,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 4, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v.b < 20", "materialized": { @@ -6494,6 +6901,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "c > 109", "filesort": { "sort_key": "t1.a, t1.b", @@ -6504,6 +6912,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 10 and t1.b < 20" } @@ -6517,12 +6926,14 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "UNION", + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 10 and t1.b < 20" } @@ -6585,12 +6996,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a is not null" } @@ -6605,6 +7018,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 4, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(t2.a < 3 or v.b < 40) and v.c > 500", "materialized": { @@ -6616,6 +7030,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "c > 109 and c > 500", "filesort": { "sort_key": "t1.a, t1.b", @@ -6626,6 +7041,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 10 and (t1.a < 3 or t1.b < 40)" } @@ -6639,12 +7055,14 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "UNION", + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 10 and (t1.a < 3 or t1.b < 40) and t1.c + 100 > 500" } @@ -6709,17 +7127,20 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived2>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v4.a < 13", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "filesort": { "sort_key": "v1.a, v1.b", "temporary_table": { @@ -6729,11 +7150,13 @@ EXPLAIN "table_name": "<derived3>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a < 15 and v1.a < 13", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -6744,6 +7167,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 15 and t1.a < 13" } @@ -6768,6 +7192,7 @@ EXPLAIN "table_name": "<derived4>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a > 5 and v1.b > 12" }, @@ -6777,6 +7202,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 4, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -6787,6 +7213,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 5 and t1.b > 12" } @@ -6829,12 +7256,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a is not null and t2.a is not null" } @@ -6849,10 +7278,12 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "filesort": { "sort_key": "v1.a, v1.b", "temporary_table": { @@ -6862,11 +7293,13 @@ EXPLAIN "table_name": "<derived3>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a < 15", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -6877,6 +7310,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 15" } @@ -6905,11 +7339,13 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.b > 30", "materialized": { "query_block": { "select_id": 4, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -6920,6 +7356,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 30" } @@ -6964,12 +7401,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a > 1 and t2.a is not null and t2.a is not null" } @@ -6984,11 +7423,13 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v4.min_c > 100", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "min_c > 100", "filesort": { "sort_key": "v1.a, v1.b", @@ -6999,11 +7440,13 @@ EXPLAIN "table_name": "<derived3>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a < 15 and v1.a > 1", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -7014,6 +7457,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 15 and t1.a > 1" } @@ -7042,11 +7486,13 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.b < 30", "materialized": { "query_block": { "select_id": 4, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -7057,6 +7503,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 1 and t1.b < 30" } @@ -7186,12 +7633,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -7201,6 +7650,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v4.b > 10 and v4.a > 1 or v4.b < 20" }, @@ -7211,6 +7661,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "filesort": { "sort_key": "v1.a, v1.b", "temporary_table": { @@ -7220,11 +7671,13 @@ EXPLAIN "table_name": "<derived3>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a < 15 and (v1.b > 10 and v1.a > 1 or v1.b < 20)", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -7235,6 +7688,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 15 and (t1.b > 10 and t1.a > 1 or t1.b < 20)" } @@ -7263,11 +7717,13 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["v4.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.max_c > 200", "materialized": { "query_block": { "select_id": 4, + "cost": "COST_REPLACED", "having_condition": "max_c < 707 and max_c > 200", "filesort": { "sort_key": "t1.a, t1.b", @@ -7278,6 +7734,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -7315,17 +7772,20 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived2>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v4.a > 12 and v4.min_c < 300 and v4.b > 13 or v4.a < 1", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "v1.a > 12 and min_c < 300 and v1.b > 13 or v1.a < 1", "filesort": { "sort_key": "v1.a, v1.b", @@ -7336,11 +7796,13 @@ EXPLAIN "table_name": "<derived3>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a < 15 and (v1.a > 12 and v1.b > 13 or v1.a < 1)", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -7351,6 +7813,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 15 and (t1.a > 12 and t1.b > 13 or t1.a < 1)" } @@ -7375,6 +7838,7 @@ EXPLAIN "table_name": "<derived4>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100 }, "buffer_type": "flat", @@ -7383,6 +7847,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 4, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -7393,6 +7858,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 5" } @@ -7432,17 +7898,20 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived2>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v4.b = v4.a and v4.min_c < 100 and v4.a is not null", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "min_c < 100", "filesort": { "sort_key": "v1.a, v1.b", @@ -7453,11 +7922,13 @@ EXPLAIN "table_name": "<derived3>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.b = v1.a and v1.a < 15", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -7468,6 +7939,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b = t1.a and t1.a < 15" } @@ -7496,10 +7968,12 @@ EXPLAIN "used_key_parts": ["b"], "ref": ["v4.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 4, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -7510,6 +7984,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 5" } @@ -7549,17 +8024,20 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived2>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v4.b = v4.a and v4.a < 30 and v4.a is not null", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "filesort": { "sort_key": "v1.a, v1.b", "temporary_table": { @@ -7569,11 +8047,13 @@ EXPLAIN "table_name": "<derived3>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.b = v1.a and v1.a < 15 and v1.a < 30", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -7584,6 +8064,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b = t1.a and t1.a < 15 and t1.a < 30" } @@ -7612,10 +8093,12 @@ EXPLAIN "used_key_parts": ["b"], "ref": ["v4.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 4, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -7626,6 +8109,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 5 and t1.b < 30" } @@ -7665,17 +8149,20 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived2>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v4.b = v4.a and (v4.a < 30 or v4.a > 2) and v4.a is not null", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "filesort": { "sort_key": "v1.a, v1.b", "temporary_table": { @@ -7685,11 +8172,13 @@ EXPLAIN "table_name": "<derived3>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.b = v1.a and v1.a < 15 and (v1.a < 30 or v1.a > 2)", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -7700,6 +8189,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b = t1.a and t1.a < 15 and (t1.a < 30 or t1.a > 2)" } @@ -7728,10 +8218,12 @@ EXPLAIN "used_key_parts": ["b"], "ref": ["v4.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 4, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -7742,6 +8234,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 5 and (t1.b < 30 or t1.b > 2)" } @@ -7789,17 +8282,20 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived2>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(v4.a < 12 and v4.b > 13 or v4.a > 10) and v4.min_c > 100 and v4.min_c is not null", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "min_c > 100", "filesort": { "sort_key": "v1.a, v1.b", @@ -7810,11 +8306,13 @@ EXPLAIN "table_name": "<derived3>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a < 15 and (v1.a < 12 and v1.b > 13 or v1.a > 10)", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -7825,6 +8323,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 15 and (t1.a < 12 and t1.b > 13 or t1.a > 10)" } @@ -7853,10 +8352,12 @@ EXPLAIN "used_key_parts": ["max_c"], "ref": ["v4.min_c"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 4, + "cost": "COST_REPLACED", "having_condition": "max_c < 707 and max_c > 100", "filesort": { "sort_key": "t1.a, t1.b", @@ -7867,6 +8368,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 5" } @@ -7913,12 +8415,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.c > 100 and t2.c is not null" } @@ -7933,11 +8437,13 @@ EXPLAIN "used_key_parts": ["min_c"], "ref": ["test.t2.c"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v4.a < 12 and t2.b > 13 or v4.a > 10", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "min_c > 100", "filesort": { "sort_key": "v1.a, v1.b", @@ -7948,11 +8454,13 @@ EXPLAIN "table_name": "<derived3>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a < 15 and (v1.a < 12 or v1.a > 10)", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -7963,6 +8471,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 15 and (t1.a < 12 or t1.a > 10)" } @@ -7987,6 +8496,7 @@ EXPLAIN "table_name": "<derived4>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100 }, "buffer_type": "flat", @@ -7995,6 +8505,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 4, + "cost": "COST_REPLACED", "having_condition": "max_c < 707", "filesort": { "sort_key": "t1.a, t1.b", @@ -8005,6 +8516,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 5" } @@ -8159,6 +8671,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "const_condition": "0 or <in_optimizer>(2,<exists>(subquery#3))", "nested_loop": [ { @@ -8174,6 +8687,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 50, "attached_condition": "t2.b = 2", "first_match": "t1" @@ -8184,6 +8698,7 @@ EXPLAIN { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -8195,16 +8710,19 @@ EXPLAIN "used_key_parts": ["c"], "ref": ["func"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 5, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t3", "access_type": "ALL", "rows": 4, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t3.c = 2" } @@ -8257,6 +8775,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "const_condition": "0 or <in_optimizer>(2,<exists>(subquery#3))", "nested_loop": [ { @@ -8272,6 +8791,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 50, "attached_condition": "t2.b = 2", "first_match": "t1" @@ -8282,6 +8802,7 @@ EXPLAIN { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -8293,10 +8814,12 @@ EXPLAIN "used_key_parts": ["d"], "ref": ["func"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 5, + "cost": "COST_REPLACED", "having_condition": "s > 2", "filesort": { "sort_key": "t4.d", @@ -8307,6 +8830,7 @@ EXPLAIN "table_name": "t4", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -8346,6 +8870,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "const_condition": "<in_optimizer>(1,exists(subquery#3))", "nested_loop": [ { @@ -8361,23 +8886,27 @@ EXPLAIN { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived4>", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v2.b = 1", "materialized": { "query_block": { "select_id": 4, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.b = 1" } @@ -8416,12 +8945,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -8435,17 +8966,20 @@ EXPLAIN "used_key_parts": ["b"], "ref": ["test.t1.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "trigcond(v2.b is null) and trigcond(trigcond(t1.a is not null))", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -8471,23 +9005,27 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived3>", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "<nop>(v1.i <= 3)", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "<nop>(t1.i <= 3)" } @@ -8532,12 +9070,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "<in_optimizer>(t1.b,<exists>(subquery#2)) or t1.b = 100" } @@ -8547,6 +9087,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -8558,16 +9099,19 @@ EXPLAIN "used_key_parts": ["pk2"], "ref": ["func"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 4, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -8594,12 +9138,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "<in_optimizer>(t1.b,<exists>(subquery#3)) or t1.b = 100" } @@ -8609,6 +9155,7 @@ EXPLAIN { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -8620,16 +9167,19 @@ EXPLAIN "used_key_parts": ["pk2"], "ref": ["func"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 4, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -8664,6 +9214,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -8678,23 +9229,27 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived3>", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a = 50", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 50" } @@ -8722,6 +9277,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -8736,17 +9292,20 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived3>", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v2.s < 50", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "s < 50", "filesort": { "sort_key": "t3.a", @@ -8757,6 +9316,7 @@ EXPLAIN "table_name": "t3", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -8794,6 +9354,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -8820,17 +9381,20 @@ EXPLAIN "table_name": "<derived3>", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.b = 2", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b = 2" } @@ -8864,6 +9428,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -8887,17 +9452,20 @@ EXPLAIN "table_name": "<derived3>", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.f = 2", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t.f = 2" } @@ -8913,6 +9481,7 @@ EXPLAIN "table_name": "<derived4>", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v2.pk > 2" }, @@ -8922,6 +9491,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 4, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -8932,6 +9502,7 @@ EXPLAIN "key_length": "4", "used_key_parts": ["pk"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "index_condition": "t.pk > 2" } @@ -8964,6 +9535,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -8987,17 +9559,20 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "sq.i = 3", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.i = 3" } @@ -9031,6 +9606,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -9054,17 +9630,20 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "sq.i = 2.71", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.i = 2.7100000381469727" } @@ -9093,6 +9672,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -9116,17 +9696,20 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "sq.i = 3.21", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.i = 3.21" } @@ -9155,6 +9738,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -9178,17 +9762,20 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "sq.i = 'aa'", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.i = 'aa'" } @@ -9219,6 +9806,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -9242,17 +9830,20 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "sq.i = '2007-05-28 00:00:00'", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.i = TIMESTAMP'2007-05-28 00:00:00'" } @@ -9281,6 +9872,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -9304,17 +9896,20 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "sq.i = '2007-05-28'", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.i = DATE'2007-05-28'" } @@ -9343,6 +9938,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -9366,17 +9962,20 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "sq.i = '10:00:02'", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.i = TIME'10:00:02'" } @@ -9405,23 +10004,27 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived2>", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "nullif(1,v1.i)", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "nullif(1,t1.i)" } @@ -9500,23 +10103,27 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived3>", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.c = 'foo'", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.c = 'foo'" } @@ -9531,12 +10138,14 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "1 = t2.a" } @@ -9561,23 +10170,27 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived3>", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "<cache>(<in_optimizer>(1,<exists>(subquery#2))) or v1.c = 'foo'", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -9591,12 +10204,14 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 128, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "1 = t2.a" } @@ -9737,12 +10352,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 7, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 2 and t1.a is not null" } @@ -9757,10 +10374,12 @@ EXPLAIN "used_key_parts": ["b"], "ref": ["test.t1.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t2.b", "temporary_table": { @@ -9770,6 +10389,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.b > 2" } @@ -9797,12 +10417,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 7, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 2 and t1.a is not null" } @@ -9817,10 +10439,12 @@ EXPLAIN "used_key_parts": ["b"], "ref": ["test.t1.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t2.b", "temporary_table": { @@ -9830,6 +10454,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.b > 2" } @@ -9860,12 +10485,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 7, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 2 and t1.a is not null" } @@ -9880,10 +10507,12 @@ EXPLAIN "used_key_parts": ["b"], "ref": ["test.t1.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "temporary_table": { "nested_loop": [ { @@ -9891,6 +10520,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.b > 2" } @@ -9917,12 +10547,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 7, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 2 and t1.a is not null" } @@ -9937,10 +10569,12 @@ EXPLAIN "used_key_parts": ["m"], "ref": ["test.t1.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "m > 2", "filesort": { "sort_key": "t2.b", @@ -9951,6 +10585,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -9980,17 +10615,20 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived3>", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.f > 0", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "f > 0", "nested_loop": [ { @@ -9998,6 +10636,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -10028,6 +10667,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -10039,6 +10679,7 @@ EXPLAIN "used_key_parts": ["i1"], "ref": ["const"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "using_index": true } @@ -10049,6 +10690,7 @@ EXPLAIN "table_name": "<derived3>", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v2.i2 = 1" }, @@ -10058,12 +10700,14 @@ EXPLAIN "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.i2 = 1" } @@ -10096,17 +10740,20 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived2>", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t.f = 'a' or t.f = 'b'", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "temporary_table": { "nested_loop": [ { @@ -10114,6 +10761,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -10151,12 +10799,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 4, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.id2 is not null" } @@ -10171,11 +10821,13 @@ EXPLAIN "used_key_parts": ["id2"], "ref": ["test.t1.id2"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "vc.ct > 0", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "ct > 0", "filesort": { "sort_key": "t2.id2", @@ -10186,6 +10838,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -10250,12 +10903,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.x = 1" } @@ -10266,6 +10921,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a = 1 and v1.b = 1 and v1.max_c > 30" }, @@ -10275,6 +10931,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c > 37 and max_c > 30", "nested_loop": [ { @@ -10282,6 +10939,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 1 and t1.b = 1" } @@ -10335,12 +10993,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.x = 1" } @@ -10351,6 +11011,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a = 1 and v1.b = 1 and v1.d = 1 and v1.max_c > 30" }, @@ -10360,6 +11021,7 @@ EXPLAIN "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c > 37 and max_c > 30", "nested_loop": [ { @@ -10367,6 +11029,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 1 and t1.b = 1 and t1.d = 1" } @@ -10452,12 +11115,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 1 and t1.a is not null and t1.b is not null" } @@ -10472,10 +11137,12 @@ EXPLAIN "used_key_parts": ["e", "max_f"], "ref": ["test.t1.a", "test.t1.b"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "max_f > 18", "filesort": { "sort_key": "t2.e", @@ -10486,6 +11153,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.e > 1" } @@ -10550,12 +11218,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b < 25 and t1.a is not null and t1.b is not null" } @@ -10570,10 +11240,12 @@ EXPLAIN "used_key_parts": ["e", "max_f"], "ref": ["test.t1.a", "test.t1.b"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "max_f > 18 and max_f < 25", "filesort": { "sort_key": "t2.e", @@ -10584,6 +11256,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -10647,12 +11320,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a is not null and t1.b is not null" } @@ -10667,11 +11342,13 @@ EXPLAIN "used_key_parts": ["e", "max_f"], "ref": ["test.t1.a", "test.t1.b"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "temporary_table": { "nested_loop": [ { @@ -10679,11 +11356,13 @@ EXPLAIN "table_name": "<derived3>", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "d_tab.e > 1", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t2.e", "temporary_table": { @@ -10693,6 +11372,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.e > 1" } @@ -10763,12 +11443,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a is not null and t1.b is not null" } @@ -10783,11 +11465,13 @@ EXPLAIN "used_key_parts": ["e", "max_f"], "ref": ["test.t1.a", "test.t1.b"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "temporary_table": { "nested_loop": [ { @@ -10795,11 +11479,13 @@ EXPLAIN "table_name": "<derived3>", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "d_tab.max_f > 20", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "max_f > 20", "filesort": { "sort_key": "t2.e", @@ -10810,6 +11496,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -10871,17 +11558,20 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived2>", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "dt.a = 2", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "a = 2", "filesort": { "sort_key": "t1.a", @@ -10892,6 +11582,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -10928,17 +11619,20 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived2>", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "dt.a > 1", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "a > 1", "filesort": { "sort_key": "t1.a", @@ -10949,6 +11643,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 3" } @@ -10985,17 +11680,20 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived2>", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "dt.a = 'ab'", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a", "temporary_table": { @@ -11005,6 +11703,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -11040,17 +11739,20 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived2>", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "dt.a = 1", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a", "temporary_table": { @@ -11060,6 +11762,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -11115,12 +11818,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "1 in (0,t1.a) and t1.a is not null" } @@ -11135,10 +11840,12 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t1.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a", "temporary_table": { @@ -11148,6 +11855,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "1 in (0,t1.a) and 1 in (0,t1.a)" } @@ -11183,12 +11891,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a in (1,t1.a) and t1.a is not null" } @@ -11203,10 +11913,12 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t1.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a", "temporary_table": { @@ -11216,6 +11928,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a in (1,t1.a)" } @@ -11314,17 +12027,20 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived2>", "access_type": "ALL", "rows": 7, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t.a <= 2", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a", "temporary_table": { @@ -11334,6 +12050,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 7, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a <= 2" } @@ -11360,12 +12077,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a is not null" } @@ -11380,11 +12099,13 @@ EXPLAIN "used_key_parts": ["c"], "ref": ["test.t2.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a = t.c and t.a >= 3", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a", "temporary_table": { @@ -11394,6 +12115,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 7, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a >= 3" } @@ -11423,12 +12145,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -11437,17 +12161,20 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 7, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t.a = 2 and t2.a = t.c + 9", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 7, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 2" } @@ -11497,17 +12224,20 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived3>", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "case when tab2.max_a = 1 or tab2.max_a = 2 then 1 else 0 end = 1", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "case when max_a = 1 or max_a = 2 then 1 else 0 end = 1", "filesort": { "sort_key": "t1.b", @@ -11518,6 +12248,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -11554,17 +12285,20 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived3>", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "case when tab2.max_a = 1 or tab2.max_a > 2 and tab2.max_a < 4 then 1 else 0 end = 1", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "case when max_a = 1 or max_a > 2 and max_a < 4 then 1 else 0 end = 1", "filesort": { "sort_key": "t1.b", @@ -11575,6 +12309,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -11611,17 +12346,20 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived3>", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "case when tab2.max_a > 1 and (tab2.max_a = 2 or tab2.max_a > 2) then 1 else 0 end = 1", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "case when max_a > 1 and (max_a = 2 or max_a > 2) then 1 else 0 end = 1", "filesort": { "sort_key": "t1.b", @@ -11632,6 +12370,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -11668,17 +12407,20 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived3>", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "case when tab2.b = 2 or tab2.b = 4 then 1 else 0 end = 1", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.b", "temporary_table": { @@ -11688,6 +12430,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "case when t1.b = 2 or t1.b = 4 then 1 else 0 end = 1" } @@ -11745,33 +12488,39 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived2>", "access_type": "ALL", "rows": 144, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t.f is not null", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived4>", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 4, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -11786,6 +12535,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.f is not null" }, @@ -11828,23 +12578,27 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived2>", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t.f is not null", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 8, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.f is not null" } @@ -11859,16 +12613,19 @@ EXPLAIN "used_key_parts": ["f"], "ref": ["test.t1.f"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 4, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 8, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.f is not null" } @@ -11913,12 +12670,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.f2 < 2 and t1.f2 is not null" } @@ -11933,16 +12692,19 @@ EXPLAIN "used_key_parts": ["f2"], "ref": ["test.t1.f2"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.f2 < 2" } @@ -11968,12 +12730,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.f2 < 2 and t1.f2 is not null" } @@ -11988,10 +12752,12 @@ EXPLAIN "used_key_parts": ["f2"], "ref": ["test.t1.f2"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "temporary_table": { "nested_loop": [ { @@ -11999,6 +12765,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.f2 < 2" } @@ -12048,12 +12815,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived2>", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { @@ -12254,12 +13023,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived2>", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v3.col1 = 123 and v3.col2 = 321", "materialized": { @@ -12269,6 +13040,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -12280,6 +13052,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["const"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -12290,6 +13063,7 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "UNION", + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -12301,6 +13075,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["const"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -12338,17 +13113,20 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived2>", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v2.s + 1 > 10 and v2.a > 1 and v2.a2 > 123", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "s + 1 > 10 and a2 > 123", "filesort": { "sort_key": "t1.a, f1(t1.a)", @@ -12359,6 +13137,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 1" } @@ -12391,12 +13170,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t4", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t4.a + 1 > 10 and t4.b > 1 and t4.c > 123 and t4.a is not null and t4.b is not null and t4.c is not null" } @@ -12411,12 +13192,14 @@ EXPLAIN "used_key_parts": ["a", "f1(a)", "sum(b)"], "ref": ["test.t4.a", "test.t4.b", "test.t4.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t4.c = `<subquery2>`.`sum(b)`", "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "`f1(a)` > 1 and `sum(b)` > 123", "temporary_table": { "nested_loop": [ @@ -12425,6 +13208,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a + 1 > 10" } @@ -12488,12 +13272,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a < 5 and t2.a is not null" } @@ -12508,6 +13294,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { @@ -12518,6 +13305,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "c < 300", "filesort": { "sort_key": "t1.a, t1.b", @@ -12528,6 +13316,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 9 and t1.a < 5" } @@ -12541,6 +13330,7 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "INTERSECT", + "cost": "COST_REPLACED", "having_condition": "c > 100", "filesort": { "sort_key": "t1.a, t1.b", @@ -12551,6 +13341,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 10 and t1.a < 5" } @@ -12590,12 +13381,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a = 8" } @@ -12606,6 +13399,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a = 8" }, @@ -12621,6 +13415,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "c < 300", "filesort": { "sort_key": "t1.b", @@ -12631,6 +13426,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 8" } @@ -12644,6 +13440,7 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "INTERSECT", + "cost": "COST_REPLACED", "having_condition": "c > 100", "filesort": { "sort_key": "t1.b", @@ -12654,6 +13451,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 8 and t1.b > 10" } @@ -12692,12 +13490,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a = 8" } @@ -12708,6 +13508,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a = 8" }, @@ -12723,6 +13524,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "c < 300", "filesort": { "sort_key": "t1.b", @@ -12733,6 +13535,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 8" } @@ -12746,6 +13549,7 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "INTERSECT", + "cost": "COST_REPLACED", "having_condition": "c > 100", "filesort": { "sort_key": "t1.b", @@ -12756,6 +13560,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 8 and t1.b > 10" } @@ -12796,12 +13601,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a is not null" } @@ -12816,6 +13623,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.c > 200", "materialized": { @@ -12827,6 +13635,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "c < 300 and c > 200", "filesort": { "sort_key": "t1.a, t1.b", @@ -12837,6 +13646,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 9" } @@ -12850,6 +13660,7 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "INTERSECT", + "cost": "COST_REPLACED", "having_condition": "c > 100 and c > 200", "filesort": { "sort_key": "t1.a, t1.b", @@ -12860,6 +13671,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 10" } @@ -12901,12 +13713,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a < 5 and t2.a is not null" } @@ -12921,6 +13735,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.c > 110", "materialized": { @@ -12932,6 +13747,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "c < 300 and c > 110", "filesort": { "sort_key": "t1.a, t1.b", @@ -12942,6 +13758,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 9 and t1.a < 5" } @@ -12955,6 +13772,7 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "INTERSECT", + "cost": "COST_REPLACED", "having_condition": "c > 100 and c > 110", "filesort": { "sort_key": "t1.a, t1.b", @@ -12965,6 +13783,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 10 and t1.a < 5" } @@ -13007,12 +13826,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a is not null" } @@ -13027,6 +13848,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.b > 27 or v1.b < 19", "materialized": { @@ -13038,6 +13860,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "c < 300", "filesort": { "sort_key": "t1.a, t1.b", @@ -13048,6 +13871,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 9 and (t1.b > 27 or t1.b < 19)" } @@ -13061,6 +13885,7 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "INTERSECT", + "cost": "COST_REPLACED", "having_condition": "c > 100", "filesort": { "sort_key": "t1.a, t1.b", @@ -13071,6 +13896,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 10 and (t1.b > 27 or t1.b < 19)" } @@ -13119,12 +13945,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a is not null" } @@ -13139,6 +13967,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.c > 200 or v1.c < 105", "materialized": { @@ -13150,6 +13979,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "c < 300 and (c > 200 or c < 105)", "filesort": { "sort_key": "t1.a, t1.b", @@ -13160,6 +13990,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 9" } @@ -13173,6 +14004,7 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "INTERSECT", + "cost": "COST_REPLACED", "having_condition": "c > 100 and (c > 200 or c < 105)", "filesort": { "sort_key": "t1.a, t1.b", @@ -13183,6 +14015,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 10" } @@ -13253,12 +14086,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -13268,6 +14103,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a > 3 or v1.a = 1 and v1.c < 110" }, @@ -13284,6 +14120,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "c < 300 and (t1.a > 3 and c > 110 or t1.a = 1 and c < 110)", "filesort": { "sort_key": "t1.a, t1.b", @@ -13294,6 +14131,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 9 and (t1.a > 3 or t1.a = 1)" } @@ -13307,6 +14145,7 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "INTERSECT", + "cost": "COST_REPLACED", "having_condition": "c > 100 and (t1.a > 3 and c > 110 or t1.a = 1 and c < 110)", "filesort": { "sort_key": "t1.a, t1.b", @@ -13317,6 +14156,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 10 and (t1.a > 3 or t1.a = 1)" } @@ -13416,12 +14256,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.b is not null" } @@ -13436,6 +14278,7 @@ EXPLAIN "used_key_parts": ["b"], "ref": ["test.t2.b"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.c = 909 and t2.b > 13 or d1.a < 4 and d1.c < 200", "materialized": { @@ -13447,6 +14290,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "c < 300 and (t1.b > 13 or t1.a < 4 and c < 200)", "filesort": { "sort_key": "t1.a, t1.b", @@ -13457,6 +14301,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 9 and (t1.b > 13 or t1.a < 4)" } @@ -13470,6 +14315,7 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "INTERSECT", + "cost": "COST_REPLACED", "having_condition": "c > 100 and (t1.b > 13 or t1.a < 4 and c < 200)", "filesort": { "sort_key": "t1.a, t1.b", @@ -13480,6 +14326,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 10 and (t1.b > 13 or t1.a < 4)" } @@ -13531,12 +14378,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a < 5 and t2.a is not null" } @@ -13551,6 +14400,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { @@ -13561,6 +14411,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "c > 200", "filesort": { "sort_key": "t1.a, t1.b", @@ -13571,6 +14422,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 9 and t1.a < 5" } @@ -13584,6 +14436,7 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "EXCEPT", + "cost": "COST_REPLACED", "having_condition": "c < 300", "filesort": { "sort_key": "t1.a, t1.b", @@ -13594,6 +14447,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 10 and t1.a < 5" } @@ -13635,12 +14489,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a = 6" } @@ -13651,6 +14507,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a = 6" }, @@ -13666,6 +14523,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "c > 200", "filesort": { "sort_key": "t1.b", @@ -13676,6 +14534,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 6" } @@ -13689,6 +14548,7 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "EXCEPT", + "cost": "COST_REPLACED", "having_condition": "c < 300", "filesort": { "sort_key": "t1.b", @@ -13699,6 +14559,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 6 and t1.b > 10" } @@ -13739,12 +14600,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a = 6" } @@ -13755,6 +14618,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a = 6" }, @@ -13770,6 +14634,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "c > 200", "filesort": { "sort_key": "t1.b", @@ -13780,6 +14645,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 6" } @@ -13793,6 +14659,7 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "EXCEPT", + "cost": "COST_REPLACED", "having_condition": "c < 300", "filesort": { "sort_key": "t1.b", @@ -13803,6 +14670,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 6 and t1.b > 10" } @@ -13847,12 +14715,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a is not null" } @@ -13867,6 +14737,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.c > 500", "materialized": { @@ -13878,6 +14749,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "c > 200 and c > 500", "filesort": { "sort_key": "t1.a, t1.b", @@ -13888,6 +14760,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 9" } @@ -13901,6 +14774,7 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "EXCEPT", + "cost": "COST_REPLACED", "having_condition": "c < 300 and c > 500", "filesort": { "sort_key": "t1.a, t1.b", @@ -13911,6 +14785,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 10" } @@ -13952,12 +14827,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a < 5 and t2.a is not null" } @@ -13972,6 +14849,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.c > 500", "materialized": { @@ -13983,6 +14861,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "c > 200 and c > 500", "filesort": { "sort_key": "t1.a, t1.b", @@ -13993,6 +14872,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 9 and t1.a < 5" } @@ -14006,6 +14886,7 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "EXCEPT", + "cost": "COST_REPLACED", "having_condition": "c < 300 and c > 500", "filesort": { "sort_key": "t1.a, t1.b", @@ -14016,6 +14897,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 10 and t1.a < 5" } @@ -14060,12 +14942,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a is not null" } @@ -14080,6 +14964,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.b > 27 or v1.b < 19", "materialized": { @@ -14091,6 +14976,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "c > 200", "filesort": { "sort_key": "t1.a, t1.b", @@ -14101,6 +14987,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 9 and (t1.b > 27 or t1.b < 19)" } @@ -14114,6 +15001,7 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "EXCEPT", + "cost": "COST_REPLACED", "having_condition": "c < 300", "filesort": { "sort_key": "t1.a, t1.b", @@ -14124,6 +15012,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 10 and (t1.b > 27 or t1.b < 19)" } @@ -14172,12 +15061,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a is not null" } @@ -14192,6 +15083,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.c < 400 or v1.c > 800", "materialized": { @@ -14203,6 +15095,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "c > 200 and (c < 400 or c > 800)", "filesort": { "sort_key": "t1.a, t1.b", @@ -14213,6 +15106,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 9" } @@ -14226,6 +15120,7 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "EXCEPT", + "cost": "COST_REPLACED", "having_condition": "c < 300 and (c < 400 or c > 800)", "filesort": { "sort_key": "t1.a, t1.b", @@ -14236,6 +15131,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 10" } @@ -14304,12 +15200,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -14319,6 +15217,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a > 1 or v1.a = 1 and v1.c > 500" }, @@ -14335,6 +15234,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "c > 200 and (t1.a > 1 and c < 500 or t1.a = 1 and c > 500)", "filesort": { "sort_key": "t1.a, t1.b", @@ -14345,6 +15245,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 9 and (t1.a > 1 or t1.a = 1)" } @@ -14358,6 +15259,7 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "EXCEPT", + "cost": "COST_REPLACED", "having_condition": "c < 300 and (t1.a > 1 and c < 500 or t1.a = 1 and c > 500)", "filesort": { "sort_key": "t1.a, t1.b", @@ -14368,6 +15270,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 10 and (t1.a > 1 or t1.a = 1)" } @@ -14463,12 +15366,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.b is not null" } @@ -14483,6 +15388,7 @@ EXPLAIN "used_key_parts": ["b"], "ref": ["test.t2.b"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.c = 988 and t2.b > 13 or d1.a > 4 and d1.c > 500", "materialized": { @@ -14494,6 +15400,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "c > 200 and (t1.b > 13 or t1.a > 4 and c > 500)", "filesort": { "sort_key": "t1.a, t1.b", @@ -14504,6 +15411,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 9 and (t1.b > 13 or t1.a > 4)" } @@ -14517,6 +15425,7 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "EXCEPT", + "cost": "COST_REPLACED", "having_condition": "c < 300 and (t1.b > 13 or t1.a > 4 and c > 500)", "filesort": { "sort_key": "t1.a, t1.b", @@ -14527,6 +15436,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 10 and (t1.b > 13 or t1.a > 4)" } @@ -14580,12 +15490,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a > 5 and t2.a is not null" } @@ -14600,6 +15512,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.c > 200", "materialized": { @@ -14611,6 +15524,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "c > 200 and c > 200", "filesort": { "sort_key": "t1.a, t1.b", @@ -14621,6 +15535,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 9 and t1.a > 5" } @@ -14634,12 +15549,14 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "UNION", + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived4>", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "__5.a > 5 and __5.c > 200", "materialized": { @@ -14651,6 +15568,7 @@ EXPLAIN { "query_block": { "select_id": 4, + "cost": "COST_REPLACED", "having_condition": "c < 300 and c > 200", "filesort": { "sort_key": "t1.a, t1.b", @@ -14661,6 +15579,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 10 and t1.a > 5" } @@ -14674,6 +15593,7 @@ EXPLAIN "query_block": { "select_id": 5, "operation": "INTERSECT", + "cost": "COST_REPLACED", "having_condition": "c < 530 and c > 200", "filesort": { "sort_key": "t1.a, t1.b", @@ -14684,6 +15604,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 3 and t1.a > 5" } @@ -14746,12 +15667,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a > 4 and t2.a is not null" } @@ -14766,6 +15689,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.c < 200", "materialized": { @@ -14777,6 +15701,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "c > 200 and c < 200", "filesort": { "sort_key": "t1.a, t1.b", @@ -14787,6 +15712,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 9 and t1.a > 4" } @@ -14800,6 +15726,7 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "INTERSECT", + "cost": "COST_REPLACED", "having_condition": "c < 500 and c < 200", "filesort": { "sort_key": "t1.a, t1.b", @@ -14810,6 +15737,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 3 and t1.a > 4" } @@ -14823,6 +15751,7 @@ EXPLAIN "query_block": { "select_id": 4, "operation": "UNION", + "cost": "COST_REPLACED", "having_condition": "c < 300 and c < 200", "filesort": { "sort_key": "t1.a, t1.b", @@ -14833,6 +15762,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 10 and t1.a > 4" } @@ -14884,12 +15814,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a > 5 and t2.a is not null" } @@ -14904,6 +15836,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.c > 200", "materialized": { @@ -14915,6 +15848,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "c > 200 and c > 200", "filesort": { "sort_key": "t1.a, t1.b", @@ -14925,6 +15859,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 9 and t1.a > 5" } @@ -14938,6 +15873,7 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "UNION", + "cost": "COST_REPLACED", "having_condition": "c < 300 and c > 200", "filesort": { "sort_key": "t1.a, t1.b", @@ -14948,6 +15884,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 10 and t1.a > 5" } @@ -14961,6 +15898,7 @@ EXPLAIN "query_block": { "select_id": 4, "operation": "EXCEPT", + "cost": "COST_REPLACED", "having_condition": "c < 530 and c > 200", "filesort": { "sort_key": "t1.a, t1.b", @@ -14971,6 +15909,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 3 and t1.a > 5" } @@ -15024,12 +15963,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a > 4 and t2.a is not null" } @@ -15044,6 +15985,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.c < 200", "materialized": { @@ -15055,6 +15997,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "c > 200 and c < 200", "filesort": { "sort_key": "t1.a, t1.b", @@ -15065,6 +16008,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 9 and t1.a > 4" } @@ -15078,6 +16022,7 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "EXCEPT", + "cost": "COST_REPLACED", "having_condition": "c < 500 and c < 200", "filesort": { "sort_key": "t1.a, t1.b", @@ -15088,6 +16033,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 3 and t1.a > 4" } @@ -15101,6 +16047,7 @@ EXPLAIN "query_block": { "select_id": 4, "operation": "UNION", + "cost": "COST_REPLACED", "having_condition": "c < 300 and c < 200", "filesort": { "sort_key": "t1.a, t1.b", @@ -15111,6 +16058,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 10 and t1.a > 4" } @@ -15162,12 +16110,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a > 4 and t2.a is not null" } @@ -15182,6 +16132,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.c < 150", "materialized": { @@ -15193,6 +16144,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "c < 300 and c < 150", "filesort": { "sort_key": "t1.a, t1.b", @@ -15203,6 +16155,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 10 and t1.a > 4" } @@ -15216,6 +16169,7 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "INTERSECT", + "cost": "COST_REPLACED", "having_condition": "c < 500 and c < 150", "filesort": { "sort_key": "t1.a, t1.b", @@ -15226,6 +16180,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 7 and t1.a > 4" } @@ -15239,6 +16194,7 @@ EXPLAIN "query_block": { "select_id": 4, "operation": "EXCEPT", + "cost": "COST_REPLACED", "having_condition": "c > 150 and c < 150", "filesort": { "sort_key": "t1.a, t1.b", @@ -15249,6 +16205,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 9 and t1.a > 4" } @@ -15300,12 +16257,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a > 4 and t2.a is not null" } @@ -15320,6 +16279,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.c < 130", "materialized": { @@ -15331,6 +16291,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "c < 300 and c < 130", "filesort": { "sort_key": "t1.a, t1.b", @@ -15341,6 +16302,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 10 and t1.a > 4" } @@ -15354,12 +16316,14 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "EXCEPT", + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived4>", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "__5.a > 4 and __5.c < 130", "materialized": { @@ -15371,6 +16335,7 @@ EXPLAIN { "query_block": { "select_id": 4, + "cost": "COST_REPLACED", "having_condition": "c > 150 and c < 130", "filesort": { "sort_key": "t1.a, t1.b", @@ -15381,6 +16346,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 9 and t1.a > 4" } @@ -15394,6 +16360,7 @@ EXPLAIN "query_block": { "select_id": 5, "operation": "INTERSECT", + "cost": "COST_REPLACED", "having_condition": "c < 500 and c < 130", "filesort": { "sort_key": "t1.a, t1.b", @@ -15404,6 +16371,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 7 and t1.a > 4" } @@ -15468,12 +16436,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a > 4 and t2.a is not null" } @@ -15488,6 +16458,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.c < 130", "materialized": { @@ -15499,6 +16470,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "c < 300 and c < 130", "filesort": { "sort_key": "t1.a, t1.b", @@ -15509,6 +16481,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 10 and t1.a > 4" } @@ -15522,12 +16495,14 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "EXCEPT", + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived4>", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "__6.a > 4 and __6.c < 130", "materialized": { @@ -15539,6 +16514,7 @@ EXPLAIN { "query_block": { "select_id": 4, + "cost": "COST_REPLACED", "having_condition": "c > 150 and c < 130", "filesort": { "sort_key": "t1.a, t1.b", @@ -15549,6 +16525,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 9 and t1.a > 4" } @@ -15562,6 +16539,7 @@ EXPLAIN "query_block": { "select_id": 5, "operation": "INTERSECT", + "cost": "COST_REPLACED", "having_condition": "c < 500 and c < 130", "filesort": { "sort_key": "t1.a, t1.b", @@ -15572,6 +16550,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 7 and t1.a > 4" } @@ -15594,6 +16573,7 @@ EXPLAIN "query_block": { "select_id": 6, "operation": "UNION", + "cost": "COST_REPLACED", "having_condition": "c < 120 and c < 130", "filesort": { "sort_key": "t1.a, t1.b", @@ -15604,6 +16584,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 7 and t1.a > 4" } @@ -15656,12 +16637,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a > 4 and t2.a is not null" } @@ -15676,11 +16659,13 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v2.c < 150", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "c < 150", "filesort": { "sort_key": "v1.a, v1.b", @@ -15691,6 +16676,7 @@ EXPLAIN "table_name": "<derived3>", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a < 7 and v1.a > 4", "materialized": { @@ -15702,6 +16688,7 @@ EXPLAIN { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "c < 300", "filesort": { "sort_key": "t1.a, t1.b", @@ -15712,6 +16699,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 10 and t1.a < 7 and t1.a > 4" } @@ -15725,6 +16713,7 @@ EXPLAIN "query_block": { "select_id": 4, "operation": "INTERSECT", + "cost": "COST_REPLACED", "having_condition": "c > 120", "filesort": { "sort_key": "t1.a, t1.b", @@ -15735,6 +16724,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 9 and t1.a < 7 and t1.a > 4" } @@ -15794,12 +16784,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a > 4 and t2.a is not null" } @@ -15814,11 +16806,13 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v2.c < 150", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "c < 150", "filesort": { "sort_key": "v1.a, v1.b", @@ -15829,6 +16823,7 @@ EXPLAIN "table_name": "<derived3>", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a < 7 and v1.a > 4", "materialized": { @@ -15840,6 +16835,7 @@ EXPLAIN { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "c < 300", "filesort": { "sort_key": "t1.a, t1.b", @@ -15850,6 +16846,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 10 and t1.a < 7 and t1.a > 4" } @@ -15863,6 +16860,7 @@ EXPLAIN "query_block": { "select_id": 4, "operation": "EXCEPT", + "cost": "COST_REPLACED", "having_condition": "c > 150", "filesort": { "sort_key": "t1.a, t1.b", @@ -15873,6 +16871,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 9 and t1.a < 7 and t1.a > 4" } @@ -15928,12 +16927,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a > 4 and t2.a is not null" } @@ -15948,6 +16949,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.b > 12 and v1.c < 450", "materialized": { @@ -15959,6 +16961,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "c > 300 and t1.b > 12 and c < 450", "filesort": { "sort_key": "t1.a", @@ -15969,6 +16972,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 9 and t1.a > 4" } @@ -15982,6 +16986,7 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "INTERSECT", + "cost": "COST_REPLACED", "having_condition": "c > 200 and t1.a > 4 and c < 450", "filesort": { "sort_key": "t1.b", @@ -15992,6 +16997,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b < 21 and t1.b > 12" } @@ -16040,12 +17046,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a < 2 and t2.a is not null" } @@ -16060,6 +17068,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.b < 30 and v1.c > 450", "materialized": { @@ -16071,6 +17080,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "c > 300 and t1.b < 30 and c > 450", "filesort": { "sort_key": "t1.a", @@ -16081,6 +17091,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 20 and t1.a < 2" } @@ -16094,6 +17105,7 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "EXCEPT", + "cost": "COST_REPLACED", "having_condition": "c > 150 and t1.a < 2 and c > 450", "filesort": { "sort_key": "t1.b", @@ -16104,6 +17116,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 7 and t1.b < 30" } @@ -16154,12 +17167,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(t2.a < 2 or t2.a < 5) and t2.a is not null" } @@ -16174,6 +17189,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.c > 450", "materialized": { @@ -16185,6 +17201,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "c > 300 and c > 450", "filesort": { "sort_key": "t1.a", @@ -16195,6 +17212,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 20 and (t1.a < 2 or t1.a < 5)" } @@ -16208,6 +17226,7 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "EXCEPT", + "cost": "COST_REPLACED", "having_condition": "c > 150 and (t1.a < 2 or t1.a < 5) and c > 450", "filesort": { "sort_key": "t1.b", @@ -16218,6 +17237,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 7" } @@ -16270,12 +17290,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a > 1 and t2.a is not null" } @@ -16290,6 +17312,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.b > 12 and v1.c > 400", "materialized": { @@ -16301,6 +17324,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "c > 100 and t1.b > 12 and c > 400", "filesort": { "sort_key": "t1.a", @@ -16311,6 +17335,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 9 and t1.a > 1" } @@ -16324,6 +17349,7 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "INTERSECT", + "cost": "COST_REPLACED", "having_condition": "c < 800 and t1.a > 1 and c > 400", "filesort": { "sort_key": "t1.b", @@ -16334,6 +17360,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 3 and t1.b > 12" } @@ -16347,6 +17374,7 @@ EXPLAIN "query_block": { "select_id": 4, "operation": "UNION", + "cost": "COST_REPLACED", "having_condition": "c > 300 and c > 400", "filesort": { "sort_key": "t1.a, t1.b", @@ -16357,6 +17385,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 10 and t1.a > 1 and t1.b > 12" } @@ -16414,12 +17443,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.b is not null" } @@ -16434,11 +17465,13 @@ EXPLAIN "used_key_parts": ["b"], "ref": ["test.t2.b"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a < 5", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -16449,6 +17482,7 @@ EXPLAIN "key_length": "5", "used_key_parts": ["a"], "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "index_condition": "t3.a > 0 and t3.a < 5" } @@ -16493,12 +17527,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.b is not null" } @@ -16513,6 +17549,7 @@ EXPLAIN "used_key_parts": ["b"], "ref": ["test.t2.b"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a < 4", "materialized": { @@ -16524,6 +17561,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -16534,6 +17572,7 @@ EXPLAIN "key_length": "5", "used_key_parts": ["a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "index_condition": "t3.a > 1 and t3.a < 4" } @@ -16545,6 +17584,7 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "UNION", + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -16555,6 +17595,7 @@ EXPLAIN "key_length": "5", "used_key_parts": ["a"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "index_condition": "t3.a > 2 and t3.a < 4" } @@ -16603,12 +17644,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.b is not null" } @@ -16623,6 +17666,7 @@ EXPLAIN "used_key_parts": ["b"], "ref": ["test.t2.b"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.a < 3", "materialized": { @@ -16634,6 +17678,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -16644,6 +17689,7 @@ EXPLAIN "key_length": "5", "used_key_parts": ["a"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "index_condition": "t3.a > 1 and t3.a < 3" } @@ -16655,6 +17701,7 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "UNION", + "cost": "COST_REPLACED", "having_condition": "t3.a < 3", "filesort": { "sort_key": "t3.b", @@ -16665,6 +17712,7 @@ EXPLAIN "table_name": "t3", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t3.b < 21" } @@ -16736,17 +17784,20 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived2>", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t.a > 2 and t.c in ('aa','bb','cc')", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "window_functions_computation": { "sorts": [ { @@ -16763,6 +17814,7 @@ EXPLAIN "access_type": "ALL", "possible_keys": ["idx"], "rows": 20, + "cost": "COST_REPLACED", "filtered": 80, "attached_condition": "t2.a > 2 and t2.c in ('aa','bb','cc')" } @@ -16851,12 +17903,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived2>", "access_type": "ALL", "rows": 32, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t.a > 2 and t.c in ('aa','bb','cc')", "materialized": { @@ -16866,6 +17920,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "window_functions_computation": { "sorts": [ { @@ -16882,6 +17937,7 @@ EXPLAIN "access_type": "ALL", "possible_keys": ["idx"], "rows": 20, + "cost": "COST_REPLACED", "filtered": 80, "attached_condition": "t2.a > 2 and t2.c in ('aa','bb','cc')" } @@ -16895,6 +17951,7 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "UNION", + "cost": "COST_REPLACED", "window_functions_computation": { "sorts": [ { @@ -16911,6 +17968,7 @@ EXPLAIN "access_type": "ALL", "possible_keys": ["idx"], "rows": 20, + "cost": "COST_REPLACED", "filtered": 80, "attached_condition": "t2.a > 2" } @@ -16959,12 +18017,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 8, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.c in ('aa','bb','cc') and t1.a is not null and t1.c is not null" } @@ -16979,10 +18039,12 @@ EXPLAIN "used_key_parts": ["a", "c"], "ref": ["test.t1.a", "test.t1.c"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "window_functions_computation": { "sorts": [ { @@ -16998,6 +18060,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.c in ('aa','bb','cc')" } @@ -17099,12 +18162,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived2>", "access_type": "ALL", "rows": 48, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t.a > 2 and t.c in ('aa','bb','cc')", "materialized": { @@ -17114,6 +18179,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "window_functions_computation": { "sorts": [ { @@ -17130,6 +18196,7 @@ EXPLAIN "access_type": "ALL", "possible_keys": ["idx"], "rows": 20, + "cost": "COST_REPLACED", "filtered": 80, "attached_condition": "t2.a > 2 and t2.c in ('aa','bb','cc')" } @@ -17143,6 +18210,7 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "UNION", + "cost": "COST_REPLACED", "window_functions_computation": { "sorts": [ { @@ -17159,6 +18227,7 @@ EXPLAIN "access_type": "ALL", "possible_keys": ["idx"], "rows": 20, + "cost": "COST_REPLACED", "filtered": 80, "attached_condition": "t2.a > 2" } @@ -17172,6 +18241,7 @@ EXPLAIN "query_block": { "select_id": 4, "operation": "UNION", + "cost": "COST_REPLACED", "having_condition": "t2.c in ('aa','bb','cc')", "filesort": { "sort_key": "t2.a", @@ -17183,6 +18253,7 @@ EXPLAIN "access_type": "ALL", "possible_keys": ["idx"], "rows": 20, + "cost": "COST_REPLACED", "filtered": 80, "attached_condition": "t2.a > 2" } @@ -17248,17 +18319,20 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived2>", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t.a > 2 and t.c in ('aa','bb','cc')", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "window_functions_computation": { "sorts": [ { @@ -17275,6 +18349,7 @@ EXPLAIN "access_type": "ALL", "possible_keys": ["idx"], "rows": 20, + "cost": "COST_REPLACED", "filtered": 80, "attached_condition": "t2.a > 2 and t2.c in ('aa','bb','cc')" } @@ -17336,17 +18411,20 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived2>", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t.a > 2 and t.c in ('aa','bb','cc')", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "window_functions_computation": { "sorts": [ { @@ -17363,6 +18441,7 @@ EXPLAIN "access_type": "ALL", "possible_keys": ["idx"], "rows": 20, + "cost": "COST_REPLACED", "filtered": 80, "attached_condition": "t2.a > 2" } @@ -17424,17 +18503,20 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived2>", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t.a > 2 and t.c in ('aa','bb','cc')", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "window_functions_computation": { "sorts": [ { @@ -17455,6 +18537,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 20, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.c in ('aa','bb','cc')" } @@ -17539,6 +18622,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -17549,6 +18633,7 @@ EXPLAIN "key_length": "5", "used_key_parts": ["b"], "rows": 4, + "cost": "COST_REPLACED", "filtered": 100, "index_condition": "t1.b < 3", "attached_condition": "t1.a is not null" @@ -17564,11 +18649,13 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t1.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 50, "materialized": { "lateral": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "outer_ref_condition": "t1.a is not null", "nested_loop": [ { @@ -17581,6 +18668,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t1.a"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -17660,6 +18748,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -17667,6 +18756,7 @@ EXPLAIN "access_type": "ALL", "possible_keys": ["idx_b"], "rows": 12, + "cost": "COST_REPLACED", "filtered": 83.33333588, "attached_condition": "t1.b <= 5 and t1.a is not null" } @@ -17681,11 +18771,13 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t1.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 50, "materialized": { "lateral": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "outer_ref_condition": "t1.a is not null", "nested_loop": [ { @@ -17698,6 +18790,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t1.a"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -17774,6 +18867,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "const_condition": "1", "nested_loop": [ { @@ -17781,6 +18875,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -17794,12 +18889,14 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t1.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 50, "attached_condition": "trigcond(trigcond(t1.a is not null))", "materialized": { "lateral": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "outer_ref_condition": "t1.a is not null", "nested_loop": [ { @@ -17812,6 +18909,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t1.a"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -17877,6 +18975,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -17887,6 +18986,7 @@ EXPLAIN "key_length": "5", "used_key_parts": ["b"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "index_condition": "t3.b > 15", "attached_condition": "t3.a is not null and t3.c is not null" @@ -17902,11 +19002,13 @@ EXPLAIN "used_key_parts": ["a", "c"], "ref": ["test.t3.a", "test.t3.c"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "lateral": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "outer_ref_condition": "t3.a is not null and t3.c is not null", "nested_loop": [ { @@ -17919,6 +19021,7 @@ EXPLAIN "used_key_parts": ["a", "c"], "ref": ["test.t3.a", "test.t3.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -17966,6 +19069,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -17973,6 +19077,7 @@ EXPLAIN "access_type": "ALL", "possible_keys": ["idx_b"], "rows": 12, + "cost": "COST_REPLACED", "filtered": 83.33333588, "attached_condition": "t3.b <= 15 and t3.a is not null and t3.c is not null" } @@ -17987,11 +19092,13 @@ EXPLAIN "used_key_parts": ["a", "c"], "ref": ["test.t3.a", "test.t3.c"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 50, "materialized": { "lateral": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "outer_ref_condition": "t3.a is not null and t3.c is not null", "nested_loop": [ { @@ -18004,6 +19111,7 @@ EXPLAIN "used_key_parts": ["a", "c"], "ref": ["test.t3.a", "test.t3.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -18051,6 +19159,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -18061,6 +19170,7 @@ EXPLAIN "key_length": "5", "used_key_parts": ["b"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "index_condition": "t3.b > 15", "attached_condition": "t3.a is not null and t3.c is not null" @@ -18076,11 +19186,13 @@ EXPLAIN "used_key_parts": ["a", "c"], "ref": ["test.t3.a", "test.t3.c"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "lateral": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "outer_ref_condition": "t3.a is not null and t3.c is not null", "nested_loop": [ { @@ -18093,6 +19205,7 @@ EXPLAIN "used_key_parts": ["a", "c"], "ref": ["test.t3.a", "test.t3.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -18140,6 +19253,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -18147,6 +19261,7 @@ EXPLAIN "access_type": "ALL", "possible_keys": ["idx_b"], "rows": 12, + "cost": "COST_REPLACED", "filtered": 83.33333588, "attached_condition": "t3.b <= 15 and t3.a is not null and t3.c is not null" } @@ -18161,11 +19276,13 @@ EXPLAIN "used_key_parts": ["a", "c"], "ref": ["test.t3.a", "test.t3.c"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 50, "materialized": { "lateral": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "outer_ref_condition": "t3.a is not null and t3.c is not null", "nested_loop": [ { @@ -18178,6 +19295,7 @@ EXPLAIN "used_key_parts": ["a", "c"], "ref": ["test.t3.a", "test.t3.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -18236,6 +19354,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -18246,6 +19365,7 @@ EXPLAIN "key_length": "133", "used_key_parts": ["c", "b"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "index_condition": "t2.b between 80 and 85 and t2.c in ('y','z')", "attached_condition": "t2.a is not null" @@ -18261,6 +19381,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t3.c is not null" } @@ -18275,11 +19396,13 @@ EXPLAIN "used_key_parts": ["c"], "ref": ["test.t3.c"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "lateral": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "outer_ref_condition": "t3.c is not null", "nested_loop": [ { @@ -18292,6 +19415,7 @@ EXPLAIN "used_key_parts": ["c"], "ref": ["test.t3.c"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -18396,12 +19520,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 90, + "cost": "COST_REPLACED", "filtered": 60, "attached_condition": "t2.b < 40 and t2.a is not null" } @@ -18416,6 +19542,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t3.c is not null" } @@ -18430,10 +19557,12 @@ EXPLAIN "used_key_parts": ["c"], "ref": ["test.t3.c"], "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t4.c", "temporary_table": { @@ -18444,6 +19573,7 @@ EXPLAIN "access_type": "ALL", "possible_keys": ["idx_c"], "rows": 160, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -18508,6 +19638,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -18518,6 +19649,7 @@ EXPLAIN "key_length": "133", "used_key_parts": ["c", "b"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "index_condition": "t2.b between 80 and 85 and t2.c in ('y','z')", "attached_condition": "t2.a is not null" @@ -18533,6 +19665,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t3.c is not null" } @@ -18547,11 +19680,13 @@ EXPLAIN "used_key_parts": ["c"], "ref": ["test.t3.c"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "lateral": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "outer_ref_condition": "t3.c is not null", "window_functions_computation": { "sorts": [ @@ -18573,6 +19708,7 @@ EXPLAIN "used_key_parts": ["c"], "ref": ["test.t3.c"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -18919,12 +20055,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 90, + "cost": "COST_REPLACED", "filtered": 60, "attached_condition": "t2.b < 40 and t2.a is not null" } @@ -18939,6 +20077,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.a"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t3.c is not null" } @@ -18953,10 +20092,12 @@ EXPLAIN "used_key_parts": ["c"], "ref": ["test.t3.c"], "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "window_functions_computation": { "sorts": [ { @@ -18973,6 +20114,7 @@ EXPLAIN "access_type": "ALL", "possible_keys": ["idx_c"], "rows": 160, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -19036,6 +20178,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -19046,6 +20189,7 @@ EXPLAIN "key_length": "5", "used_key_parts": ["a"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "index_condition": "t4.a < 2", "attached_condition": "t4.c is not null" @@ -19061,12 +20205,14 @@ EXPLAIN "used_key_parts": ["c"], "ref": ["test.t4.c"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 50, "first_match": "t4", "materialized": { "lateral": 1, "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "const_condition": "1", "outer_ref_condition": "t4.c is not null", "nested_loop": [ @@ -19080,6 +20226,7 @@ EXPLAIN "used_key_parts": ["c"], "ref": ["test.t4.c"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -19104,6 +20251,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -19113,6 +20261,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 4, + "cost": "COST_REPLACED", "filtered": 100 }, "buffer_type": "flat", @@ -19206,6 +20355,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -19213,6 +20363,7 @@ EXPLAIN "access_type": "ALL", "possible_keys": ["PRIMARY"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.f <> 5" } @@ -19227,11 +20378,13 @@ EXPLAIN "used_key_parts": ["pk2"], "ref": ["test.t1.pk1"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "lateral": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -19243,6 +20396,7 @@ EXPLAIN "used_key_parts": ["pk2"], "ref": ["test.t1.pk1"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "using_index": true } @@ -19649,6 +20803,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -19659,6 +20814,7 @@ ANALYZE "r_loops": 1, "rows": 4, "r_rows": 2, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -19675,6 +20831,7 @@ ANALYZE { "query_block": { "select_id": 2, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -19685,6 +20842,7 @@ ANALYZE "r_loops": 1, "rows": 2, "r_rows": 2, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -19758,12 +20916,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t3", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t3.`id` is not null and t3.`id` is not null" } @@ -19778,6 +20938,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t3.id"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -19802,6 +20963,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 1007, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -19820,10 +20982,12 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t3.id"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -19833,6 +20997,7 @@ EXPLAIN "key_length": "5", "used_key_parts": ["a"], "rows": 7, + "cost": "COST_REPLACED", "filtered": 100, "using_index_for_group_by": true } @@ -19866,12 +21031,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t3", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t3.`id` is not null and t3.`id` is not null" } @@ -19886,6 +21053,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t3.id"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -19910,6 +21078,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 1007, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -19928,11 +21097,13 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t3.id"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "lateral": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "outer_ref_condition": "t1.a is not null", "nested_loop": [ { @@ -19945,6 +21116,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t1.a"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "cp2.a = t3.`id`", "using_index": true @@ -20078,6 +21250,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -20088,6 +21261,7 @@ EXPLAIN "key_length": "5", "used_key_parts": ["t1_id"], "rows": 47, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t3.t1_id between 200 and 100000 and t3.t1_id is not null", "using_index": true @@ -20103,6 +21277,7 @@ EXPLAIN "used_key_parts": ["id"], "ref": ["test.t3.t1_id"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "using_index": true } @@ -20117,11 +21292,13 @@ EXPLAIN "used_key_parts": ["t1_id"], "ref": ["test.t3.t1_id"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 50, "materialized": { "lateral": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -20133,6 +21310,7 @@ EXPLAIN "used_key_parts": ["t1_id"], "ref": ["test.t1.id"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 34.55045319, "index_condition": "t2.t1_id between 200 and 100000 and t2.t1_id = t3.t1_id", "attached_condition": "t2.reporting_person = 1" @@ -20315,6 +21493,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -20330,6 +21509,7 @@ EXPLAIN "used_key_parts": ["to_ledger_id"], "ref": ["const"], "rows": 8, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -20343,11 +21523,13 @@ EXPLAIN "used_key_parts": ["ledger_id", "charge_id"], "ref": ["test.charges.from_ledger_id", "test.charges.id"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "lateral": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -20359,6 +21541,7 @@ EXPLAIN "used_key_parts": ["charge_id"], "ref": ["test.charges.id"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -20372,6 +21555,7 @@ EXPLAIN "used_key_parts": ["id"], "ref": ["test.transaction_items.transaction_id"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "transactions.ledger_id = charges.from_ledger_id" } @@ -20512,6 +21696,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -20523,6 +21708,7 @@ EXPLAIN "used_key_parts": ["to_ledger_id"], "ref": ["const"], "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -20536,11 +21722,13 @@ EXPLAIN "used_key_parts": ["ledger_id", "charge_id"], "ref": ["test.charges.from_ledger_id", "test.charges.id"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "lateral": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -20552,6 +21740,7 @@ EXPLAIN "used_key_parts": ["charge_id"], "ref": ["test.charges.id"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -20565,6 +21754,7 @@ EXPLAIN "used_key_parts": ["id"], "ref": ["test.transaction_items.transaction_id"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "transactions.ledger_id = charges.from_ledger_id" } diff --git a/mysql-test/main/derived_cond_pushdown.test b/mysql-test/main/derived_cond_pushdown.test index 55ccd9b4839..2f2e72fb09f 100644 --- a/mysql-test/main/derived_cond_pushdown.test +++ b/mysql-test/main/derived_cond_pushdown.test @@ -112,6 +112,7 @@ let $query= select * from v1,t2 where (v1.max_c>214) and (t2.a>v1.a); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= @@ -122,6 +123,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # extracted or formula : pushing into HAVING @@ -131,6 +133,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= @@ -140,6 +143,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # conjunctive subformula : pushing into WHERE @@ -147,12 +151,14 @@ let $query= select * from v1,t2 where (v1.a>6) and (t2.b>v1.b); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= select * from v2,t2 where (v2.b>25) and (t2.a<v2.a); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # extracted or formula : pushing into WHERE @@ -162,6 +168,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= @@ -170,6 +177,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= @@ -179,6 +187,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # conjunctive subformulas : pushing into HAVING and WHERE @@ -187,6 +196,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= @@ -195,6 +205,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= @@ -203,6 +214,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # extracted or formula : pushing into HAVING and WHERE @@ -213,6 +225,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= @@ -220,6 +233,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # extracted or formulas : pushing into WHERE and HAVING @@ -229,6 +243,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= @@ -238,6 +253,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # prepare of a query containing extracted or formula @@ -249,7 +265,9 @@ deallocate prepare stmt; prepare stmt from "explain format=json select * from v1,t2 where ((v1.max_c>400) and (t2.a>v1.a)) or ((v1.max_c<135) and (t2.a<v1.a));"; +--source include/explain-no-costs.inc execute stmt; +--source include/explain-no-costs.inc execute stmt; deallocate prepare stmt; @@ -260,12 +278,14 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= select * from v1,t2 where (v1.a=5) and (v1.max_c=t2.d); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # conjunctive subformula : pushing into WHERE using equalities @@ -273,6 +293,7 @@ let $query= select * from v1,t2 where (t2.a<5) and (v1.a=t2.a); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= @@ -280,6 +301,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # conjunctive subformula : pushing into HAVING using equalities @@ -287,6 +309,7 @@ let $query= select * from v1,t2 where (t2.c>150) and (v1.max_c=t2.c); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # extracted and formula : pushing into WHERE @@ -296,6 +319,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= @@ -303,6 +327,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= @@ -311,6 +336,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # extracted and formula : pushing into WHERE using equalities @@ -321,6 +347,7 @@ select * from v_decimal as v,t2_decimal as t where eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # extracted or formula : pushing into HAVING using equalities @@ -330,6 +357,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # conjunctive subformulas : pushing into WHERE and HAVING using equalities @@ -339,6 +367,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # conjunctive subformulas : pushing into WHERE and HAVING @@ -351,6 +380,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # conjunctive subformulas : pushing into WHERE and HAVING @@ -360,6 +390,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # conjunctive subformula : pushing into WHERE @@ -371,6 +402,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # conjunctive subformula : pushing into WHERE @@ -381,6 +413,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # extracted or formula : pushing into WHERE @@ -392,6 +425,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= @@ -402,6 +436,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # nothing to push @@ -410,12 +445,14 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= select * from v1,t2 where (v1.a=t2.a) and (v1.b=t2.b); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= @@ -424,6 +461,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= @@ -431,6 +469,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= @@ -439,6 +478,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using several derived tables : nothing to push @@ -447,6 +487,7 @@ let $query= select * from v1,v2,t2 where eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= @@ -455,6 +496,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= @@ -463,6 +505,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using several derived tables : pushing in all tables @@ -475,6 +518,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using several derived tables : pushing only in one table @@ -486,6 +530,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using several derived tables : pushing only in one table @@ -497,6 +542,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # extracted or formula : pushing into WHERE @@ -508,6 +554,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using several derived tables : pushing in all tables @@ -521,6 +568,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using several derived tables : pushing in all tables @@ -535,6 +583,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using several derived tables : pushing in all tables @@ -553,6 +602,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # extracted or formula : pushing into HAVING @@ -565,6 +615,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # extracted and formula : pushing into WHERE @@ -577,6 +628,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using query with union @@ -589,6 +641,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using query with union @@ -602,6 +655,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using query with union @@ -616,6 +670,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using query with union @@ -634,6 +689,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using derived table with union @@ -642,6 +698,7 @@ let $query= select * from v_union,t2 where (v_union.a<3) and (v_union.c>100); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using derived table with union @@ -653,6 +710,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using derived table with union @@ -665,6 +723,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= @@ -673,6 +732,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using derived table with union @@ -686,6 +746,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using derived table with union @@ -698,6 +759,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using derived table with union of selects without aggregation @@ -707,6 +769,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using derived table with union of selects without aggregation @@ -716,6 +779,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using derived table with union of selects without aggregation @@ -726,6 +790,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using derived table with union of @@ -736,6 +801,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using derived table with union of @@ -750,6 +816,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using embedded derived table : pushing the same conditions @@ -762,6 +829,7 @@ select * from v4,v1 where eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using embedded view : nothing to push @@ -773,6 +841,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using embedded view : pushing different conditions @@ -786,6 +855,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using embedded view : pushing different conditions @@ -798,6 +868,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using embedded view : pushing different conditions @@ -810,6 +881,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using embedded view : pushing different conditions @@ -823,6 +895,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using embedded view : pushing the same conditions @@ -836,6 +909,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using embedded view : pushing the same conditions @@ -849,6 +923,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using embedded view : pushing the same conditions @@ -863,6 +938,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using embedded view : pushing the same conditions @@ -875,6 +951,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; drop view v1,v2,v3,v4; @@ -982,6 +1059,7 @@ SELECT * FROM t1 WHERE a IN ( ) ); +--source include/explain-no-costs.inc EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE a IN ( SELECT b FROM v2 WHERE b < a OR b IN ( @@ -1004,6 +1082,7 @@ SELECT * FROM t1 WHERE a IN ( eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; DROP VIEW v2,v3,v4; @@ -1026,6 +1105,7 @@ SELECT * FROM ( SELECT * FROM t1 WHERE EXISTS ( SELECT * FROM v2 WHERE b = a ) ) AS sq; +--source include/explain-no-costs.inc EXPLAIN FORMAT=JSON SELECT * FROM ( SELECT * FROM t1 @@ -1051,6 +1131,7 @@ SELECT * FROM t1 LEFT JOIN t2 ON a = b WHERE b IS NULL; SELECT * FROM t1 LEFT JOIN v2 ON a = b WHERE b IS NULL; +--source include/explain-no-costs.inc EXPLAIN FORMAT=JSON SELECT * FROM t1 LEFT JOIN v2 ON a = b WHERE b IS NULL; @@ -1065,6 +1146,7 @@ CREATE TABLE t1 (i INT); CREATE OR REPLACE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t1; INSERT INTO t1 VALUES (1),(2); --enable_prepare_warnings +--source include/explain-no-costs.inc EXPLAIN FORMAT=JSON SELECT * FROM v1 WHERE i <= ANY ( SELECT 3 ); --disable_prepare_warnings @@ -1092,12 +1174,14 @@ CREATE ALGORITHM=TEMPTABLE VIEW v2 AS SELECT * FROM t2; SELECT * FROM v1 AS sq WHERE b IN ( SELECT pk2 FROM v2 WHERE c > sq.b ) OR b = 100; +--source include/explain-no-costs.inc EXPLAIN FORMAT=JSON SELECT * FROM v1 AS sq WHERE b IN ( SELECT pk2 FROM v2 WHERE c > sq.b ) OR b = 100; SELECT * FROM ( SELECT * FROM t1 ) AS sq WHERE b IN ( SELECT pk2 FROM v2 WHERE c > sq.b ) OR b = 100; +--source include/explain-no-costs.inc EXPLAIN FORMAT=JSON SELECT * FROM ( SELECT * FROM t1 ) AS sq WHERE b IN ( SELECT pk2 FROM v2 WHERE c > sq.b ) OR b = 100; @@ -1117,6 +1201,7 @@ INSERT INTO t2 VALUES (50); CREATE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t1; SELECT ( SELECT COUNT(*) FROM v1 WHERE a = t2.b ) AS f FROM t2 GROUP BY f; +--source include/explain-no-costs.inc EXPLAIN FORMAT=JSON SELECT ( SELECT COUNT(*) FROM v1 WHERE a = t2.b ) AS f FROM t2 GROUP BY f; @@ -1124,6 +1209,7 @@ CREATE TABLE t3 (a INT, b INT) ENGINE=MYISAM; INSERT INTO t3 VALUES (1,10),(3,11),(2,10),(2,20),(3,21); CREATE VIEW v2 AS SELECT a, sum(b) AS s FROM t3 GROUP BY a ; SELECT ( SELECT COUNT(*) FROM v2 WHERE s < t2.b ) AS f FROM t2 GROUP BY f; +--source include/explain-no-costs.inc EXPLAIN FORMAT=JSON SELECT ( SELECT COUNT(*) FROM v2 WHERE s < t2.b ) AS f FROM t2 GROUP BY f; @@ -1145,6 +1231,7 @@ INSERT INTO t2 VALUES (5),(6); SELECT a, GROUP_CONCAT(b) FROM v1 WHERE b IN ( SELECT COUNT(c) FROM t2 ) GROUP BY a; +--source include/explain-no-costs.inc EXPLAIN FORMAT=JSON SELECT a, GROUP_CONCAT(b) FROM v1 WHERE b IN ( SELECT COUNT(c) FROM t2 ) GROUP BY a; @@ -1163,6 +1250,7 @@ INSERT INTO t VALUES (1,1),(3,2); SELECT * FROM v AS v1, v AS v2 WHERE v2.pk > v1.f AND v1.f IN ( SELECT COUNT(pk) FROM t ); +--source include/explain-no-costs.inc EXPLAIN FORMAT=JSON SELECT * FROM v AS v1, v AS v2 WHERE v2.pk > v1.f AND v1.f IN ( SELECT COUNT(pk) FROM t ); @@ -1182,6 +1270,7 @@ INSERT INTO t2 VALUES (3),(4); SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq WHERE i IN ( SELECT MIN(j) FROM t2 ); +--source include/explain-no-costs.inc EXPLAIN FORMAT=JSON SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq WHERE i IN ( SELECT MIN(j) FROM t2 ); @@ -1200,6 +1289,7 @@ INSERT INTO t2 VALUES (3.2),(2.71); SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq WHERE i IN ( SELECT MIN(j) FROM t2 ); +--source include/explain-no-costs.inc EXPLAIN FORMAT=JSON SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq WHERE i IN ( SELECT MIN(j) FROM t2 ); @@ -1214,6 +1304,7 @@ INSERT INTO t2 VALUES (3.21),(4.55); SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq WHERE i IN ( SELECT MIN(j) FROM t2 ); +--source include/explain-no-costs.inc EXPLAIN FORMAT=JSON SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq WHERE i IN ( SELECT MIN(j) FROM t2 ); @@ -1228,6 +1319,7 @@ INSERT INTO t2 VALUES ('bbb'),('aa'); SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq WHERE i IN ( SELECT MIN(j) FROM t2 ); +--source include/explain-no-costs.inc EXPLAIN FORMAT=JSON SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq WHERE i IN ( SELECT MIN(j) FROM t2 ); @@ -1244,6 +1336,7 @@ INSERT INTO t2 VALUES SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq WHERE i IN ( SELECT MIN(j) FROM t2 ); +--source include/explain-no-costs.inc EXPLAIN FORMAT=JSON SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq WHERE i IN ( SELECT MIN(j) FROM t2 ); @@ -1258,6 +1351,7 @@ INSERT INTO t2 VALUES ('2007-05-28'), ('2010-08-25'); SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq WHERE i IN ( SELECT MIN(j) FROM t2 ); +--source include/explain-no-costs.inc EXPLAIN FORMAT=JSON SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq WHERE i IN ( SELECT MIN(j) FROM t2 ); @@ -1272,6 +1366,7 @@ INSERT INTO t2 VALUES ('10:00:02'), ('11:00:10'); SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq WHERE i IN ( SELECT MIN(j) FROM t2 ); +--source include/explain-no-costs.inc EXPLAIN FORMAT=JSON SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq WHERE i IN ( SELECT MIN(j) FROM t2 ); @@ -1288,6 +1383,7 @@ CREATE OR REPLACE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t1; INSERT INTO t1 VALUES (2), (1); SELECT * FROM v1 WHERE NULLIF(1, i); +--source include/explain-no-costs.inc EXPLAIN FORMAT=JSON SELECT * FROM v1 WHERE NULLIF(1, i); @@ -1306,6 +1402,7 @@ CREATE TABLE t2 (c VARCHAR(3)); INSERT INTO t2 VALUES ('foo'),('xyz'); SELECT * FROM v1 WHERE v1.c IN ( SELECT MIN(c) FROM t2 WHERE 0 ); +--source include/explain-no-costs.inc EXPLAIN FORMAT=JSON SELECT * FROM v1 WHERE v1.c IN ( SELECT MIN(c) FROM t2 WHERE 0 ); @@ -1340,7 +1437,9 @@ PREPARE stmt1 FROM PREPARE stmt2 FROM "EXPLAIN FORMAT=JSON SELECT * FROM v1 WHERE 1 IN (SELECT a FROM t2) OR c = 'foo'"; +--source include/explain-no-costs.inc EXECUTE stmt1; +--source include/explain-no-costs.inc EXECUTE stmt2; INSERT INTO t2 SELECT a+1 FROM t2; INSERT INTO t2 SELECT a+1 FROM t2; @@ -1348,7 +1447,9 @@ INSERT INTO t2 SELECT a+1 FROM t2; INSERT INTO t2 SELECT a+1 FROM t2; INSERT INTO t2 SELECT a+1 FROM t2; INSERT INTO t2 SELECT a+1 FROM t2; +--source include/explain-no-costs.inc EXECUTE stmt1; +--source include/explain-no-costs.inc EXECUTE stmt2; DEALLOCATE PREPARE stmt1; # the result here will change after the merge with the fix for mdev-11859 @@ -1485,6 +1586,7 @@ from ( select t1.a, v1.b, v1.s from t1, v1 where t1.a = v1.b ) as t where b > 2; eval $q1; +--source include/explain-no-costs.inc eval explain format=json $q1; let $q2= @@ -1493,6 +1595,7 @@ from ( select t1.a, v1.b, v1.s from t1, v1 where t1.a = v1.b ) as t where a > 2; eval $q2; +--source include/explain-no-costs.inc eval explain format=json $q2; let $q3= @@ -1501,6 +1604,7 @@ from ( select t1.a, v2.b, v2.c from t1, v2 where t1.a = v2.b ) as t where a > 2; eval $q3; +--source include/explain-no-costs.inc eval explain format=json $q3; let $q4= @@ -1509,6 +1613,7 @@ from ( select t1.a, v3.b, v3.m from t1, v3 where t1.a = v3.m ) as t where a > 2; eval $q4; +--source include/explain-no-costs.inc eval explain format=json $q4; drop view v1,v2,v3; @@ -1526,6 +1631,7 @@ let $q= SELECT * FROM ( SELECT * FROM v1 ) AS sq WHERE f > 0; eval $q; +--source include/explain-no-costs.inc eval explain format=json $q; DROP VIEW v1; @@ -1548,6 +1654,7 @@ SELECT * FROM t1, ( SELECT * FROM v2 ) AS sq WHERE i1 = 1 AND ( i1 = i2 OR i1 = 2 ); eval $q; +--source include/explain-no-costs.inc eval explain format=json $q; DROP VIEW v2; @@ -1566,6 +1673,7 @@ from ( select distinct regexp_substr(t1.a,'^[A-Za-z]+') as f from t1) as t where t.f = 'a' or t.f = 'b'; eval $q; +--source include/explain-no-costs.inc eval explain format=json $q; drop table t1; @@ -1589,6 +1697,7 @@ SELECT * FROM t1 WHERE (vc.ct>0); eval $q; +--source include/explain-no-costs.inc eval EXPLAIN FORMAT=JSON $q; DROP TABLE t1,t2; @@ -1619,6 +1728,7 @@ WHERE (v1.a=1) AND (v1.b=v1.a) AND (v1.a=t2.x) AND (v1.max_c>30); eval $query; eval EXPLAIN $query; +--source include/explain-no-costs.inc eval EXPLAIN FORMAT=JSON $query; let $query= @@ -1634,6 +1744,7 @@ WHERE (v1.a=1) AND (v1.b=v1.a) AND (v1.b=v1.d) AND (v1.a=t2.x) AND (v1.max_c>30); eval $query; eval EXPLAIN $query; +--source include/explain-no-costs.inc eval EXPLAIN FORMAT=JSON $query; DROP TABLE t1,t2; @@ -1676,6 +1787,7 @@ WHERE (t1.a,t1.b) IN ; eval $query; eval EXPLAIN $query; +--source include/explain-no-costs.inc eval EXPLAIN FORMAT=JSON $query; let $query= @@ -1694,6 +1806,7 @@ WHERE (t1.a,t1.b) IN ; eval $query; eval EXPLAIN $query; +--source include/explain-no-costs.inc eval EXPLAIN FORMAT=JSON $query; let $query= @@ -1712,6 +1825,7 @@ WHERE (t1.a,t1.b) IN ; eval $query; eval EXPLAIN $query; +--source include/explain-no-costs.inc eval EXPLAIN FORMAT=JSON $query; let $query= @@ -1730,6 +1844,7 @@ WHERE (t1.a,t1.b) IN ; eval $query; eval EXPLAIN $query; +--source include/explain-no-costs.inc eval EXPLAIN FORMAT=JSON $query; DROP TABLE t1,t2; @@ -1768,6 +1883,7 @@ SELECT * FROM ) dt WHERE (dt.a=2); eval $query; +--source include/explain-no-costs.inc eval EXPLAIN FORMAT=JSON $query; let $query= @@ -1780,6 +1896,7 @@ SELECT * FROM ) dt WHERE (dt.a>1); eval $query; +--source include/explain-no-costs.inc eval EXPLAIN FORMAT=JSON $query; let $query= @@ -1791,6 +1908,7 @@ SELECT * FROM ) dt WHERE (dt.a='ab'); eval $query; +--source include/explain-no-costs.inc eval EXPLAIN FORMAT=JSON $query; let $query= @@ -1802,6 +1920,7 @@ SELECT * FROM ) dt WHERE (dt.a=1); eval $query; +--source include/explain-no-costs.inc eval EXPLAIN FORMAT=JSON $query; DROP TABLE t1; @@ -1830,6 +1949,7 @@ JOIN ) AS dt2 ON dt1.a = dt2.a; eval $query; +--source include/explain-no-costs.inc eval EXPLAIN FORMAT=JSON $query; let $query= @@ -1841,6 +1961,7 @@ SELECT * FROM ) AS dt, t1 WHERE dt.a=t1.a AND dt.a IN (1,t1.a); eval $query; +--source include/explain-no-costs.inc eval EXPLAIN FORMAT=JSON $query; DROP TABLE t1; @@ -1943,6 +2064,7 @@ let $q1= INSERT INTO t3 SELECT * FROM (SELECT a, count(*) as c FROM t1 GROUP BY a) t WHERE a<=2; +--source include/explain-no-costs.inc eval EXPLAIN FORMAT=JSON $q1; eval $q1; @@ -1952,6 +2074,7 @@ let $q2= UPDATE t2, (SELECT a, count(*) as c FROM t1 GROUP BY a) t SET t2.a=t.c+10 WHERE t2.a= t.c and t.a>=3; +--source include/explain-no-costs.inc eval EXPLAIN FORMAT=JSON $q2; eval $q2; @@ -1961,6 +2084,7 @@ let $q3= DELETE t2 FROM t2, (SELECT a, count(*) as c FROM t1 GROUP BY a) t WHERE t2.a= t.c+9 and t.a=2; +--source include/explain-no-costs.inc eval EXPLAIN FORMAT=JSON $q3; eval $q3; @@ -1986,6 +2110,7 @@ FROM ) AS tab1 WHERE (tab1.max_a=1); EVAL $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; LET $query= @@ -1998,6 +2123,7 @@ FROM ) AS tab1 WHERE (tab1.max_a=1); EVAL $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; LET $query= @@ -2010,6 +2136,7 @@ FROM ) AS tab1 WHERE (tab1.max_a=1); EVAL $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; LET $query= @@ -2022,6 +2149,7 @@ FROM ) AS tab1 WHERE (tab1.max_a=1); EVAL $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; DROP TABLE t1; @@ -2061,6 +2189,7 @@ SELECT * FROM ( SELECT t1.f FROM v1 JOIN t1 ) AS t WHERE f IS NOT NULL; eval $q1; eval EXPLAIN $q1; +--source include/explain-no-costs.inc eval EXPLAIN FORMAT=JSON $q1; SELECT * FROM t1; @@ -2073,6 +2202,7 @@ SELECT * FROM ( SELECT t1.f FROM v1 JOIN t1 ON v1.f=t1.f) AS t WHERE f IS NOT NULL; eval $q2; +--source include/explain-no-costs.inc eval EXPLAIN FORMAT=JSON $q2; SELECT * FROM t1; @@ -2093,6 +2223,7 @@ CREATE VIEW v1 AS SELECT f2 FROM ( SELECT f2 FROM t1 ) AS t; let $q1 = UPDATE v1, t1 SET t1.f1 = 'z' WHERE v1.f2 < 2 AND t1.f2 = v1.f2; eval $q1; +--source include/explain-no-costs.inc eval EXPLAIN FORMAT=JSON $q1; SELECT * FROM t1; @@ -2101,6 +2232,7 @@ CREATE VIEW v2 AS SELECT f2 FROM ( SELECT DISTINCT f2 FROM t1 ) AS t; let $q2 = SELECT * FROM v2, t1 WHERE v2.f2 < 2 AND t1.f2 = v2.f2; eval $q2; +--source include/explain-no-costs.inc eval EXPLAIN FORMAT=JSON $q2; DROP VIEW v1,v2; @@ -2136,6 +2268,7 @@ CREATE TABLE t1 (a INT, b INT); CREATE VIEW v1 AS SELECT a, MAX(b) FROM t1 GROUP BY a; SELECT * FROM (SELECT 1 FROM v1 UNION (SELECT 1 FROM v1 WHERE @a := uuid())) dt; +--source include/explain-no-costs.inc EXPLAIN FORMAT=JSON SELECT * FROM (SELECT 1 FROM v1 UNION (SELECT 1 FROM v1 WHERE @a := uuid())) dt; @@ -2280,6 +2413,7 @@ select col2, col1 from v2; explain select * from v3 where col1=123; --echo # This must use ref accesses for reading table t1, not full scans: +--source include/explain-no-costs.inc explain format=json select * from v3 where col1=123 and col2=321; @@ -2303,6 +2437,7 @@ select a, f1(a), sum(b) from t1 group by a, f1(a); --echo # "a > 1" will be pushed all the way to the table scan on t1 --echo # "a2>123" will be pushed into HAVING (as it refers to an SP call which --echo # prevents pushing it to the WHERE) +--source include/explain-no-costs.inc explain format=json select * from v2 where (s+1) > 10 AND a > 1 and a2>123; @@ -2315,6 +2450,7 @@ insert into t4 select a,a,a from t1; --echo # The subquery must be materialized and must have --echo # "attached_condition": "t1.a + 1 > 10", --echo # "having_condition": "`f1(a)` > 1 and `sum(b)` > 123", +--source include/explain-no-costs.inc explain format=json select * from t4 @@ -2359,6 +2495,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (v1.a<5); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using intersect in view definition @@ -2368,6 +2505,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (v1.a=8); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using intersect in view definition @@ -2376,6 +2514,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (t2.a=8); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using intersect in view definition @@ -2384,6 +2523,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (v1.c>200); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using intersect in view definition @@ -2393,6 +2533,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (v1.a<5) and (v1.c>110); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using intersect in view definition @@ -2402,6 +2543,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using intersect in view definition @@ -2412,6 +2554,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using intersect in view definition @@ -2425,6 +2568,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using intersect in view definition @@ -2456,6 +2600,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; drop view v1; @@ -2473,6 +2618,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (v1.a<5); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using except in view definition @@ -2482,6 +2628,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (v1.a=6); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using except in view definition @@ -2490,6 +2637,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (t2.a=6); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using except in view definition @@ -2498,6 +2646,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (v1.c>500); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using except in view definition @@ -2507,6 +2656,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (v1.a<5) and (v1.c>500); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using except in view definition @@ -2516,6 +2666,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using except in view definition @@ -2526,6 +2677,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using except in view definition @@ -2540,6 +2692,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --echo # using except in view definition @@ -2571,6 +2724,7 @@ let $query= eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; drop view v1; @@ -2591,6 +2745,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (v1.a>5) and (v1.c>200); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; drop view v1; @@ -2611,6 +2766,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (v1.a>4) and (v1.c<200); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; drop view v1; @@ -2631,6 +2787,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (v1.a>5) and (v1.c>200); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; drop view v1; @@ -2651,6 +2808,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (v1.a>4) and (v1.c<200); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; drop view v1; @@ -2671,6 +2829,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (v1.a>4) and (v1.c<150); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; drop view v1; @@ -2691,6 +2850,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (v1.a>4) and (v1.c<130); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; drop view v1; @@ -2714,6 +2874,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (v1.a>4) and (v1.c<130); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; drop view v1; @@ -2736,6 +2897,7 @@ let $query= select * from v2,t2 where (v2.a=t2.a) and (v2.a>4) and (v2.c<150); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; drop view v1,v2; @@ -2758,6 +2920,7 @@ let $query= select * from v2,t2 where (v2.a=t2.a) and (v2.a>4) and (v2.c<150); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; drop view v1,v2; @@ -2776,6 +2939,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (v1.a>4) and (v1.b>12) and eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; drop view v1; @@ -2794,6 +2958,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (v1.a<2) and (v1.b<30) and eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; drop view v1; @@ -2814,6 +2979,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and ((v1.a<2) or (v1.a<5)) and eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; drop view v1; @@ -2835,6 +3001,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (v1.a>1) and (v1.b > 12) a eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; drop view v1; @@ -2858,6 +3025,7 @@ let $query= select * from v1,t2 where (v1.b=t2.b) and (v1.a<5); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; drop view v1; @@ -2876,6 +3044,7 @@ let $query= select * from v1,t2 where (v1.b=t2.b) and (v1.a<4); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; drop view v1; @@ -2894,6 +3063,7 @@ let $query= select * from v1,t2 where (v1.b=t2.b) and (v1.a<3); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; drop view v1; @@ -2930,6 +3100,7 @@ eval $no_pushdown $q1; --sorted_result eval $q1; eval explain $q1; +--source include/explain-no-costs.inc eval explain format=json $q1; let $q2= @@ -2946,6 +3117,7 @@ eval $no_pushdown $q2; --sorted_result eval $q2; eval explain $q2; +--source include/explain-no-costs.inc eval explain format=json $q2; let $q3= @@ -2956,6 +3128,7 @@ from (select a, c, sum(b) over (partition by a,c) as s from t2) as t, t1 eval $no_pushdown $q3; eval $q3; eval explain $q3; +--source include/explain-no-costs.inc eval explain format=json $q3; let $q4= @@ -2974,6 +3147,7 @@ eval $no_pushdown $q4; --sorted_result eval $q4; eval explain $q4; +--source include/explain-no-costs.inc eval explain format=json $q4; let $q5= @@ -2988,6 +3162,7 @@ eval $no_pushdown $q5; --sorted_result eval $q5; eval explain $q5; +--source include/explain-no-costs.inc eval explain format=json $q5; let $q6= @@ -3002,6 +3177,7 @@ eval $no_pushdown $q6; --sorted_result eval $q6; eval explain $q6; +--source include/explain-no-costs.inc eval explain format=json $q6; let $q7= @@ -3016,6 +3192,7 @@ eval $no_pushdown $q7; --sorted_result eval $q7; eval explain $q7; +--source include/explain-no-costs.inc eval explain format=json $q7; drop table t1,t2; @@ -3063,6 +3240,7 @@ where t1.b < 3; eval $no_splitting $q1; eval $q1; eval explain extended $q1; +--source include/explain-no-costs.inc eval explain format=json $q1; eval prepare stmt from "$q1"; execute stmt; @@ -3079,6 +3257,7 @@ where t1.b <= 5; eval $no_splitting $q10; eval $q10; eval explain extended $q10; +--source include/explain-no-costs.inc eval explain format=json $q10; eval prepare stmt from "$q10"; execute stmt; @@ -3096,6 +3275,7 @@ from t1 left join eval $no_splitting $q2; eval $q2; eval explain extended $q2; +--source include/explain-no-costs.inc eval explain format=json $q2; create table t3 (a int, b int, c char(127), index idx_b(b)) engine=myisam; @@ -3125,6 +3305,7 @@ where t3.b > 15; eval $no_splitting $q3; eval $q3; eval explain extended $q3; +--source include/explain-no-costs.inc eval explain format=json $q3; let $q30= @@ -3137,6 +3318,7 @@ where t3.b <= 15; eval $no_splitting $q30; eval $q30; eval explain extended $q30; +--source include/explain-no-costs.inc eval explain format=json $q30; let $q4= @@ -3149,6 +3331,7 @@ where t3.b > 15; eval $no_splitting $q4; eval $q4; eval explain extended $q4; +--source include/explain-no-costs.inc eval explain format=json $q4; let $q40= @@ -3161,6 +3344,7 @@ where t3.b <= 15; eval $no_splitting $q40; eval $q40; eval explain extended $q40; +--source include/explain-no-costs.inc eval explain format=json $q40; drop index idx_a on t2; @@ -3184,6 +3368,7 @@ eval $no_splitting $q5; --sorted_result eval $q5; eval explain extended $q5; +--source include/explain-no-costs.inc eval explain format=json $q5; let $q50= @@ -3194,6 +3379,7 @@ where t2.b < 40 and t2.a=t3.a and t3.c=t.c; eval $no_splitting $q50; eval $q50; eval explain extended $q50; +--source include/explain-no-costs.inc eval explain format=json $q50; let $q6= @@ -3206,6 +3392,7 @@ eval $no_splitting $q6; --sorted_result eval $q6; eval explain extended $q6; +--source include/explain-no-costs.inc eval explain format=json $q6; let $q60= @@ -3218,6 +3405,7 @@ eval $no_splitting $q60; --sorted_result eval $q60; eval explain extended $q60; +--source include/explain-no-costs.inc eval explain format=json $q60; drop table t1,t2,t3,t4; @@ -3254,6 +3442,7 @@ SELECT * FROM t4 WHERE c IN ( SELECT c FROM v1 ) and a < 2; eval $no_splitting $q1; eval $q1; eval explain extended $q1; +--source include/explain-no-costs.inc eval explain format=json $q1; DROP VIEW v1; @@ -3333,6 +3522,7 @@ SELECT * FROM t1 INNER JOIN v2 ON pk1 = pk2 WHERE f <> 5; eval $q; eval EXPLAIN EXTENDED $q; +--source include/explain-no-costs.inc eval EXPLAIN FORMAT=JSON $q; DROP VIEW v2; @@ -3616,11 +3806,13 @@ select * from t1, (select a from t1 cp2 group by a) dt, t3 set optimizer_switch="split_materialized=off"; eval $q; eval explain $q; +--source include/explain-no-costs.inc eval explain format=json $q; set optimizer_switch="split_materialized=default"; eval $q; eval explain $q; +--source include/explain-no-costs.inc eval explain format=json $q; eval prepare stmt from "$q"; @@ -3723,6 +3915,7 @@ set optimizer_switch='split_materialized=on'; eval $q; eval EXPLAIN $q; +--source include/explain-no-costs.inc eval EXPLAIN FORMAT=JSON $q; set optimizer_switch='split_materialized=off'; @@ -3831,6 +4024,7 @@ WHERE charges.to_ledger_id = 2; set optimizer_switch='split_materialized=on'; eval $q; eval EXPLAIN $q; +--source include/explain-no-costs.inc eval EXPLAIN FORMAT=JSON $q; set optimizer_switch='split_materialized=off'; @@ -3863,6 +4057,7 @@ WHERE charges.to_ledger_id = 2; set optimizer_switch='split_materialized=on'; eval $q1; eval EXPLAIN $q1; +--source include/explain-no-costs.inc eval EXPLAIN FORMAT=JSON $q1; set optimizer_switch='split_materialized=off'; diff --git a/mysql-test/main/derived_view.result b/mysql-test/main/derived_view.result index 9ff457bd2e0..695f627c172 100644 --- a/mysql-test/main/derived_view.result +++ b/mysql-test/main/derived_view.result @@ -381,12 +381,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 11, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.f2 in (2,3) and t2.f2 is not null" } @@ -401,10 +403,12 @@ EXPLAIN "used_key_parts": ["f1"], "ref": ["test.t2.f2"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.f1", "temporary_table": { @@ -414,6 +418,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 11, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.f1 in (2,3)" } @@ -485,16 +490,19 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived2>", "access_type": "ALL", "rows": 11, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "filesort": { "sort_key": "tt.f1", "temporary_table": { @@ -504,11 +512,13 @@ EXPLAIN "table_name": "<derived3>", "access_type": "ALL", "rows": 11, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "tt.f1 > 2", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.f1", "temporary_table": { @@ -518,6 +528,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 11, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.f1 < 7 and t1.f1 > 2" } @@ -566,17 +577,20 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived3>", "access_type": "ALL", "rows": 11, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "tt.f1 > 2 and tt.f1 > 2 and tt.f1 is not null", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.f1", "temporary_table": { @@ -586,6 +600,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 11, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.f1 < 7 and t1.f1 > 2 and t1.f1 > 2" } @@ -607,10 +622,12 @@ EXPLAIN "used_key_parts": ["f1"], "ref": ["tt.f1"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 5, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.f1", "temporary_table": { @@ -620,6 +637,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 11, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.f1 < 7 and t1.f1 > 2 and t1.f1 > 2" } @@ -707,17 +725,20 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived2>", "access_type": "ALL", "rows": 11, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "x.f1 is not null", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "filesort": { "sort_key": "tt.f1", "temporary_table": { @@ -727,11 +748,13 @@ EXPLAIN "table_name": "<derived3>", "access_type": "ALL", "rows": 11, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "tt.f1 > 2", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.f1", "temporary_table": { @@ -741,6 +764,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 11, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.f1 < 7 and t1.f1 > 2" } @@ -769,10 +793,12 @@ EXPLAIN "used_key_parts": ["f1"], "ref": ["x.f1"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 4, + "cost": "COST_REPLACED", "filesort": { "sort_key": "tt.f1", "temporary_table": { @@ -782,11 +808,13 @@ EXPLAIN "table_name": "<derived5>", "access_type": "ALL", "rows": 11, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "tt.f1 > 2", "materialized": { "query_block": { "select_id": 5, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.f1", "temporary_table": { @@ -796,6 +824,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 11, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.f1 < 7 and t1.f1 > 2" } @@ -853,17 +882,20 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived3>", "access_type": "ALL", "rows": 11, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.f1 < 7", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.f1", "temporary_table": { @@ -873,6 +905,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 11, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.f1 < 7" } @@ -939,12 +972,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 11, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.f2 < 7 and t2.f2 in (2,3) and t2.f2 is not null" } @@ -959,10 +994,12 @@ EXPLAIN "used_key_parts": ["f1"], "ref": ["test.t2.f2"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 5, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.f1", "temporary_table": { @@ -972,6 +1009,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 11, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.f1 < 7 and t1.f1 in (2,3)" } diff --git a/mysql-test/main/derived_view.test b/mysql-test/main/derived_view.test index c511b8febc9..13444676659 100644 --- a/mysql-test/main/derived_view.test +++ b/mysql-test/main/derived_view.test @@ -118,6 +118,7 @@ select * from t1 join v2 on f1=f2; show status like 'Handler_read%'; explain extended select * from v1 join v4 on f1=f2; +--source include/explain-no-costs.inc explain format=json select * from v1 join v4 on f1=f2; select * from v1 join v4 on f1=f2; @@ -142,6 +143,7 @@ select * from (select * from --echo materialized derived in materialized derived explain extended select * from (select * from (select * from t1 where f1 < 7 group by f1) tt where f1 > 2 group by f1) zz; +--source include/explain-no-costs.inc explain format=json select * from (select * from (select * from t1 where f1 < 7 group by f1) tt where f1 > 2 group by f1) zz; select * from (select * from @@ -153,6 +155,7 @@ explain extended select * from join (select * from (select * from t1 where f1 < 7 group by f1) tt where f1 > 2) z on x.f1 = z.f1; +--source include/explain-no-costs.inc explain format=json select * from (select * from (select * from t1 where f1 < 7 group by f1) tt where f1 > 2) x join @@ -194,6 +197,7 @@ join (select * from (select * from t1 where f1 < 7 group by f1) tt where f1 > 2 group by f1) z on x.f1 = z.f1; +--source include/explain-no-costs.inc explain format=json select * from (select * from (select * from t1 where f1 < 7 group by f1) tt where f1 > 2 group by f1) x @@ -218,6 +222,7 @@ select * from (select * from v4 group by 1) tt; --echo materialized view in merged derived explain extended select * from ( select * from v1 where f1 < 7) tt; +--source include/explain-no-costs.inc explain format=json select * from ( select * from v1 where f1 < 7) tt; select * from ( select * from v1 where f1 < 7) tt; @@ -234,6 +239,7 @@ select * from (select * from v7 group by 1) tt; --echo join of above two explain extended select * from v6 join v7 on f2=f1; +--source include/explain-no-costs.inc explain format=json select * from v6 join v7 on f2=f1; select * from v6 join v7 on f2=f1; diff --git a/mysql-test/main/except.result b/mysql-test/main/except.result index 4d23ca772b3..416c7eab8d4 100644 --- a/mysql-test/main/except.result +++ b/mysql-test/main/except.result @@ -37,12 +37,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 2, + "cost": "REPLACED", "filtered": 100 } } @@ -53,12 +55,14 @@ EXPLAIN "query_block": { "select_id": 2, "operation": "EXCEPT", + "cost": "REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 2, + "cost": "REPLACED", "filtered": 100 } } @@ -85,6 +89,7 @@ ANALYZE { "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -95,6 +100,7 @@ ANALYZE "r_loops": 1, "rows": 2, "r_rows": 2, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -108,6 +114,7 @@ ANALYZE "query_block": { "select_id": 2, "operation": "EXCEPT", + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -118,6 +125,7 @@ ANALYZE "r_loops": 1, "rows": 2, "r_rows": 2, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -139,6 +147,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -149,6 +158,7 @@ ANALYZE "r_loops": 1, "rows": 2, "r_rows": 1, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -164,6 +174,7 @@ ANALYZE { "query_block": { "select_id": 2, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -174,6 +185,7 @@ ANALYZE "r_loops": 1, "rows": 2, "r_rows": 2, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -187,6 +199,7 @@ ANALYZE "query_block": { "select_id": 3, "operation": "EXCEPT", + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -197,6 +210,7 @@ ANALYZE "r_loops": 1, "rows": 2, "r_rows": 2, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -281,12 +295,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 2, + "cost": "REPLACED", "filtered": 100 } }, @@ -296,6 +312,7 @@ EXPLAIN "table_name": "t3", "access_type": "ALL", "rows": 2, + "cost": "REPLACED", "filtered": 100 }, "buffer_type": "flat", @@ -310,12 +327,14 @@ EXPLAIN "query_block": { "select_id": 2, "operation": "EXCEPT", + "cost": "REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 2, + "cost": "REPLACED", "filtered": 100 } }, @@ -325,6 +344,7 @@ EXPLAIN "table_name": "t4", "access_type": "ALL", "rows": 2, + "cost": "REPLACED", "filtered": 100 }, "buffer_type": "flat", @@ -355,6 +375,7 @@ ANALYZE { "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -365,6 +386,7 @@ ANALYZE "r_loops": 1, "rows": 2, "r_rows": 2, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -379,6 +401,7 @@ ANALYZE "r_loops": 1, "rows": 2, "r_rows": 2, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -398,6 +421,7 @@ ANALYZE "query_block": { "select_id": 2, "operation": "EXCEPT", + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -408,6 +432,7 @@ ANALYZE "r_loops": 1, "rows": 2, "r_rows": 2, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -422,6 +447,7 @@ ANALYZE "r_loops": 1, "rows": 2, "r_rows": 2, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -450,6 +476,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -460,6 +487,7 @@ ANALYZE "r_loops": 1, "rows": 4, "r_rows": 3, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -475,6 +503,7 @@ ANALYZE { "query_block": { "select_id": 2, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -485,6 +514,7 @@ ANALYZE "r_loops": 1, "rows": 2, "r_rows": 2, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -499,6 +529,7 @@ ANALYZE "r_loops": 1, "rows": 2, "r_rows": 2, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -518,6 +549,7 @@ ANALYZE "query_block": { "select_id": 3, "operation": "EXCEPT", + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -528,6 +560,7 @@ ANALYZE "r_loops": 1, "rows": 2, "r_rows": 2, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -542,6 +575,7 @@ ANALYZE "r_loops": 1, "rows": 2, "r_rows": 2, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, diff --git a/mysql-test/main/except.test b/mysql-test/main/except.test index 090826ce94d..d253b288d3b 100644 --- a/mysql-test/main/except.test +++ b/mysql-test/main/except.test @@ -11,6 +11,7 @@ insert into t2 values (2,2),(3,3); EXPLAIN (select a,b from t1) except (select c,d from t2); EXPLAIN extended (select a,b from t1) except (select c,d from t2); EXPLAIN extended select * from ((select a,b from t1) except (select c,d from t2)) a; +--source include/analyze-format.inc EXPLAIN format=json (select a,b from t1) except (select c,d from t2); --source include/analyze-format.inc @@ -43,6 +44,7 @@ insert into t4 values (4,4),(7,7); EXPLAIN (select a,b,e,f from t1,t3) except (select c,d,g,h from t2,t4); EXPLAIN (select a,b,e,f from t1,t3) except (select c,d,g,h from t2,t4); EXPLAIN extended select * from ((select a,b,e,f from t1,t3) except (select c,d,g,h from t2,t4)) a; +--source include/analyze-format.inc EXPLAIN format=json (select a,b,e,f from t1,t3) except (select c,d,g,h from t2,t4); --source include/analyze-format.inc diff --git a/mysql-test/main/except_all.result b/mysql-test/main/except_all.result index e62062d0427..522ed7cedfc 100644 --- a/mysql-test/main/except_all.result +++ b/mysql-test/main/except_all.result @@ -65,12 +65,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 7, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -81,12 +83,14 @@ EXPLAIN "query_block": { "select_id": 2, "operation": "EXCEPT", + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 7, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -120,6 +124,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -130,6 +135,7 @@ ANALYZE "r_loops": 1, "rows": 7, "r_rows": 4, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -145,6 +151,7 @@ ANALYZE { "query_block": { "select_id": 2, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -155,6 +162,7 @@ ANALYZE "r_loops": 1, "rows": 7, "r_rows": 7, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -168,6 +176,7 @@ ANALYZE "query_block": { "select_id": 3, "operation": "EXCEPT", + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -178,6 +187,7 @@ ANALYZE "r_loops": 1, "rows": 7, "r_rows": 7, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -204,6 +214,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -214,6 +225,7 @@ ANALYZE "r_loops": 1, "rows": 7, "r_rows": 4, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -229,6 +241,7 @@ ANALYZE { "query_block": { "select_id": 2, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -239,6 +252,7 @@ ANALYZE "r_loops": 1, "rows": 7, "r_rows": 7, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -252,6 +266,7 @@ ANALYZE "query_block": { "select_id": 3, "operation": "EXCEPT", + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -262,6 +277,7 @@ ANALYZE "r_loops": 1, "rows": 7, "r_rows": 7, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -387,12 +403,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived2>", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { @@ -403,12 +421,14 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -418,6 +438,7 @@ EXPLAIN "table_name": "t3", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 }, "buffer_type": "flat", @@ -432,12 +453,14 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "EXCEPT", + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -447,6 +470,7 @@ EXPLAIN "table_name": "t4", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 }, "buffer_type": "flat", @@ -482,6 +506,7 @@ ANALYZE { "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -492,6 +517,7 @@ ANALYZE "r_loops": 1, "rows": 3, "r_rows": 3, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -506,6 +532,7 @@ ANALYZE "r_loops": 1, "rows": 3, "r_rows": 3, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -525,6 +552,7 @@ ANALYZE "query_block": { "select_id": 2, "operation": "EXCEPT", + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -535,6 +563,7 @@ ANALYZE "r_loops": 1, "rows": 2, "r_rows": 2, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -549,6 +578,7 @@ ANALYZE "r_loops": 1, "rows": 3, "r_rows": 3, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -576,6 +606,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -586,6 +617,7 @@ ANALYZE "r_loops": 1, "rows": 9, "r_rows": 7, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -601,6 +633,7 @@ ANALYZE { "query_block": { "select_id": 2, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -611,6 +644,7 @@ ANALYZE "r_loops": 1, "rows": 3, "r_rows": 3, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -625,6 +659,7 @@ ANALYZE "r_loops": 1, "rows": 3, "r_rows": 3, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -644,6 +679,7 @@ ANALYZE "query_block": { "select_id": 3, "operation": "EXCEPT", + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -654,6 +690,7 @@ ANALYZE "r_loops": 1, "rows": 2, "r_rows": 2, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -668,6 +705,7 @@ ANALYZE "r_loops": 1, "rows": 3, "r_rows": 3, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, diff --git a/mysql-test/main/except_all.test b/mysql-test/main/except_all.test index f873b220126..9f788f52dea 100644 --- a/mysql-test/main/except_all.test +++ b/mysql-test/main/except_all.test @@ -16,6 +16,7 @@ select * from t1 except all select * from t1 union all select * from t1 union al select * from (select * from t1 except all select * from t2) q1 except all select * from (select * from t1 except all select * from t2) q2; EXPLAIN select * from t1 except all select * from t2; +--source include/explain-no-costs.inc EXPLAIN format=json select * from t1 except all select * from t2; EXPLAIN extended (select * from t1) except all (select * from t2); EXPLAIN extended select * from ((select * from t1) except all (select * from t2)) a; @@ -53,6 +54,7 @@ select * from ((select a,b,e,f from t1,t3) except all (select c,d,g,h from t2,t4 EXPLAIN (select a,b,e,f from t1,t3) except all (select c,d,g,h from t2,t4); EXPLAIN select * from ((select a,b,e,f from t1,t3) except all (select c,d,g,h from t2,t4)) t; EXPLAIN extended select * from ((select a,b,e,f from t1,t3) except all (select c,d,g,h from t2,t4)) t; +--source include/explain-no-costs.inc EXPLAIN format=json select * from ((select a,b,e,f from t1,t3) except all (select c,d,g,h from t2,t4)) t; --source include/analyze-format.inc @@ -96,4 +98,4 @@ INSERT INTO t VALUES (1),(2); SELECT * FROM t WHERE i != ANY ( SELECT 3 EXCEPT ALL SELECT 3 ); -drop table t;
\ No newline at end of file +drop table t; diff --git a/mysql-test/main/explain_json.result b/mysql-test/main/explain_json.result index d2a8f38c33e..96bf828a5cc 100644 --- a/mysql-test/main/explain_json.result +++ b/mysql-test/main/explain_json.result @@ -6,12 +6,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t0", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -33,12 +35,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t0", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t0.a < 3" } @@ -59,12 +63,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t0", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t0.a is not null" } @@ -79,6 +85,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t0.a"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -93,6 +100,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -103,6 +111,7 @@ EXPLAIN "key_length": "5", "used_key_parts": ["a1"], "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "index_condition": "t2.a1 < 5" } @@ -115,6 +124,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -139,6 +149,7 @@ EXPLAIN ] }, "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a1 = 1 or t2.b1 = 2" } @@ -151,6 +162,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -175,6 +187,7 @@ EXPLAIN ] }, "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a1 = 1 or t2.b1 = 2 and t2.b2 = 3" } @@ -188,6 +201,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -212,6 +226,7 @@ EXPLAIN ] }, "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a1 = 1 and t2.a2 = 1 or t2.b1 = 2 and t2.b2 = 1" } @@ -225,12 +240,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t0", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t0.a is not null" } @@ -245,6 +262,7 @@ EXPLAIN "used_key_parts": ["b1", "b2"], "ref": ["test.t0.a", "const"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -266,12 +284,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "A", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -282,12 +302,14 @@ EXPLAIN "query_block": { "select_id": 2, "operation": "UNION", + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "B", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -307,12 +329,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "A", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -323,12 +347,14 @@ EXPLAIN "query_block": { "select_id": 2, "operation": "UNION", + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "B", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -349,12 +375,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t0", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -365,12 +393,14 @@ EXPLAIN "state": "uninitialized", "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b = t0.a" } @@ -389,12 +419,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t0", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t0.a > (subquery#2) or t0.a < 3" } @@ -406,12 +438,14 @@ EXPLAIN "state": "uninitialized", "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b = t0.a" } @@ -435,12 +469,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "tbl1", "access_type": "ALL", "rows": 100, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "tbl1.b < 3" } @@ -451,6 +487,7 @@ EXPLAIN "table_name": "tbl2", "access_type": "ALL", "rows": 100, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "tbl2.b < 5" }, @@ -538,12 +575,14 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t0", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -566,17 +605,20 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "<derived2>", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "tbl.cnt > 0", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "cnt > 0", "filesort": { "sort_key": "t1.a", @@ -587,6 +629,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -607,12 +650,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "tbl2", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "tbl2.a is not null" } @@ -627,11 +672,13 @@ EXPLAIN "used_key_parts": ["cnt"], "ref": ["test.tbl2.a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "tbl1.cnt = tbl2.a", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a", "temporary_table": { @@ -641,6 +688,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -663,12 +711,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a is not null" } @@ -683,11 +733,13 @@ EXPLAIN "used_key_parts": ["max(a)"], "ref": ["test.t1.a"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "temporary_table": { "nested_loop": [ { @@ -695,6 +747,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -718,12 +771,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -752,6 +807,7 @@ EXPLAIN "key_length": "8", "used_key_parts": ["seq"], "rows": 100, + "cost": "COST_REPLACED", "filtered": 100, "using_index": true } @@ -767,6 +823,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 }, "buffer_type": "flat", @@ -791,12 +848,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -806,6 +865,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "first_match": "t2" }, @@ -834,12 +894,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -851,6 +913,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 10 }, "buffer_type": "flat", @@ -878,6 +941,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -888,6 +952,7 @@ EXPLAIN "key_length": "5", "used_key_parts": ["a"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "index_condition": "t1.a < 3", "mrr_type": "Rowid-ordered scan" @@ -904,12 +969,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "tbl1", "access_type": "ALL", "rows": 100, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -921,6 +988,7 @@ EXPLAIN "access_type": "ALL", "possible_keys": ["a"], "rows": 100, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -942,6 +1010,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -951,6 +1020,7 @@ EXPLAIN "key_length": "5", "used_key_parts": ["a"], "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "!<in_optimizer>(outer_t1.a,<exists>(subquery#2))", "using_index": true @@ -961,6 +1031,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "trigcond(t1.a is null)", "nested_loop": [ { @@ -974,6 +1045,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["func"], "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "trigcond(<cache>(outer_t1.a) = t1.a or t1.a is null)", "using_index": true @@ -986,6 +1058,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100 }, "buffer_type": "flat", @@ -1017,6 +1090,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "const_condition": "<not>(<in_optimizer>(20000,<max>(subquery#2) >= 20000))", "nested_loop": [ { @@ -1024,6 +1098,7 @@ EXPLAIN "table_name": "t0", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1032,12 +1107,14 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "tbl1", "access_type": "ALL", "rows": 100, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -1047,6 +1124,7 @@ EXPLAIN "table_name": "tbl2", "access_type": "ALL", "rows": 100, + "cost": "COST_REPLACED", "filtered": 100 }, "buffer_type": "flat", @@ -1075,12 +1153,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "!<in_optimizer>(t1.a,<exists>(subquery#2))" } @@ -1090,6 +1170,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "trigcond(t2.b is null)", "nested_loop": [ { @@ -1097,6 +1178,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "trigcond(<cache>(t1.a) = t2.b or t2.b is null)" } @@ -1135,6 +1217,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -1144,6 +1227,7 @@ EXPLAIN "key_length": "10", "used_key_parts": ["a", "b"], "rows": 101, + "cost": "COST_REPLACED", "filtered": 100, "using_index_for_group_by": true } @@ -1159,6 +1243,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -1172,6 +1257,7 @@ ANALYZE "r_loops": 1, "rows": 101, "r_rows": 100, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -1246,6 +1332,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -1255,6 +1342,7 @@ EXPLAIN "key_length": "147", "used_key_parts": ["a1", "a2", "b"], "rows": 17, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b = 'a' and t1.a2 >= 'b'", "using_index_for_group_by": true @@ -1268,6 +1356,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -1277,6 +1366,7 @@ EXPLAIN "key_length": "163", "used_key_parts": ["a1", "a2", "b", "c"], "rows": 128, + "cost": "COST_REPLACED", "filtered": 0.198364258, "attached_condition": "t1.b = 'a' and t1.c = 'i121' and t1.a2 >= 'b'", "using_index": true @@ -1290,6 +1380,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -1300,6 +1391,7 @@ EXPLAIN "key_length": "147", "used_key_parts": ["a1", "a2", "b"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b = 'a' and t1.a1 >= '' and t1.a2 >= 'b'", "using_index_for_group_by": true @@ -1319,12 +1411,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = _latin1'\xDF'" } @@ -1343,12 +1437,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(case when convert(t1.a using utf8mb3) = <cache>(_utf8mb3'a' collate utf8mb3_bin) then NULL else t1.a end)" } @@ -1376,6 +1472,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "TOP > t2.a", "filesort": { "sort_key": "t2.a", @@ -1386,6 +1483,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 256, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1400,6 +1498,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t2.a", "temporary_table": { @@ -1409,6 +1508,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 256, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1434,6 +1534,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t2.a", "temporary_table": { @@ -1443,6 +1544,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 256, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1467,6 +1569,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -1511,6 +1614,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "const_condition": "1", "nested_loop": [ { @@ -1528,6 +1632,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1543,6 +1648,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "const_condition": "1", @@ -1567,6 +1673,7 @@ ANALYZE "r_loops": 1, "rows": 2, "r_rows": 2, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -1588,12 +1695,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -1607,6 +1716,7 @@ EXPLAIN "used_key_parts": ["pk"], "ref": ["test.t1.a"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "trigcond(t2.pk is null) and trigcond(trigcond(t1.a is not null))", "using_index": true, @@ -1625,6 +1735,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -1635,6 +1746,7 @@ ANALYZE "r_loops": 1, "rows": 2, "r_rows": 2, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -1653,6 +1765,7 @@ ANALYZE "r_loops": 2, "rows": 1, "r_rows": 1, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -1677,6 +1790,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "temporary_table": { "nested_loop": [ { @@ -1684,6 +1798,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a is not null" } @@ -1698,6 +1813,7 @@ EXPLAIN "used_key_parts": ["pk"], "ref": ["test.t1.a"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "using_index": true, "distinct": true @@ -1716,6 +1832,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "temporary_table": { @@ -1727,6 +1844,7 @@ ANALYZE "r_loops": 1, "rows": 2, "r_rows": 2, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -1746,6 +1864,7 @@ ANALYZE "r_loops": 2, "rows": 1, "r_rows": 1, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -1783,12 +1902,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t3", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t3.a is not null" } @@ -1804,6 +1925,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t3.a"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "index_condition_bka": "t4.b + 1 <= t3.b + 1" }, @@ -1825,6 +1947,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -1835,6 +1958,7 @@ ANALYZE "r_loops": 1, "rows": 10, "r_rows": 10, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -1855,6 +1979,7 @@ ANALYZE "r_loops": 1, "rows": 1, "r_rows": 10, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -1888,12 +2013,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t0", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1904,6 +2031,7 @@ EXPLAIN "state": "uninitialized", "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "outer_ref_condition": "t0.a < 5", "nested_loop": [ { @@ -1911,6 +2039,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b < t0.a" } @@ -1933,6 +2062,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "read_sorted_file": { @@ -1942,6 +2072,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1955,6 +2086,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "read_sorted_file": { @@ -1964,6 +2096,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1977,6 +2110,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "read_sorted_file": { @@ -1986,6 +2120,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -2007,12 +2142,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t0", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -2024,6 +2161,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100 }, "buffer_type": "flat", @@ -2038,6 +2176,7 @@ EXPLAIN "table_name": "t3", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 25 }, "buffer_type": "incremental", diff --git a/mysql-test/main/explain_json.test b/mysql-test/main/explain_json.test index be077b22f48..6403fdefdd7 100644 --- a/mysql-test/main/explain_json.test +++ b/mysql-test/main/explain_json.test @@ -11,10 +11,13 @@ drop table if exists t0,t1,t2; create table t0(a int); insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +--source include/explain-no-costs.inc explain format=json select * from t0; +--source include/explain-no-costs.inc explain format=json select * from t0 where 1>2; +--source include/explain-no-costs.inc explain format=json select * from t0 where a<3; --echo # Try a basic join @@ -26,22 +29,28 @@ select 'filler' from t0 a, t0 b, t0 c; +--source include/explain-no-costs.inc explain format=json select * from t0,t1 where t1.a=t0.a; --echo # Try range and index_merge create table t2 (a1 int, a2 int, b1 int, b2 int, key(a1,a2), key(b1,b2)); insert into t2 select a,a,a,a from t1; +--source include/explain-no-costs.inc explain format=json select * from t2 where a1<5; +--source include/explain-no-costs.inc explain format=json select * from t2 where a1=1 or b1=2; +--source include/explain-no-costs.inc explain format=json select * from t2 where a1=1 or (b1=2 and b2=3); +--source include/explain-no-costs.inc explain format=json select * from t2 where (a1=1 and a2=1) or (b1=2 and b2=1); --echo # Try ref access on two key components +--source include/explain-no-costs.inc explain format=json select * from t0,t2 where t2.b1=t0.a and t2.b2=4; drop table t1,t2; @@ -49,7 +58,9 @@ drop table t1,t2; --echo # --echo # Try a UNION --echo # +--source include/explain-no-costs.inc explain format=json select * from t0 A union select * from t0 B; +--source include/explain-no-costs.inc explain format=json select * from t0 A union all select * from t0 B; --echo # @@ -57,8 +68,10 @@ explain format=json select * from t0 A union all select * from t0 B; --echo # create table t1 (a int, b int); insert into t1 select a,a from t0; +--source include/explain-no-costs.inc explain format=json select a, a > (select max(b) from t1 where t1.b=t0.a) from t0; +--source include/explain-no-costs.inc explain format=json select * from t0 where a > (select max(b) from t1 where t1.b=t0.a) or a < 3 ; @@ -71,6 +84,7 @@ drop table t1; create table t1 (a int, b int); insert into t1 select tbl1.a+10*tbl2.a, tbl1.a+10*tbl2.a from t0 tbl1, t0 tbl2; +--source include/explain-no-costs.inc explain format=json select * from t1 tbl1, t1 tbl2 where tbl1.a=tbl2.a and tbl1.b < 3 and tbl2.b < 5; @@ -79,16 +93,22 @@ drop table t1; --echo # --echo # Single-table UPDATE/DELETE, INSERT --echo # +--source include/explain-no-costs.inc explain format=json delete from t0; +--source include/explain-no-costs.inc explain format=json delete from t0 where 1 > 2; +--source include/explain-no-costs.inc explain format=json delete from t0 where a < 3; +--source include/explain-no-costs.inc explain format=json update t0 set a=3 where a in (2,3,4); +--source include/explain-no-costs.inc explain format=json insert into t0 values (1); create table t1 like t0; +--source include/explain-no-costs.inc explain format=json insert into t1 values ((select max(a) from t0)); drop table t1; @@ -98,10 +118,12 @@ drop table t1; --echo # create table t1 (a int, b int); insert into t1 select a,a from t0; +--source include/explain-no-costs.inc explain format=json select * from (select a, count(*) as cnt from t1 group by a) as tbl where cnt>0; +--source include/explain-no-costs.inc explain format=json select * from (select a, count(*) as cnt from t1 group by a) as tbl1, t1 as tbl2 where cnt=tbl2.a; @@ -109,6 +131,7 @@ tbl2 where cnt=tbl2.a; --echo # --echo # Non-merged semi-join (aka JTBM) --echo # +--source include/explain-no-costs.inc explain format=json select * from t1 where a in (select max(a) from t1 group by b); @@ -117,6 +140,7 @@ select * from t1 where a in (select max(a) from t1 group by b); --echo # create table t2 like t1; insert into t2 select * from t1; +--source include/explain-no-costs.inc explain format=json select * from t1,t2 where t1.a in ( select seq+0 from seq_1_to_100); @@ -125,6 +149,7 @@ select * from t1,t2 where t1.a in ( select seq+0 from seq_1_to_100); --echo # explain select * from t2 where t2.a in ( select a from t1 where t1.b=t2.b); +--source include/explain-no-costs.inc explain format=json select * from t2 where t2.a in ( select a from t1 where t1.b=t2.b); @@ -135,6 +160,7 @@ set @tmp= @@optimizer_switch; set optimizer_switch='firstmatch=off'; explain select * from t2 where t2.a in ( select a from t1 where t1.b=t2.b); +--source include/explain-no-costs.inc explain format=json select * from t2 where t2.a in ( select a from t1 where t1.b=t2.b); set optimizer_switch=@tmp; @@ -149,10 +175,12 @@ insert into t1 select tbl1.a+10*tbl2.a, 12345 from t0 tbl1, t0 tbl2; set @tmp= @@optimizer_switch; set optimizer_switch='mrr=on,mrr_sort_keys=on'; +--source include/explain-no-costs.inc explain format=json select * from t1 where a < 3; --echo # 'Range checked for each record' set optimizer_switch=@tmp; +--source include/explain-no-costs.inc explain format=json select * from t1 tbl1, t1 tbl2 where tbl2.a < tbl1.b; @@ -169,6 +197,7 @@ INSERT INTO t1 VALUES (1),(2),(5),(6),(7); CREATE TABLE t2 (b INT); INSERT INTO t2 VALUES (3),(4),(9),(10),(11); +--source include/explain-no-costs.inc EXPLAIN FORMAT=JSON SELECT * FROM t1 AS outer_t1 WHERE a <> ALL ( SELECT a FROM t1, t2 WHERE b <> outer_t1.a ); DROP TABLE t1,t2; @@ -182,6 +211,7 @@ insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); create table t1(a int, b int); insert into t1 select tbl1.a+10*tbl2.a, 1234 from t0 tbl1, t0 tbl2; +--source include/explain-no-costs.inc explain format=json select * from t0 where @@ -200,6 +230,7 @@ INSERT INTO t1 VALUES (1),(2); CREATE TABLE t2 (b INT); INSERT INTO t2 VALUES (3),(4); +--source include/explain-no-costs.inc EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE a <> ALL ( SELECT b FROM t2 ); DROP TABLE t1, t2; @@ -221,6 +252,7 @@ insert into t2 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); create table t1 (a int, b int, c int, d int, key(a,b,c)); insert into t1 select A.a, B.a, C.a, D.a from t2 A, t2 B, t2 C, t2 D; explain select count(distinct b) from t1 group by a; +--source include/explain-no-costs.inc explain format=json select count(distinct b) from t1 group by a; --source include/analyze-format.inc analyze format=json select count(distinct b) from t1 group by a; @@ -278,10 +310,13 @@ explain select count(distinct a1,a2,b) from t1 where (a2 >= 'b') and (b = 'a'); explain select count(distinct a1,a2,b,c) from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121'); explain select count(distinct a1,a2,b) from t1 where a1 >= "" and (a2 >= 'b') and (b = 'a'); +--source include/explain-no-costs.inc explain format=json select count(distinct a1,a2,b) from t1 where (a2 >= 'b') and (b = 'a'); +--source include/explain-no-costs.inc explain format=json select count(distinct a1,a2,b,c) from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121'); +--source include/explain-no-costs.inc explain format=json select count(distinct a1,a2,b) from t1 where a1 >= "" and (a2 >= 'b') and (b = 'a'); drop table t1; @@ -290,6 +325,7 @@ drop table t1; --echo # CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1); INSERT INTO t1 VALUES ('a'),('b'); +--source include/explain-no-costs.inc EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE a=_latin1 0xDF; DROP TABLE t1; @@ -298,6 +334,7 @@ DROP TABLE t1; --echo # CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1); INSERT INTO t1 VALUES ('a'),('A'); +--source include/explain-no-costs.inc EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE NULLIF(a,_utf8'a' COLLATE utf8_bin); DROP TABLE t1; @@ -315,12 +352,16 @@ create table t2 ( ); insert into t2 select A.a*1000 + B.a, A.a*1000 + B.a from t0 A, t1 B; --echo # normal HAVING +--source include/explain-no-costs.inc explain format=json select a, max(b) as TOP from t2 group by a having TOP > a; --echo # HAVING is always TRUE (not printed) +--source include/explain-no-costs.inc explain format=json select a, max(b) as TOP from t2 group by a having 1<>2; --echo # HAVING is always FALSE (intercepted by message) +--source include/explain-no-costs.inc explain format=json select a, max(b) as TOP from t2 group by a having 1=2; --echo # HAVING is absent +--source include/explain-no-costs.inc explain format=json select a, max(b) as TOP from t2 group by a; drop table t0, t1, t2; @@ -332,6 +373,7 @@ drop table t0, t1, t2; create table t1 (i int) engine=myisam; explain select * from t1; +--source include/explain-no-costs.inc explain format=json select * from t1; --source include/analyze-format.inc @@ -348,6 +390,7 @@ insert into t2 values (1),(2); explain select * from t1 left join t2 on t2.pk > 10 and t2.pk < 0; +--source include/explain-no-costs.inc explain format=json select * from t1 left join t2 on t2.pk > 10 and t2.pk < 0; --source include/analyze-format.inc @@ -357,6 +400,7 @@ select * from t1 left join t2 on t2.pk > 10 and t2.pk < 0; --echo # Check ET_NOT_EXISTS: explain select * from t1 left join t2 on t2.pk=t1.a where t2.pk is null; +--source include/explain-no-costs.inc explain format=json select * from t1 left join t2 on t2.pk=t1.a where t2.pk is null; --source include/analyze-format.inc @@ -366,6 +410,7 @@ select * from t1 left join t2 on t2.pk=t1.a where t2.pk is null; --echo # Check ET_DISTINCT explain select distinct t1.a from t1 join t2 on t2.pk=t1.a; +--source include/explain-no-costs.inc explain format=json select distinct t1.a from t1 join t2 on t2.pk=t1.a; --source include/analyze-format.inc @@ -392,6 +437,7 @@ set optimizer_switch='mrr=on'; set join_cache_level=6; explain select * from t3,t4 where t3.a=t4.a and (t4.b+1 <= t3.b+1); +--source include/explain-no-costs.inc explain format=json select * from t3,t4 where t3.a=t4.a and (t4.b+1 <= t3.b+1); --source include/analyze-format.inc @@ -410,6 +456,7 @@ insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); create table t1 (a int, b int); insert into t1 select a,a from t0; +--source include/explain-no-costs.inc explain format=json select a, (select max(a) from t1 where t0.a<5 and t1.b<t0.a) from t0; drop table t0,t1; @@ -420,8 +467,11 @@ drop table t0,t1; create table t1 (a int, b int); insert into t1 values (1,2),(3,4),(2,3); +--source include/explain-no-costs.inc explain format=json select * from t1 order by a, b desc; +--source include/explain-no-costs.inc explain format=json select * from t1 order by a desc, b desc; +--source include/explain-no-costs.inc explain format=json select * from t1 order by a desc, b ; drop table t1; @@ -431,6 +481,7 @@ drop table t1; CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (1),(2); +--source include/explain-no-costs.inc explain FORMAT=JSON SELECT * FROM t1 t0 WHERE t0.a IN (SELECT t2.a FROM t1 t2 WHERE t0.a IN (SELECT t3.a FROM t1 t3)); @@ -448,4 +499,4 @@ INSERT INTO t2 VALUES ('00:13:41',8),('00:13:42',9); SET optimizer_trace = 'enabled=on'; SELECT * FROM t1 WHERE a IN ( SELECT b FROM t2 INNER JOIN t1 ON (a = pk) ); -DROP TABLE t1, t2;
\ No newline at end of file +DROP TABLE t1, t2; diff --git a/mysql-test/main/explain_json_format_partitions.result b/mysql-test/main/explain_json_format_partitions.result index b76fe29625e..e2cf420c906 100644 --- a/mysql-test/main/explain_json_format_partitions.result +++ b/mysql-test/main/explain_json_format_partitions.result @@ -12,6 +12,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -19,6 +20,7 @@ EXPLAIN "partitions": ["p0"], "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a in (2,3,4)" } @@ -34,6 +36,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -45,6 +48,7 @@ ANALYZE "r_loops": 1, "rows": 10, "r_rows": 10, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, diff --git a/mysql-test/main/explain_json_format_partitions.test b/mysql-test/main/explain_json_format_partitions.test index 4c7d3f165d1..17972838777 100644 --- a/mysql-test/main/explain_json_format_partitions.test +++ b/mysql-test/main/explain_json_format_partitions.test @@ -7,6 +7,7 @@ create table t1 ( ) partition by key(a); insert into t1 select a from t2; explain partitions select * from t1 where a in (2,3,4); +--source include/explain-no-costs.inc explain format=json select * from t1 where a in (2,3,4); --source include/analyze-format.inc analyze format=json select * from t1 where a in (2,3,4); diff --git a/mysql-test/main/explain_json_innodb.result b/mysql-test/main/explain_json_innodb.result index 9d2529471ae..04b05a4b8c0 100644 --- a/mysql-test/main/explain_json_innodb.result +++ b/mysql-test/main/explain_json_innodb.result @@ -16,12 +16,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -30,12 +32,14 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "tbl_alias1", "access_type": "ALL", "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "tbl_alias1.column_name_2 is not null and tbl_alias1.column_name_1 is not null" } @@ -53,6 +57,7 @@ EXPLAIN "test.tbl_alias1.column_name_1" ], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "tbl_alias2.c = tbl_alias1.column_name_2" } diff --git a/mysql-test/main/explain_json_innodb.test b/mysql-test/main/explain_json_innodb.test index f70df5d5349..68e5ab8198d 100644 --- a/mysql-test/main/explain_json_innodb.test +++ b/mysql-test/main/explain_json_innodb.test @@ -20,6 +20,7 @@ INSERT INTO t2 VALUES (3,'United States'); CREATE TABLE t3 (b INT, c VARCHAR(3), PRIMARY KEY (c,b)) ENGINE=InnoDB; INSERT INTO t3 VALUES (4,'USA'),(5,'CAN'); +--source include/explain-no-costs.inc EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE 0 < ALL ( SELECT tbl_alias1.column_name_1 FROM t2 AS tbl_alias1, t3 AS tbl_alias2 WHERE tbl_alias2.b = tbl_alias1.column_name_1 AND tbl_alias2.c = tbl_alias1.column_name_2 diff --git a/mysql-test/main/fetch_first.result b/mysql-test/main/fetch_first.result index e92bb1fdcf1..00d7857f4b4 100644 --- a/mysql-test/main/fetch_first.result +++ b/mysql-test/main/fetch_first.result @@ -447,6 +447,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -467,6 +468,7 @@ ANALYZE "r_loops": 1, "rows": 8, "r_rows": 8, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, diff --git a/mysql-test/main/having_cond_pushdown.result b/mysql-test/main/having_cond_pushdown.result index 59388aa7ca0..576183d1d8b 100644 --- a/mysql-test/main/having_cond_pushdown.result +++ b/mysql-test/main/having_cond_pushdown.result @@ -34,6 +34,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a", "temporary_table": { @@ -43,6 +44,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 2" } @@ -60,6 +62,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a", "temporary_table": { @@ -69,6 +72,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 2" } @@ -105,12 +109,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 2" } @@ -126,12 +132,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 2" } @@ -168,6 +176,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a", "temporary_table": { @@ -177,6 +186,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 1 and t1.a < 4" } @@ -194,6 +204,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a", "temporary_table": { @@ -203,6 +214,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 1 and t1.a < 4" } @@ -243,6 +255,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a", "temporary_table": { @@ -252,6 +265,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 1 or t1.a = 3" } @@ -271,6 +285,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a", "temporary_table": { @@ -280,6 +295,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 1 or t1.a = 3" } @@ -319,6 +335,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "t1.a > 2 and max(t1.b) > 13 or t1.a < 3 and min(t1.c) > 1", "filesort": { "sort_key": "t1.a", @@ -329,6 +346,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 2 or t1.a < 3" } @@ -347,6 +365,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "t1.a > 2 and max(t1.b) > 13 or t1.a < 3 and min(t1.c) > 1", "filesort": { "sort_key": "t1.a", @@ -357,6 +376,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 2 or t1.a < 3" } @@ -393,6 +413,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "max(t1.a) < 3", "filesort": { "sort_key": "t1.a", @@ -403,6 +424,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 1" } @@ -421,6 +443,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "max(t1.a) < 3", "filesort": { "sort_key": "t1.a", @@ -431,6 +454,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 1" } @@ -466,6 +490,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "max(t1.b) > 13", "filesort": { "sort_key": "t1.a", @@ -476,6 +501,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 1" } @@ -494,6 +520,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "max(t1.b) > 13", "filesort": { "sort_key": "t1.a", @@ -504,6 +531,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 1" } @@ -539,6 +567,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "max(t1.a) = 3", "nested_loop": [ { @@ -546,6 +575,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 3" } @@ -562,6 +592,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "max(t1.a) = 3", "nested_loop": [ { @@ -569,6 +600,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 3" } @@ -602,6 +634,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "max(t1.b) > 12", "nested_loop": [ { @@ -609,6 +642,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 2" } @@ -625,6 +659,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "max(t1.b) > 12", "nested_loop": [ { @@ -632,6 +667,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 2" } @@ -665,6 +701,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "max(t1.b) = 13", "filesort": { "sort_key": "t1.a", @@ -675,6 +712,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 1" } @@ -693,6 +731,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "max(t1.b) = 13", "filesort": { "sort_key": "t1.a", @@ -703,6 +742,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 1" } @@ -740,6 +780,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "min(t1.c) < 3", "filesort": { "sort_key": "t1.a", @@ -750,6 +791,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 1" } @@ -768,6 +810,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "min(t1.c) < 3", "filesort": { "sort_key": "t1.a", @@ -778,6 +821,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 1" } @@ -813,6 +857,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "max(t1.b) = 13 and min(t1.c) = 2", "nested_loop": [ { @@ -820,6 +865,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 2" } @@ -836,6 +882,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "max(t1.b) = 13 and min(t1.c) = 2", "nested_loop": [ { @@ -843,6 +890,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 2" } @@ -877,6 +925,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "t1.a = test.f1()", "filesort": { "sort_key": "t1.a", @@ -887,6 +936,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 1" } @@ -905,6 +955,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "t1.a = test.f1()", "filesort": { "sort_key": "t1.a", @@ -915,6 +966,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 1" } @@ -959,6 +1011,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "v1.a", "temporary_table": { @@ -968,6 +1021,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 4, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.x > 1 and t2.x is not null" } @@ -982,10 +1036,12 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.x"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a", "temporary_table": { @@ -995,6 +1051,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 1" } @@ -1019,6 +1076,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "v1.a", "temporary_table": { @@ -1028,6 +1086,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 4, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.x > 1 and t2.x is not null" } @@ -1042,10 +1101,12 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.x"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a", "temporary_table": { @@ -1055,6 +1116,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 1" } @@ -1106,6 +1168,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "v1.c", "temporary_table": { @@ -1115,6 +1178,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 4, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.x is not null" } @@ -1129,11 +1193,13 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.x"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.c > 2", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "t1.c > 2", "filesort": { "sort_key": "t1.a", @@ -1144,6 +1210,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1167,6 +1234,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "v1.c", "temporary_table": { @@ -1176,6 +1244,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 4, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.x is not null" } @@ -1190,11 +1259,13 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.x"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v1.c > 2", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "t1.c > 2", "filesort": { "sort_key": "t1.a", @@ -1205,6 +1276,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1256,6 +1328,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a", "temporary_table": { @@ -1265,6 +1338,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 1 and t1.a is not null and t1.b is not null" } @@ -1279,11 +1353,13 @@ EXPLAIN "used_key_parts": ["x", "MAX(t2.y)"], "ref": ["test.t1.a", "test.t1.b"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "temporary_table": { "nested_loop": [ { @@ -1291,6 +1367,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 4, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.x < 5 and t2.x > 1" } @@ -1315,6 +1392,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a", "temporary_table": { @@ -1324,6 +1402,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 1 and t1.a is not null and t1.b is not null" } @@ -1338,11 +1417,13 @@ EXPLAIN "used_key_parts": ["x", "MAX(t2.y)"], "ref": ["test.t1.a", "test.t1.b"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "temporary_table": { "nested_loop": [ { @@ -1350,6 +1431,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 4, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.x < 5 and t2.x > 1" } @@ -1399,6 +1481,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.b", "temporary_table": { @@ -1408,6 +1491,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b < 14 and t1.a is not null and t1.b is not null" } @@ -1422,11 +1506,13 @@ EXPLAIN "used_key_parts": ["x", "MAX(t2.y)"], "ref": ["test.t1.a", "test.t1.b"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "`MAX(t2.y)` < 14", "temporary_table": { "nested_loop": [ @@ -1435,6 +1521,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 4, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.x < 5" } @@ -1459,6 +1546,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.b", "temporary_table": { @@ -1468,6 +1556,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b < 14 and t1.a is not null and t1.b is not null" } @@ -1482,11 +1571,13 @@ EXPLAIN "used_key_parts": ["x", "MAX(t2.y)"], "ref": ["test.t1.a", "test.t1.b"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "`MAX(t2.y)` < 14", "temporary_table": { "nested_loop": [ @@ -1495,6 +1586,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 4, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.x < 5" } @@ -1538,6 +1630,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "t1.c = 2", "filesort": { "sort_key": "t1.a", @@ -1548,6 +1641,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 1" } @@ -1565,6 +1659,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "t1.c = 2", "filesort": { "sort_key": "t1.a", @@ -1575,6 +1670,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 1" } @@ -1610,6 +1706,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "t1.a = 2 and t1.c = 2", "nested_loop": [ { @@ -1617,6 +1714,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b = 13" } @@ -1633,6 +1731,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "t1.a = 2 and t1.c = 2", "nested_loop": [ { @@ -1640,6 +1739,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b = 13" } @@ -1674,6 +1774,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a", "temporary_table": { @@ -1683,6 +1784,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.c = t1.a and t1.a > 1" } @@ -1699,6 +1801,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a", "temporary_table": { @@ -1708,6 +1811,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.c = t1.a and t1.a > 1" } @@ -1743,12 +1847,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 2 and t1.c = 2" } @@ -1764,12 +1870,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 2 and t1.c = 2" } @@ -1803,6 +1911,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "t1.c = t1.a and t1.a > 1 or t1.a < 3 and t1.c > 3", "filesort": { "sort_key": "t1.a", @@ -1813,6 +1922,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.c = t1.a and t1.a > 1 or t1.a < 3" } @@ -1831,6 +1941,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "t1.c = t1.a and t1.a > 1 or t1.a < 3 and t1.c > 3", "filesort": { "sort_key": "t1.a", @@ -1841,6 +1952,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.c = t1.a and t1.a > 1 or t1.a < 3" } @@ -1883,6 +1995,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a", "temporary_table": { @@ -1892,6 +2005,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.c = t1.a and t1.a < 3" } @@ -1909,6 +2023,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a", "temporary_table": { @@ -1918,6 +2033,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.c = t1.a and t1.a < 3" } @@ -1958,6 +2074,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a", "temporary_table": { @@ -1967,6 +2084,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.c = t1.a and t1.a > 1 and t1.a < 3" } @@ -1984,6 +2102,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a", "temporary_table": { @@ -1993,6 +2112,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.c = t1.a and t1.a > 1 and t1.a < 3" } @@ -2032,6 +2152,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "t1.a > 1 and max(t1.c) < 3 or t1.c < 4", "filesort": { "sort_key": "t1.a", @@ -2042,6 +2163,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.c = t1.a and (t1.a > 1 or t1.a < 4) and t1.a < 2" } @@ -2060,6 +2182,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "t1.a > 1 and max(t1.c) < 3 or t1.c < 4", "filesort": { "sort_key": "t1.a", @@ -2070,6 +2193,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.c = t1.a and (t1.a > 1 or t1.a < 4) and t1.a < 2" } @@ -2112,6 +2236,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "t1.a > 1 and max(t1.c) < 3 or t1.c < 4", "filesort": { "sort_key": "t1.a", @@ -2122,6 +2247,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.c = t1.a and (t1.a > 1 or t1.a < 4)" } @@ -2140,6 +2266,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "t1.a > 1 and max(t1.c) < 3 or t1.c < 4", "filesort": { "sort_key": "t1.a", @@ -2150,6 +2277,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.c = t1.a and (t1.a > 1 or t1.a < 4)" } @@ -2208,6 +2336,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "t1.b = 13 and max(t1.c) > 2", "filesort": { "sort_key": "t1.a", @@ -2218,6 +2347,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -2234,6 +2364,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "t1.b = 13 and max(t1.c) > 2", "filesort": { "sort_key": "t1.a", @@ -2244,6 +2375,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -2281,6 +2413,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -2290,6 +2423,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(t1.a = 1 or t1.b > 10) and t1.b < 14" } @@ -2307,6 +2441,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -2316,6 +2451,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(t1.a = 1 or t1.b > 10) and t1.b < 14" } @@ -2355,6 +2491,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -2364,6 +2501,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(t1.a = 1 or t1.b > 10) and (t1.b < 14 or t1.b > 15)" } @@ -2381,6 +2519,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -2390,6 +2529,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(t1.a = 1 or t1.b > 10) and (t1.b < 14 or t1.b > 15)" } @@ -2428,6 +2568,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -2437,6 +2578,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(t1.a = 1 or t1.b > 10) and (t1.b < 14 or t1.a = 2 and t1.b > 15)" } @@ -2454,6 +2596,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -2463,6 +2606,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(t1.a = 1 or t1.b > 10) and (t1.b < 14 or t1.a = 2 and t1.b > 15)" } @@ -2503,6 +2647,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -2512,6 +2657,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 2 or t1.b = 13 and t1.a > 2" } @@ -2529,6 +2675,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -2538,6 +2685,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 2 or t1.b = 13 and t1.a > 2" } @@ -2575,6 +2723,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -2584,6 +2733,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b = 14 and t1.a < 2 or t1.b = 13 and t1.a > 2" } @@ -2601,6 +2751,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -2610,6 +2761,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b = 14 and t1.a < 2 or t1.b = 13 and t1.a > 2" } @@ -2649,6 +2801,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -2658,6 +2811,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b = 14 and t1.a < 2 or t1.a > 2 and (t1.b = 13 or t1.b = 14)" } @@ -2675,6 +2829,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -2684,6 +2839,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b = 14 and t1.a < 2 or t1.a > 2 and (t1.b = 13 or t1.b = 14)" } @@ -2719,6 +2875,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "t1.a < 2 and max(t1.c) = 2 or max(t1.c) > 2 and (t1.a = 1 or t1.a = 2)", "filesort": { "sort_key": "t1.a", @@ -2729,6 +2886,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 2 or t1.a = 1 or t1.a = 2" } @@ -2747,6 +2905,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "t1.a < 2 and max(t1.c) = 2 or max(t1.c) > 2 and (t1.a = 1 or t1.a = 2)", "filesort": { "sort_key": "t1.a", @@ -2757,6 +2916,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 2 or t1.a = 1 or t1.a = 2" } @@ -2794,6 +2954,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "t1.a = 2 and max(t1.c) = 2 or max(t1.c) > 2 and (t1.a = 1 or t1.a = 2)", "filesort": { "sort_key": "t1.a", @@ -2804,6 +2965,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 2 or t1.a = 1 or t1.a = 2" } @@ -2822,6 +2984,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "t1.a = 2 and max(t1.c) = 2 or max(t1.c) > 2 and (t1.a = 1 or t1.a = 2)", "filesort": { "sort_key": "t1.a", @@ -2832,6 +2995,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 2 or t1.a = 1 or t1.a = 2" } @@ -2868,6 +3032,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "max(t1.c) = 3", "nested_loop": [ { @@ -2875,6 +3040,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 1" } @@ -2891,6 +3057,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "max(t1.c) = 3", "nested_loop": [ { @@ -2898,6 +3065,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 1" } @@ -2932,6 +3100,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "max(t1.b = 14)", "nested_loop": [ { @@ -2939,6 +3108,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 1 and t1.c = 3" } @@ -2955,6 +3125,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "max(t1.b) = 14", "nested_loop": [ { @@ -2962,6 +3133,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 1 and t1.c = 3" } @@ -2995,6 +3167,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "max(t1.b = 14)", "nested_loop": [ { @@ -3002,6 +3175,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 1 and t1.c = 1" } @@ -3018,6 +3192,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "max(t1.b) = 14", "nested_loop": [ { @@ -3025,6 +3200,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 1 and t1.c = 1" } @@ -3068,6 +3244,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a", "temporary_table": { @@ -3077,6 +3254,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 2 and t1.a < 3" } @@ -3094,6 +3272,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a", "temporary_table": { @@ -3103,6 +3282,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 2 and t1.a < 3" } @@ -3143,12 +3323,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 3 and t1.b > 2" } @@ -3164,12 +3346,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 3 and t1.b > 2" } @@ -3208,6 +3392,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a", "temporary_table": { @@ -3217,6 +3402,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b = 14 and t1.a < 3" } @@ -3234,6 +3420,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a", "temporary_table": { @@ -3243,6 +3430,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b = 14 and t1.a < 3" } @@ -3283,12 +3471,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 1 and t1.b = 14" } @@ -3304,12 +3494,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b = 14 and t1.a = 1" } @@ -3395,12 +3587,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 1 and t1.c = 1" } @@ -3416,12 +3610,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.c = 1 and t1.a = 1" } @@ -3462,6 +3658,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a", "temporary_table": { @@ -3471,6 +3668,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.c > 0 and t1.c < 3 and t1.a > 1" } @@ -3488,6 +3686,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a", "temporary_table": { @@ -3497,6 +3696,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.c > 0 and t1.c < 3 and t1.a > 1" } @@ -3537,12 +3737,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 1 and t1.c > 0 and t1.c < 3" } @@ -3558,12 +3760,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 1 and t1.c > 0 and t1.c < 3" } @@ -3602,6 +3806,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "const_condition": "1", "nested_loop": [ { @@ -3609,6 +3814,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 1 and t1.c < 3" } @@ -3624,12 +3830,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 1 and t1.c < 3" } @@ -3713,12 +3921,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t3", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t3.b = 2 and t3.d = 1 and t3.a = 1" } @@ -3734,12 +3944,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t3", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t3.b = 2 and t3.d = 1 and t3.a = 1" } @@ -3778,6 +3990,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a", "temporary_table": { @@ -3787,6 +4000,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(t1.a > 1 or t1.c < 3) and t1.a < 2" } @@ -3804,6 +4018,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a", "temporary_table": { @@ -3813,6 +4028,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(t1.a > 1 or t1.c < 3) and t1.a < 2" } @@ -3901,6 +4117,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a", "temporary_table": { @@ -3910,6 +4127,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 1 and t1.a < 4 and t1.a > 0" } @@ -3927,6 +4145,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a", "temporary_table": { @@ -3936,6 +4155,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 1 and t1.a < 4 and t1.a > 0" } @@ -3976,6 +4196,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "const_condition": "1 and 1", "nested_loop": [ { @@ -3983,6 +4204,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 1" } @@ -3998,12 +4220,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 1" } @@ -4044,6 +4268,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a", "temporary_table": { @@ -4053,6 +4278,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 1 and (t1.a < 4 or t1.a > 0)" } @@ -4070,6 +4296,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a", "temporary_table": { @@ -4079,6 +4306,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 1 and (t1.a < 4 or t1.a > 0)" } @@ -4119,6 +4347,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "const_condition": "1", "nested_loop": [ { @@ -4126,6 +4355,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 1" } @@ -4141,12 +4371,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 1" } @@ -4187,6 +4419,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "t1.c > 1", "filesort": { "sort_key": "t1.a", @@ -4197,6 +4430,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 1 and t1.c < 3 and t1.a < 4" } @@ -4216,6 +4450,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "t1.c > 1", "filesort": { "sort_key": "t1.a", @@ -4226,6 +4461,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 1 and t1.c < 3 and t1.a < 4" } @@ -4263,6 +4499,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "const_condition": "1", "filesort": { "sort_key": "t1.c", @@ -4273,6 +4510,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 1 and t1.c < 3 and t1.c > 1" } @@ -4291,6 +4529,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.c", "temporary_table": { @@ -4300,6 +4539,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 1 and t1.c < 3 and t1.c > 1" } @@ -4339,6 +4579,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "const_condition": "1 and 1", "nested_loop": [ { @@ -4346,6 +4587,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 1 and t1.c = 3" } @@ -4362,12 +4604,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 1 and t1.c = 3" } @@ -4405,6 +4649,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "t3.d > 0", "nested_loop": [ { @@ -4412,6 +4657,7 @@ EXPLAIN "table_name": "t3", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t3.a = 1 and t3.d = 1 and t3.b = 2" } @@ -4429,6 +4675,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "t3.d > 0", "nested_loop": [ { @@ -4436,6 +4683,7 @@ EXPLAIN "table_name": "t3", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t3.a = 1 and t3.d = 1 and t3.b = 2" } @@ -4473,6 +4721,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "const_condition": "1", "nested_loop": [ { @@ -4480,6 +4729,7 @@ EXPLAIN "table_name": "t3", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t3.a = 1 and t3.d = 1 and t3.b = 2" } @@ -4496,12 +4746,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t3", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t3.a = 1 and t3.d = 1 and t3.b = 2" } @@ -4542,6 +4794,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "t1.c > 1", "filesort": { "sort_key": "t1.a", @@ -4552,6 +4805,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(t1.a > 1 or t1.c < 3) and t1.a < 4" } @@ -4571,6 +4825,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "t1.c > 1", "filesort": { "sort_key": "t1.a", @@ -4581,6 +4836,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(t1.a > 1 or t1.c < 3) and t1.a < 4" } @@ -4624,6 +4880,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a, t1.c", "temporary_table": { @@ -4633,6 +4890,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(t1.a > 1 or t1.c < 3) and t1.a < 4 and t1.c > 1" } @@ -4651,6 +4909,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a, t1.c", "temporary_table": { @@ -4660,6 +4919,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(t1.a > 1 or t1.c < 3) and t1.a < 4 and t1.c > 1" } @@ -4703,6 +4963,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a, t1.c", "temporary_table": { @@ -4712,6 +4973,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(t1.a = 1 or t1.a = 3) and (t1.a = 4 or t1.c > 1)" } @@ -4730,6 +4992,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a, t1.c", "temporary_table": { @@ -4739,6 +5002,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(t1.a = 1 or t1.a = 3) and (t1.a = 4 or t1.c > 1)" } @@ -4779,12 +5043,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 1 and t1.c = 1" } @@ -4800,12 +5066,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 1 and t1.c = 1" } @@ -4844,12 +5112,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 1 and t1.c = 1" } @@ -4866,12 +5136,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 1 and t1.c = 1" } @@ -5051,6 +5323,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t3.a", "temporary_table": { @@ -5060,6 +5333,7 @@ EXPLAIN "table_name": "t3", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t3.d = t3.a and t3.a > 1 and (t3.c = 3 or t3.c < 2) and (t3.a = 1 or t3.a > 1)" } @@ -5078,6 +5352,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t3.a", "temporary_table": { @@ -5087,6 +5362,7 @@ EXPLAIN "table_name": "t3", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t3.d = t3.a and t3.a > 1 and (t3.c = 3 or t3.c < 2) and (t3.a = 1 or t3.a > 1)" } @@ -5125,6 +5401,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t3.a", "temporary_table": { @@ -5134,6 +5411,7 @@ EXPLAIN "table_name": "t3", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t3.d = t3.a and t3.a > 1 and (t3.c = 3 or t3.c < 2) and (t3.c = t3.a and t3.c < 15 or t3.a > 1)" } @@ -5152,6 +5430,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t3.a", "temporary_table": { @@ -5161,6 +5440,7 @@ EXPLAIN "table_name": "t3", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t3.d = t3.a and t3.a > 1 and (t3.c = 3 or t3.c < 2) and (t3.c = t3.a and t3.a < 15 or t3.a > 1)" } @@ -5240,6 +5520,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.d1", "temporary_table": { @@ -5249,6 +5530,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 4, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.d1 between <cache>(inet_aton('1978-04-27')) and <cache>('2018-08-26')" } @@ -5282,6 +5564,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.d1", "temporary_table": { @@ -5291,6 +5574,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.d1 not between <cache>(0) and <cache>(exp(0))" } @@ -5357,6 +5641,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a", "temporary_table": { @@ -5366,6 +5651,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 7, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 8 or t1.a = (subquery#2)" } @@ -5375,12 +5661,14 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -5401,6 +5689,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a, t1.b", "temporary_table": { @@ -5410,6 +5699,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 7, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(t1.a = 8 or t1.a = (subquery#2)) and t1.b < 20" } @@ -5419,12 +5709,14 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -5445,6 +5737,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "sum(t1.b) > 20", "filesort": { "sort_key": "t1.a", @@ -5455,6 +5748,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 7, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 8 or t1.a = (subquery#2)" } @@ -5464,12 +5758,14 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -5490,12 +5786,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 7, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = (subquery#2)" } @@ -5505,12 +5803,14 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100 } } diff --git a/mysql-test/main/having_cond_pushdown.test b/mysql-test/main/having_cond_pushdown.test index 99e4a597f22..be18699519e 100644 --- a/mysql-test/main/having_cond_pushdown.test +++ b/mysql-test/main/having_cond_pushdown.test @@ -23,12 +23,14 @@ HAVING (t1.a>2); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b) FROM t1 WHERE (t1.a>2) GROUP BY t1.a; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # conjunctive subformula : using equality @@ -40,12 +42,14 @@ HAVING (t1.a=2); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b) FROM t1 WHERE (t1.a=2) GROUP BY t1.a; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # extracted AND formula @@ -57,12 +61,14 @@ HAVING (t1.a>1) AND (t1.a<4); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b) FROM t1 WHERE (t1.a>1) AND (t1.a<4) GROUP BY t1.a; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # extracted OR formula @@ -75,6 +81,7 @@ eval $no_pushdown $query; eval $query; --enable_prepare_warnings eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; --disable_prepare_warnings let $query= @@ -83,6 +90,7 @@ FROM t1 WHERE (t1.a>1) OR (a IN (SELECT 3)) GROUP BY t1.a; --enable_prepare_warnings +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --disable_prepare_warnings @@ -94,6 +102,7 @@ HAVING ((t1.a>2) AND (MAX(t1.b)>13)) OR ((t1.a<3) AND (MIN(t1.c)>1)); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b),t1.c @@ -101,6 +110,7 @@ FROM t1 WHERE (t1.a>2) OR (t1.a<3) GROUP BY t1.a HAVING ((t1.a>2) AND (MAX(t1.b)>13)) OR ((t1.a<3) AND (MIN(t1.c)>1)); +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # conjunctive subformula : no aggregation formula pushdown @@ -112,6 +122,7 @@ HAVING (t1.a>1) AND (MAX(t1.a)<3); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b) @@ -119,6 +130,7 @@ FROM t1 WHERE (t1.a>1) GROUP BY t1.a HAVING (MAX(t1.a)<3); +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; let $query= @@ -129,6 +141,7 @@ HAVING (t1.a>1) AND (MAX(t1.b)>13); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b) @@ -136,6 +149,7 @@ FROM t1 WHERE (t1.a>1) GROUP BY t1.a HAVING (MAX(t1.b)>13); +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; let $query= @@ -146,6 +160,7 @@ HAVING (t1.a=3) AND (MAX(t1.a)=3); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b) @@ -153,6 +168,7 @@ FROM t1 WHERE (t1.a=3) GROUP BY t1.a HAVING (MAX(t1.a)=3); +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; let $query= @@ -163,6 +179,7 @@ HAVING (t1.a=2) AND (MAX(t1.b)>12); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b) @@ -170,6 +187,7 @@ FROM t1 WHERE (t1.a=2) GROUP BY t1.a HAVING (MAX(t1.b)>12); +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; let $query= @@ -180,6 +198,7 @@ HAVING (t1.a>1) AND (MAX(t1.b)=13); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b) @@ -187,6 +206,7 @@ FROM t1 WHERE (t1.a>1) GROUP BY t1.a HAVING (MAX(t1.b)=13); +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; let $query= @@ -197,6 +217,7 @@ HAVING (t1.a>1) AND (MIN(t1.c)<3); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MIN(t1.c) @@ -204,6 +225,7 @@ FROM t1 WHERE (t1.a>1) GROUP BY t1.a HAVING (MIN(t1.c)<3); +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; let $query= @@ -214,6 +236,7 @@ HAVING (t1.a=2) AND (MAX(t1.b)=13) AND (MIN(t1.c)=2); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MIN(t1.c) @@ -221,6 +244,7 @@ FROM t1 WHERE (t1.a=2) GROUP BY t1.a HAVING (MAX(t1.b)=13) AND (MIN(t1.c)=2); +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # conjunctive subformula : no stored function pushdown @@ -232,6 +256,7 @@ HAVING (t1.a>1) AND (a=test.f1()); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b) @@ -239,6 +264,7 @@ FROM t1 WHERE (t1.a>1) GROUP BY t1.a HAVING (a=test.f1()); +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # conjunctive subformula : pushdown into derived table WHERE clause @@ -251,12 +277,14 @@ HAVING (v1.a>1); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT v1.a FROM t2,v1 WHERE (t2.x=v1.a) AND (v1.a>1) GROUP BY v1.a; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # conjunctive subformula : pushdown into derived table HAVING clause @@ -269,12 +297,14 @@ HAVING (v1.c>2); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT v1.a,v1.c FROM t2,v1 WHERE (t2.x=v1.a) AND (v1.c>2) GROUP BY v1.c; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # conjunctive subformula : pushdown into materialized IN subquery @@ -288,6 +318,7 @@ HAVING (t1.a>1); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT * FROM t1 @@ -295,6 +326,7 @@ WHERE (t1.a>1) AND (t1.a,t1.b) IN (SELECT t2.x,MAX(t2.y) FROM t2 WHERE t2.x<5 GROUP BY t2.x) GROUP BY t1.a; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # conjunctive subformula : pushdown into materialized IN subquery @@ -308,6 +340,7 @@ HAVING (t1.b<14); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT * FROM t1 @@ -315,6 +348,7 @@ WHERE (t1.b<14) AND (t1.a,t1.b) IN (SELECT t2.x,MAX(t2.y) FROM t2 WHERE t2.x<5 GROUP BY t2.x) GROUP BY t1.b; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # non-standard allowed queries @@ -327,12 +361,14 @@ HAVING (t1.c=2) AND (t1.a>1); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a>1) GROUP BY t1.a HAVING (t1.c=2); +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; let $query= @@ -343,6 +379,7 @@ HAVING (t1.a=2) AND (t1.b=13) AND (t1.c=2); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT MAX(t1.a),t1.a,t1.b,t1.c @@ -350,6 +387,7 @@ FROM t1 WHERE (t1.b=13) GROUP BY t1.b HAVING (t1.a=2) AND (t1.c=2); +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # extracted AND formula : using equalities @@ -361,11 +399,13 @@ HAVING (t1.a=t1.c) AND (t1.c>1); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b) FROM t1 WHERE (t1.a=t1.c) AND (t1.a>1) GROUP BY t1.a; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; let $query= @@ -376,12 +416,14 @@ HAVING (t1.a=t1.c) AND (t1.c=2); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a=t1.c) AND (t1.a=2) GROUP BY t1.a; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; let $query= @@ -392,6 +434,7 @@ HAVING ((t1.a=t1.c) AND (t1.a>1)) OR ((t1.a<3) AND (t1.c>3)); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b),t1.c @@ -399,6 +442,7 @@ FROM t1 WHERE ((t1.a=t1.c) AND (t1.a>1)) OR (t1.a<3) GROUP BY t1.a HAVING ((t1.a=t1.c) AND (t1.a>1)) OR ((t1.a<3) AND (t1.c>3)); +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # conjuctive subformula : pushdown using WHERE multiple equalities @@ -411,12 +455,14 @@ HAVING (t1.c<3); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a=t1.c) AND (t1.c<3) GROUP BY t1.a; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # extracted AND-formula : pushdown using WHERE multiple equalities @@ -429,12 +475,14 @@ HAVING (t1.a>1) AND (t1.c<3); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a=t1.c) AND (t1.a>1) AND (t1.c<3) GROUP BY t1.a; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; let $query= @@ -446,6 +494,7 @@ HAVING (((t1.a>1) AND (MAX(t1.c)<3)) OR (t1.c<4)) AND (t1.a<2); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b),t1.c @@ -453,6 +502,7 @@ FROM t1 WHERE (t1.a=t1.c) AND (((t1.a>1) OR (t1.c<4)) AND (t1.a<2)) GROUP BY t1.a HAVING ((t1.a>1) AND (MAX(t1.c)<3)) OR (t1.c<4); +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # extracted OR-formula : pushdown using WHERE multiple equalities @@ -465,6 +515,7 @@ HAVING ((t1.a>1) AND (MAX(t1.c)<3)) OR (t1.c<4); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b),t1.c @@ -472,6 +523,7 @@ FROM t1 WHERE (t1.a=t1.c) AND ((t1.a>1) OR (t1.c<4)) GROUP BY t1.a HAVING ((t1.a>1) AND (MAX(t1.c)<3)) OR (t1.c<4); +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; DROP TABLE t1,t2; @@ -510,12 +562,14 @@ HAVING t1.b = 13 AND MAX(t1.c) > 2; eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,t1.b,MAX(t1.c) FROM t1 GROUP BY t1.a HAVING t1.b = 13 AND MAX(t1.c) > 2; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # extracted AND formula @@ -527,12 +581,14 @@ HAVING (t1.a = 1 OR t1.b > 10) AND (t1.b < 14); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,t1.b,MAX(t1.c) FROM t1 WHERE (t1.a = 1 OR t1.b > 10) AND (t1.b < 14) GROUP BY t1.a,t1.b; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; let $query= @@ -543,12 +599,14 @@ HAVING (t1.a = 1 OR t1.b > 10) AND (t1.b < 14 OR t1.b > 15); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,t1.b,MAX(t1.c) FROM t1 WHERE (t1.a = 1 OR t1.b > 10) AND (t1.b < 14 OR t1.b > 15) GROUP BY t1.a,t1.b; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # extracted AND formula : equality in the inner AND formula @@ -560,12 +618,14 @@ HAVING (t1.a = 1 OR t1.b > 10) AND (t1.b < 14 OR (t1.b > 15 AND t1.a = 2)); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,t1.b,MAX(t1.c) FROM t1 WHERE (t1.a = 1 OR t1.b > 10) AND (t1.b < 14 OR (t1.b > 15 AND t1.a = 2)) GROUP BY t1.a,t1.b; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # extracted OR formula @@ -577,12 +637,14 @@ HAVING (t1.a < 2) OR (t1.b = 13 AND t1.a > 2); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,t1.b,MAX(t1.c) FROM t1 WHERE (t1.a < 2) OR (t1.b = 13 AND t1.a > 2) GROUP BY t1.a,t1.b; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; let $query= @@ -593,12 +655,14 @@ HAVING (t1.a < 2 AND t1.b = 14) OR (t1.a > 2 AND t1.b = 13); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,t1.b,MAX(t1.c) FROM t1 WHERE (t1.a < 2 AND t1.b = 14) OR (t1.a > 2 AND t1.b = 13) GROUP BY t1.a,t1.b; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; let $query= @@ -609,12 +673,14 @@ HAVING (t1.a < 2 AND t1.b = 14) OR (t1.a > 2 AND (t1.b = 13 OR t1.b = 14)); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,t1.b,MAX(t1.c) FROM t1 WHERE (t1.a < 2 AND t1.b = 14) OR (t1.a > 2 AND (t1.b = 13 OR t1.b = 14)) GROUP BY t1.a,t1.b; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; let $query= @@ -625,6 +691,7 @@ HAVING (t1.a < 2 AND MAX(t1.c) = 2) OR (MAX(t1.c) > 2 AND (t1.a = 1 OR t1.a = 2) eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,t1.b,MAX(t1.c) @@ -632,6 +699,7 @@ FROM t1 WHERE (t1.a < 2) OR (t1.a = 1 OR t1.a = 2) GROUP BY t1.a HAVING (t1.a < 2 AND MAX(t1.c) = 2) OR (MAX(t1.c) > 2 AND (t1.a = 1 OR t1.a = 2)); +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; let $query= @@ -642,6 +710,7 @@ HAVING (t1.a = 2 AND MAX(t1.c) = 2) OR (MAX(t1.c) > 2 AND (t1.a = 1 OR t1.a = 2) eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,t1.b,MAX(t1.c) @@ -649,6 +718,7 @@ FROM t1 WHERE (t1.a = 2) OR (t1.a = 1 OR t1.a = 2) GROUP BY t1.a HAVING (t1.a = 2 AND MAX(t1.c) = 2) OR (MAX(t1.c) > 2 AND (t1.a = 1 OR t1.a = 2)); +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # conjunctive subformula : equality pushdown @@ -660,6 +730,7 @@ HAVING (t1.a = 1) AND (MAX(t1.c) = 3); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,t1.b,MAX(t1.c) @@ -667,6 +738,7 @@ FROM t1 WHERE (t1.a = 1) GROUP BY t1.a HAVING (MAX(t1.c) = 3); +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # conjunctive subformula : equalities pushdown @@ -678,6 +750,7 @@ HAVING (t1.a = 1) AND (t1.c = 3) AND MAX(t1.b = 14); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,t1.b,MAX(t1.c) @@ -685,6 +758,7 @@ FROM t1 WHERE (t1.a = 1) AND (t1.c = 3) GROUP BY t1.a,t1.c HAVING (MAX(t1.b) = 14); +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # conjunctive subformula : multiple equality consists of @@ -697,6 +771,7 @@ HAVING (t1.a = 1) AND (t1.c = 1) AND MAX(t1.b = 14); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,t1.b,MAX(t1.c) @@ -704,6 +779,7 @@ FROM t1 WHERE (t1.a = 1) AND (t1.c = 1) GROUP BY t1.a,t1.c HAVING (MAX(t1.b) = 14); +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # @@ -720,12 +796,14 @@ HAVING (t1.a < 3); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,t1.b,MAX(t1.c) FROM t1 WHERE (t1.b > 2) AND (t1.a < 3) GROUP BY t1.a; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # equality : inequality in WHERE @@ -738,12 +816,14 @@ HAVING (t1.a = 3); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,t1.b,MAX(t1.c) FROM t1 WHERE (t1.b > 2) AND (t1.a = 3) GROUP BY t1.a; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # inequality : equality in WHERE @@ -756,12 +836,14 @@ HAVING (t1.a < 3); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,t1.b,MAX(t1.c) FROM t1 WHERE (t1.b = 14) AND (t1.a < 3) GROUP BY t1.a; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # equality : equality in WHERE @@ -774,12 +856,14 @@ HAVING (t1.a = 1); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,t1.b,MAX(t1.c) FROM t1 WHERE (t1.b = 14) AND (t1.a = 1) GROUP BY t1.a; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # equality : equality in WHERE, impossible WHERE @@ -792,12 +876,14 @@ HAVING (t1.a = 1); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.c) FROM t1 WHERE (t1.a = 3) AND (t1.a = 1) GROUP BY t1.a; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # equality : equality in WHERE (equal through constant) @@ -810,12 +896,14 @@ HAVING (t1.a = 1); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.c = 1) AND (t1.a = 1) GROUP BY t1.a; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # inequality : AND formula in WHERE @@ -828,12 +916,14 @@ HAVING (t1.a > 1); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.c > 0) AND (t1.c < 3) AND (t1.a > 1) GROUP BY t1.a; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # equality : AND formula in WHERE @@ -846,12 +936,14 @@ HAVING (t1.a = 1); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.c > 0) AND (t1.c < 3) AND (t1.a = 1) GROUP BY t1.a; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # equality : AND formula in WHERE, impossible WHERE @@ -864,12 +956,14 @@ HAVING (t1.a = 1); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a > 0) AND (t1.c < 3) AND (t1.a = 1) GROUP BY t1.a; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; let $query= @@ -881,12 +975,14 @@ HAVING (t1.a = 1); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b) FROM t1 WHERE (t1.a = 0) AND (t1.a = 3) AND (t1.a = 1) GROUP BY t1.a; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; let $query= @@ -898,12 +994,14 @@ HAVING (t3.a = 1); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t3.a,t3.b,MAX(t3.c),t3.d FROM t3 WHERE (t3.b = 2) AND (t3.d = 1) AND (t3.a = 1) GROUP BY t3.a,t3.b,t3.d; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # inequality : OR formula in WHERE @@ -916,12 +1014,14 @@ HAVING (t1.a < 2); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE ((t1.a > 1) OR (t1.c < 3)) AND (t1.a < 2) GROUP BY t1.a; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; let $query= @@ -933,12 +1033,14 @@ HAVING (t1.a = 2); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b) FROM t1 WHERE ((t1.a = 1) OR (t1.a = 3)) AND (t1.a = 2) GROUP BY t1.a; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # AND formula : inequality in WHERE @@ -951,12 +1053,14 @@ HAVING (t1.a < 4) AND (t1.a > 0); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a > 1) AND (t1.a < 4) AND (t1.a > 0) GROUP BY t1.a; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # AND formula : equality in WHERE @@ -969,12 +1073,14 @@ HAVING (t1.a < 4) AND (t1.a > 0); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a = 1) AND (t1.a < 4) AND (t1.a > 0) GROUP BY t1.a; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # OR formula : inequality in WHERE @@ -987,12 +1093,14 @@ HAVING (t1.a < 4) OR (t1.a > 0); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a > 1) AND ((t1.a < 4) OR (t1.a > 0)) GROUP BY t1.a; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # OR formula : equality in WHERE @@ -1005,12 +1113,14 @@ HAVING (t1.a < 4) OR (t1.a > 0); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a = 1) AND ((t1.a < 4) OR (t1.a > 0)) GROUP BY t1.a; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # AND formula : AND formula in WHERE @@ -1023,6 +1133,7 @@ HAVING (t1.a < 4) AND (t1.c > 1); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b),t1.c @@ -1031,6 +1142,7 @@ WHERE ((t1.a > 1) AND (t1.c < 3)) AND (t1.a < 4) GROUP BY t1.a HAVING (t1.c > 1); +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; let $query= @@ -1042,6 +1154,7 @@ HAVING (t1.a < 4) AND (t1.c > 1); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b),t1.c @@ -1049,6 +1162,7 @@ FROM t1 WHERE ((t1.a = 1) AND (t1.c < 3)) AND ((t1.a < 4) AND (t1.c > 1)) GROUP BY t1.a,t1.c; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; let $query= @@ -1060,6 +1174,7 @@ HAVING (t1.a < 4) AND (t1.c > 1); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b),t1.c @@ -1067,6 +1182,7 @@ FROM t1 WHERE ((t1.a = 1) AND (t1.c = 3)) AND ((t1.a < 4) AND (t1.c > 1)) GROUP BY t1.a,t1.c; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; let $query= @@ -1078,6 +1194,7 @@ HAVING (t3.b = 2) AND (t3.d > 0); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t3.a,t3.b,MAX(t3.c),t3.d @@ -1086,6 +1203,7 @@ WHERE (t3.a = 1) AND (t3.d = 1) AND (t3.b = 2) GROUP BY t3.a,t3.b HAVING (t3.d > 0); +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; let $query= @@ -1097,6 +1215,7 @@ HAVING (t3.b = 2) AND (t3.d > 0); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t3.a,t3.b,MAX(t3.c),t3.d @@ -1104,6 +1223,7 @@ FROM t3 WHERE (t3.a = 1) AND (t3.d = 1) AND (t3.b = 2) AND (t3.d > 0) GROUP BY t3.a,t3.b,t3.d; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # AND formula : OR formula in WHERE @@ -1116,6 +1236,7 @@ HAVING (t1.a < 4) AND (t1.c > 1); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b),t1.c @@ -1124,6 +1245,7 @@ WHERE ((t1.a > 1) OR (t1.c < 3)) AND (t1.a < 4) GROUP BY t1.a HAVING (t1.c > 1); +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; let $query= @@ -1135,6 +1257,7 @@ HAVING (t1.a < 4) AND (t1.c > 1); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b),t1.c @@ -1142,6 +1265,7 @@ FROM t1 WHERE ((t1.a > 1) OR (t1.c < 3)) AND (t1.a < 4) AND (t1.c > 1) GROUP BY t1.a,t1.c; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; let $query= @@ -1153,6 +1277,7 @@ HAVING (t1.a = 4) OR (t1.c > 1); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b),t1.c @@ -1160,6 +1285,7 @@ FROM t1 WHERE ((t1.a = 1) OR (t1.a = 3)) AND ((t1.a = 4) OR (t1.c > 1)) GROUP BY t1.a,t1.c; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # equality : pushdown through equality in WHERE @@ -1172,12 +1298,14 @@ HAVING (t1.c = 1); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b),t1.c FROM t1 WHERE (t1.a = 1) AND (t1.a = t1.c) AND (t1.c = 1) GROUP BY t1.a; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # OR formula : pushdown through equality @@ -1190,6 +1318,7 @@ HAVING (t1.c = 1) OR (t1.c = 2); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b),t1.c @@ -1197,6 +1326,7 @@ FROM t1 WHERE (t1.a = 1) AND (t1.a = t1.c) AND ((t1.c = 1) OR (t1.c = 2)) GROUP BY t1.a; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # OR formula : pushdown through equality, impossible WHERE @@ -1209,6 +1339,7 @@ HAVING (t1.c = 3) OR (t1.c = 2); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b),t1.c @@ -1216,6 +1347,7 @@ FROM t1 WHERE (t1.a = 1) AND (t1.a = t1.c) AND ((t1.c = 3) OR (t1.c = 2)) GROUP BY t1.a; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # AND formula : pushdown through equality, impossible WHERE @@ -1228,6 +1360,7 @@ HAVING (t1.c = 3) AND (t1.a > 2) AND (t1.a = t1.c); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b),t1.c @@ -1235,6 +1368,7 @@ FROM t1 WHERE (t1.a = 1) AND (t1.c = 3) AND (t1.a > 2) AND (t1.a = t1.c) GROUP BY t1.a,t1.c; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; let $query= @@ -1246,6 +1380,7 @@ HAVING (t1.c = 3) AND (t1.a > 2) AND (t1.a = t1.c); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t1.a,MAX(t1.b),t1.c @@ -1253,6 +1388,7 @@ FROM t1 WHERE (t1.a = 1) AND (t1.c = 3) AND (t1.a > 2) AND (t1.a = t1.c) GROUP BY t1.a; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # AND formula with OR subformula : AND condition in WHERE @@ -1265,6 +1401,7 @@ HAVING (t3.a = t3.d) AND ((t3.d = 1) OR (t3.d > 1)); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t3.a,MAX(t3.c),t3.d @@ -1272,6 +1409,7 @@ FROM t3 WHERE (t3.a > 1) AND ((t3.c = 3) OR (t3.c < 2)) AND (t3.a = t3.d) AND ((t3.d = 1) OR (t3.d > 1)) GROUP BY t3.a; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # AND formula with OR subformula : AND condition in WHERE @@ -1284,6 +1422,7 @@ HAVING (t3.a = t3.d) AND (((t3.d = t3.c) AND (t3.c < 15)) OR (t3.d > 1)); eval $no_pushdown $query; eval $query; eval explain $query; +--source include/explain-no-costs.inc eval explain format=json $query; let $query= SELECT t3.a,t3.b,MAX(t3.c),t3.d @@ -1291,6 +1430,7 @@ FROM t3 WHERE (t3.a > 1) AND ((t3.c = 3) OR (t3.c < 2)) AND (t3.a = t3.d) AND (((t3.d = t3.c) AND (t3.c < 15)) OR (t3.d > 1)) GROUP BY t3.a; +--source include/explain-no-costs.inc eval $no_pushdown explain format=json $query; --echo # prepare statement @@ -1359,6 +1499,7 @@ select d1 from t1 eval $q1; eval explain extended $q1; +--source include/explain-no-costs.inc eval explain format=json $q1; delete from t1; @@ -1371,6 +1512,7 @@ select d1 from t1 eval $q2; eval explain extended $q2; +--source include/explain-no-costs.inc eval explain format=json $q2; drop table t1; @@ -1420,6 +1562,7 @@ INSERT INTO t2 VALUES (2),(3); let $q= SELECT a FROM t1 GROUP BY a HAVING a = 8 OR a = ( SELECT MIN(c) FROM t2 ); +--source include/explain-no-costs.inc eval EXPLAIN FORMAT=JSON $q; eval $q; @@ -1427,6 +1570,7 @@ let $q= SELECT a FROM t1 GROUP BY a,b HAVING ( a = 8 OR a = ( SELECT MIN(c) FROM t2 ) ) and b < 20; +--source include/explain-no-costs.inc eval EXPLAIN FORMAT=JSON $q; eval $q; @@ -1434,12 +1578,14 @@ let $q= SELECT a FROM t1 GROUP BY a HAVING ( a = 8 OR a = ( SELECT MIN(c) FROM t2 ) ) and SUM(b) > 20; +--source include/explain-no-costs.inc eval EXPLAIN FORMAT=JSON $q; eval $q; let $q= SELECT a FROM t1 GROUP BY a HAVING a = ( SELECT MIN(c) FROM t2 ); +--source include/explain-no-costs.inc eval EXPLAIN FORMAT=JSON $q; eval $q; diff --git a/mysql-test/main/in_subq_cond_pushdown.result b/mysql-test/main/in_subq_cond_pushdown.result index f114fc6824e..906aed4f485 100644 --- a/mysql-test/main/in_subq_cond_pushdown.result +++ b/mysql-test/main/in_subq_cond_pushdown.result @@ -51,12 +51,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.c < 25 and t1.a is not null and t1.c is not null" } @@ -71,11 +73,13 @@ EXPLAIN "used_key_parts": ["e", "MAX(t2.g)"], "ref": ["test.t1.a", "test.t1.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "`MAX(t2.g)` < 25", "temporary_table": { "nested_loop": [ @@ -84,6 +88,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.e < 5" } @@ -150,12 +155,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.c > 55 and t1.b < 4 and t1.a is not null and t1.b is not null and t1.c is not null" } @@ -170,11 +177,13 @@ EXPLAIN "used_key_parts": ["e", "f", "MAX(t2.g)"], "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "`MAX(t2.g)` > 55 and t2.f < 4", "temporary_table": { "nested_loop": [ @@ -183,6 +192,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.e < 5" } @@ -251,12 +261,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(t1.c > 60 or t1.c < 25) and t1.a is not null and t1.b is not null and t1.c is not null" } @@ -271,11 +283,13 @@ EXPLAIN "used_key_parts": ["e", "f", "MAX(t2.g)"], "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "`MAX(t2.g)` > 60 or `MAX(t2.g)` < 25", "temporary_table": { "nested_loop": [ @@ -284,6 +298,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.e < 5" } @@ -350,12 +365,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(t1.c > 60 or t1.c < 25) and t1.b > 2 and t1.a is not null and t1.b is not null and t1.c is not null" } @@ -370,11 +387,13 @@ EXPLAIN "used_key_parts": ["e", "f", "MAX(t2.g)"], "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "(`MAX(t2.g)` > 60 or `MAX(t2.g)` < 25) and t2.f > 2", "temporary_table": { "nested_loop": [ @@ -383,6 +402,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.e < 5" } @@ -451,12 +471,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(t1.a < 2 or t1.d > 3) and t1.b > 1 and t1.a is not null and t1.b is not null and t1.c is not null" } @@ -471,11 +493,13 @@ EXPLAIN "used_key_parts": ["e", "f", "MAX(t2.g)"], "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "t2.f > 1", "temporary_table": { "nested_loop": [ @@ -484,6 +508,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.e < 5" } @@ -550,12 +575,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.c > 20 and t1.a is not null and t1.c is not null" } @@ -570,11 +597,13 @@ EXPLAIN "used_key_parts": ["v1_x", "MAX(v1_y)"], "ref": ["test.t1.a", "test.t1.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "`MAX(v1_y)` > 20", "temporary_table": { "nested_loop": [ @@ -583,6 +612,7 @@ EXPLAIN "table_name": "t3", "access_type": "ALL", "rows": 8, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t3.x > 1 and t3.x <= 3" } @@ -650,12 +680,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t3", "access_type": "ALL", "rows": 8, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t3.y > 20 and t3.x <= 3 and t3.y is not null" } @@ -666,6 +698,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100 }, "buffer_type": "flat", @@ -684,11 +717,13 @@ EXPLAIN "used_key_parts": ["e", "MAX(t2.g)"], "ref": ["test.t1.a", "test.t3.y"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "`MAX(t2.g)` > 20", "temporary_table": { "nested_loop": [ @@ -697,6 +732,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.e < 5" } @@ -765,12 +801,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 2 and t1.a is not null and t1.c is not null" } @@ -785,11 +823,13 @@ EXPLAIN "used_key_parts": ["e", "MAX(t2.g)"], "ref": ["test.t1.a", "test.t1.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "temporary_table": { "nested_loop": [ { @@ -797,6 +837,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.e < 5 and t2.e < 2" } @@ -865,12 +906,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 2 and t1.a < 5 and t1.a is not null and t1.c is not null" } @@ -885,11 +928,13 @@ EXPLAIN "used_key_parts": ["e", "MAX(t2.g)"], "ref": ["test.t1.a", "test.t1.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "temporary_table": { "nested_loop": [ { @@ -897,6 +942,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.e < 5 and t2.e > 2 and t2.e < 5" } @@ -967,12 +1013,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(t1.a < 2 or t1.a >= 4) and t1.a is not null and t1.c is not null" } @@ -987,11 +1035,13 @@ EXPLAIN "used_key_parts": ["e", "MAX(t2.g)"], "ref": ["test.t1.a", "test.t1.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "temporary_table": { "nested_loop": [ { @@ -999,6 +1049,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.e < 5 and (t2.e < 2 or t2.e >= 4)" } @@ -1065,12 +1116,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(t1.a < 2 or t1.a = 5) and t1.b > 3 and t1.a is not null and t1.b is not null and t1.c is not null" } @@ -1085,11 +1138,13 @@ EXPLAIN "used_key_parts": ["e", "f", "MAX(t2.g)"], "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "temporary_table": { "nested_loop": [ { @@ -1097,6 +1152,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.e < 5 and (t2.e < 2 or t2.e = 5) and t2.f > 3" } @@ -1163,12 +1219,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(t1.a < 2 or t1.a = 5) and t1.b > 3 and t1.a is not null and t1.b is not null and t1.c is not null" } @@ -1183,11 +1241,13 @@ EXPLAIN "used_key_parts": ["e", "f", "MAX(t2.g)"], "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "temporary_table": { "nested_loop": [ { @@ -1195,6 +1255,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.e < 5 and (t2.e < 2 or t2.e = 5) and t2.f > 3" } @@ -1261,12 +1322,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(t1.b < 3 or t1.d > 2) and t1.a < 2 and t1.a is not null and t1.b is not null and t1.c is not null" } @@ -1281,11 +1344,13 @@ EXPLAIN "used_key_parts": ["e", "f", "MAX(t2.g)"], "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "temporary_table": { "nested_loop": [ { @@ -1293,6 +1358,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.e < 5 and t2.e < 2" } @@ -1359,12 +1425,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a = 1 and t1.d = 1 and t1.c is not null" } @@ -1379,17 +1447,20 @@ EXPLAIN "used_key_parts": ["e", "MAX(t2.g)"], "ref": ["const", "test.t1.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.e = 1" } @@ -1455,12 +1526,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.d = t1.a and t1.a > 1 and t1.a is not null and t1.c is not null" } @@ -1475,11 +1548,13 @@ EXPLAIN "used_key_parts": ["e", "MAX(t2.g)"], "ref": ["test.t1.a", "test.t1.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "temporary_table": { "nested_loop": [ { @@ -1487,6 +1562,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.e < 5 and t2.e > 1" } @@ -1551,12 +1627,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 3 and t1.a is not null and t1.c is not null" } @@ -1571,11 +1649,13 @@ EXPLAIN "used_key_parts": ["v1_x", "MAX(v1_y)"], "ref": ["test.t1.a", "test.t1.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "temporary_table": { "nested_loop": [ { @@ -1583,6 +1663,7 @@ EXPLAIN "table_name": "t3", "access_type": "ALL", "rows": 8, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t3.x > 1 and t3.x <= 3 and t3.x < 3" } @@ -1652,12 +1733,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t3", "access_type": "ALL", "rows": 8, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t3.x < 2 and t3.y > 30 and t3.x <= 3 and t3.x is not null" } @@ -1668,6 +1751,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100 }, "buffer_type": "flat", @@ -1686,11 +1770,13 @@ EXPLAIN "used_key_parts": ["e", "MAX(t2.g)"], "ref": ["test.t3.x", "test.t1.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "temporary_table": { "nested_loop": [ { @@ -1698,6 +1784,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.e < 5 and t2.e <= 3" } @@ -1765,12 +1852,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(t1.b < 3 or t1.b = 4) and t1.a < 3 and t1.a is not null and t1.b is not null and t1.c is not null" } @@ -1785,11 +1874,13 @@ EXPLAIN "used_key_parts": ["e", "f", "MAX(t2.g)"], "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "t2.f < 3 or t2.f = 4", "temporary_table": { "nested_loop": [ @@ -1798,6 +1889,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.e < 5 and t2.e < 3" } @@ -1864,12 +1956,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a + t1.c > 41 and t1.a is not null and t1.c is not null" } @@ -1884,11 +1978,13 @@ EXPLAIN "used_key_parts": ["e", "MAX(t2.g)"], "ref": ["test.t1.a", "test.t1.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "t2.e + `MAX(t2.g)` > 41", "temporary_table": { "nested_loop": [ @@ -1897,6 +1993,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.e < 5" } @@ -1965,12 +2062,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.c - t1.a < 35 and t1.a is not null and t1.c is not null" } @@ -1985,11 +2084,13 @@ EXPLAIN "used_key_parts": ["e", "MAX(t2.g)"], "ref": ["test.t1.a", "test.t1.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "`MAX(t2.g)` - t2.e < 35", "temporary_table": { "nested_loop": [ @@ -1998,6 +2099,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.e < 5" } @@ -2064,12 +2166,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.c * t1.a > 100 and t1.a is not null and t1.c is not null" } @@ -2084,11 +2188,13 @@ EXPLAIN "used_key_parts": ["e", "MAX(t2.g)"], "ref": ["test.t1.a", "test.t1.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "`MAX(t2.g)` * t2.e > 100", "temporary_table": { "nested_loop": [ @@ -2097,6 +2203,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.e < 5" } @@ -2167,12 +2274,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.c / t1.a > 30 and t1.a is not null and t1.c is not null" } @@ -2187,11 +2296,13 @@ EXPLAIN "used_key_parts": ["e", "MAX(t2.g)"], "ref": ["test.t1.a", "test.t1.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "`MAX(t2.g)` / t2.e > 30", "temporary_table": { "nested_loop": [ @@ -2200,6 +2311,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.e < 5" } @@ -2266,12 +2378,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.c between 50 and 100 and t1.a is not null and t1.c is not null" } @@ -2286,11 +2400,13 @@ EXPLAIN "used_key_parts": ["e", "MAX(t2.g)"], "ref": ["test.t1.a", "test.t1.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "`MAX(t2.g)` between 50 and 100", "temporary_table": { "nested_loop": [ @@ -2299,6 +2415,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.e < 5" } @@ -2365,12 +2482,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a + t1.b > 5 and t1.a is not null and t1.b is not null and t1.c is not null" } @@ -2385,11 +2504,13 @@ EXPLAIN "used_key_parts": ["e", "f", "MAX(t2.g)"], "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "temporary_table": { "nested_loop": [ { @@ -2397,6 +2518,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.e < 5 and t2.e + t2.f > 5" } @@ -2463,12 +2585,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a - t1.b > 0 and t1.a is not null and t1.b is not null and t1.c is not null" } @@ -2483,11 +2607,13 @@ EXPLAIN "used_key_parts": ["e", "f", "MAX(t2.g)"], "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "temporary_table": { "nested_loop": [ { @@ -2495,6 +2621,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.e < 5 and t2.e - t2.f > 0" } @@ -2561,12 +2688,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a * t1.b > 6 and t1.a is not null and t1.b is not null and t1.c is not null" } @@ -2581,11 +2710,13 @@ EXPLAIN "used_key_parts": ["e", "f", "MAX(t2.g)"], "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "temporary_table": { "nested_loop": [ { @@ -2593,6 +2724,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.e < 5 and t2.e * t2.f > 6" } @@ -2661,12 +2793,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b / t1.a > 2 and t1.a is not null and t1.b is not null and t1.c is not null" } @@ -2681,11 +2815,13 @@ EXPLAIN "used_key_parts": ["e", "f", "MAX(t2.g)"], "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "temporary_table": { "nested_loop": [ { @@ -2693,6 +2829,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.e < 5 and t2.f / t2.e > 2" } @@ -2765,12 +2902,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a between 1 and 3 and t1.a is not null and t1.c is not null" } @@ -2785,11 +2924,13 @@ EXPLAIN "used_key_parts": ["e", "MAX(t2.g)"], "ref": ["test.t1.a", "test.t1.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "temporary_table": { "nested_loop": [ { @@ -2797,6 +2938,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.e < 5 and t2.e between 1 and 3" } @@ -2867,12 +3009,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.c > 3 and t1.a is not null and t1.b is not null and t1.c is not null" } @@ -2887,11 +3031,13 @@ EXPLAIN "used_key_parts": ["e", "MAX(v2.f)", "max_g"], "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "v2.max_g > 3", "temporary_table": { "nested_loop": [ @@ -2900,11 +3046,13 @@ EXPLAIN "table_name": "<derived3>", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v2.e < 5", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "max_g > 25", "filesort": { "sort_key": "t2.e", @@ -2915,6 +3063,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.e < 5" } @@ -2991,12 +3140,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 1 and t1.a is not null and t1.b is not null and t1.c is not null" } @@ -3011,11 +3162,13 @@ EXPLAIN "used_key_parts": ["e", "MAX(v2.f)", "max_g"], "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "temporary_table": { "nested_loop": [ { @@ -3023,11 +3176,13 @@ EXPLAIN "table_name": "<derived3>", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v2.e < 5 and v2.e > 1", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "max_g > 25", "filesort": { "sort_key": "t2.e", @@ -3038,6 +3193,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.e < 5 and t2.e > 1" } @@ -3115,12 +3271,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 1 and t1.c < 100 and t1.a is not null and t1.b is not null and t1.c is not null" } @@ -3135,11 +3293,13 @@ EXPLAIN "used_key_parts": ["e", "MAX(v2.f)", "max_g"], "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "v2.max_g < 100", "temporary_table": { "nested_loop": [ @@ -3148,11 +3308,13 @@ EXPLAIN "table_name": "<derived3>", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "v2.e < 5 and v2.e > 1", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "max_g > 25", "filesort": { "sort_key": "t2.e", @@ -3163,6 +3325,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.e < 5 and t2.e > 1" } @@ -3263,12 +3426,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 1 and t1.a is not null and t1.b is not null and t1.c is not null" } @@ -3283,11 +3448,13 @@ EXPLAIN "used_key_parts": ["e", "MAX(d_tab.f)", "max_g"], "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "temporary_table": { "nested_loop": [ { @@ -3295,11 +3462,13 @@ EXPLAIN "table_name": "<derived3>", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "d_tab.e < 5 and d_tab.e > 1", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "max_g > 25 and t2.e < 5 and t2.e > 1", "filesort": { "sort_key": "t2.f", @@ -3310,6 +3479,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -3428,12 +3598,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 1 and t1.a is not null and t1.b is not null and t1.c is not null" } @@ -3448,11 +3620,13 @@ EXPLAIN "used_key_parts": ["e", "MAX(d_tab.f)", "max_g"], "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "temporary_table": { "nested_loop": [ { @@ -3460,11 +3634,13 @@ EXPLAIN "table_name": "<derived3>", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "d_tab.e < 5 and d_tab.e > 1", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "max_g > 25 and t2.e < 5 and t2.e > 1", "filesort": { "sort_key": "t2.f", @@ -3475,6 +3651,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -3594,12 +3771,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 1 and t1.a is not null and t1.b is not null and t1.c is not null" } @@ -3614,11 +3793,13 @@ EXPLAIN "used_key_parts": ["e", "MAX(d_tab.f)", "max_g"], "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "temporary_table": { "nested_loop": [ { @@ -3626,11 +3807,13 @@ EXPLAIN "table_name": "<derived3>", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "d_tab.e < 5 and d_tab.e > 1", "materialized": { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "max_g > 25 and t2.e < 5 and t2.e > 1", "filesort": { "sort_key": "t2.f", @@ -3641,6 +3824,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -3742,12 +3926,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t3", "access_type": "ALL", "rows": 8, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t3.x < 5 and t3.x is not null" } @@ -3762,11 +3948,13 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t3.x"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "d_tab.max_c < 70", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 70", "filesort": { "sort_key": "t1.a", @@ -3777,6 +3965,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 1 and t1.a < 5 and t1.a is not null and t1.b is not null and t1.c is not null" } @@ -3791,11 +3980,13 @@ EXPLAIN "used_key_parts": ["e", "f", "MAX(t2.g)"], "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "t2.f < 5", "temporary_table": { "nested_loop": [ @@ -3804,6 +3995,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.e > 1 and t2.e < 5" } @@ -3927,12 +4119,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t3", "access_type": "ALL", "rows": 8, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t3.x < 5 and t3.x is not null" } @@ -3947,11 +4141,13 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t3.x"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "d_tab.max_c < 70", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "having_condition": "max_c < 70", "filesort": { "sort_key": "t1.a", @@ -3962,6 +4158,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a > 1 and t1.a < 5 and t1.a is not null and t1.b is not null and t1.c is not null" } @@ -3976,11 +4173,13 @@ EXPLAIN "used_key_parts": ["e", "f", "MAX(t2.g)"], "ref": ["test.t1.a", "test.t1.b", "test.t1.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "having_condition": "t2.f < 5", "temporary_table": { "nested_loop": [ @@ -3989,6 +4188,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.e > 1 and t2.e < 5" } @@ -4065,12 +4265,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 1 and t1.b is not null and t1.c is not null" } @@ -4085,11 +4287,13 @@ EXPLAIN "used_key_parts": ["f", "MAX(t2.g) OVER (PARTITION BY t2.f)"], "ref": ["test.t1.b", "test.t1.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "window_functions_computation": { "sorts": [ { @@ -4105,6 +4309,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.e < 5 and t2.f > 1" } @@ -4169,12 +4374,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 16, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b > 1 and t1.b is not null and t1.c is not null" } @@ -4192,12 +4399,14 @@ EXPLAIN ], "ref": ["test.t1.b", "test.t1.c"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.c = `<subquery2>`.`CAST(SUM(t2.g) OVER (PARTITION BY t2.f) AS INT)`", "materialized": { "unique": 1, "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "window_functions_computation": { "sorts": [ { @@ -4213,6 +4422,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.e < 5 and t2.f > 1" } diff --git a/mysql-test/main/in_subq_cond_pushdown.test b/mysql-test/main/in_subq_cond_pushdown.test index 7763201cda1..8a12a2c5977 100644 --- a/mysql-test/main/in_subq_cond_pushdown.test +++ b/mysql-test/main/in_subq_cond_pushdown.test @@ -42,6 +42,7 @@ WHERE t1.c<25 AND EVAL $no_pushdown $query; EVAL $query; EVAL EXPLAIN $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; --echo # extracted AND formula : pushing into HAVING @@ -60,6 +61,7 @@ WHERE t1.c>55 AND t1.b<4 AND EVAL $no_pushdown $query; EVAL $query; EVAL EXPLAIN $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; --echo # extracted OR formula : pushing into HAVING @@ -78,6 +80,7 @@ WHERE (t1.c>60 OR t1.c<25) AND EVAL $no_pushdown $query; EVAL $query; EVAL EXPLAIN $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; --echo # extracted AND-OR formula : pushing into HAVING @@ -96,6 +99,7 @@ WHERE ((t1.c>60 OR t1.c<25) AND t1.b>2) AND EVAL $no_pushdown $query; EVAL $query; EVAL EXPLAIN $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; --echo # conjunctive subformula : pushing into HAVING @@ -114,6 +118,7 @@ WHERE ((t1.a<2 OR t1.d>3) AND t1.b>1) AND EVAL $no_pushdown $query; EVAL $query; EVAL EXPLAIN $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; --echo # using view IN subquery defINition : pushing into HAVING @@ -132,6 +137,7 @@ WHERE t1.c>20 AND EVAL $no_pushdown $query; EVAL $query; EVAL EXPLAIN $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; --echo # using equality : pushing into WHERE @@ -150,6 +156,7 @@ WHERE t1.c>20 AND t1.c=v1_y AND EVAL $no_pushdown $query; EVAL $query; EVAL EXPLAIN $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; --echo # conjunctive subformula : pushing into WHERE @@ -168,6 +175,7 @@ WHERE t1.a<2 AND EVAL $no_pushdown $query; EVAL $query; EVAL EXPLAIN $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; --echo # extracted AND formula : pushing into WHERE @@ -186,6 +194,7 @@ WHERE t1.a>2 AND t1.a<5 AND EVAL $no_pushdown $query; EVAL $query; EVAL EXPLAIN $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; --echo # extracted OR formula : pushing into WHERE @@ -204,6 +213,7 @@ WHERE (t1.a<2 OR t1.a>=4) AND EVAL $no_pushdown $query; EVAL $query; EVAL EXPLAIN $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; --echo # extracted AND-OR formula : pushing into WHERE @@ -222,6 +232,7 @@ WHERE ((t1.a<2 OR t1.a=5) AND t1.b>3) AND EVAL $no_pushdown $query; EVAL $query; EVAL EXPLAIN $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; --echo # extracted AND-OR formula : pushing into WHERE @@ -240,6 +251,7 @@ WHERE ((t1.a<2 OR t1.a=5) AND t1.b>3) AND EVAL $no_pushdown $query; EVAL $query; EVAL EXPLAIN $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; --echo # conjunctive subformula : pushing into WHERE @@ -258,6 +270,7 @@ WHERE ((t1.b<3 OR t1.d>2) AND t1.a<2) AND EVAL $no_pushdown $query; EVAL $query; EVAL EXPLAIN $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; --echo # using equalities : pushing into WHERE @@ -276,6 +289,7 @@ WHERE t1.d=1 AND t1.a=t1.d AND EVAL $no_pushdown $query; EVAL $query; EVAL EXPLAIN $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; --echo # using equality : pushing into WHERE @@ -294,6 +308,7 @@ WHERE t1.d>1 AND t1.a=t1.d AND EVAL $no_pushdown $query; EVAL $query; EVAL EXPLAIN $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; --echo # using view IN subquery definition : pushing into WHERE @@ -312,6 +327,7 @@ WHERE t1.a<3 AND EVAL $no_pushdown $query; EVAL $query; EVAL EXPLAIN $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; --echo # using equality : pushing into WHERE @@ -330,6 +346,7 @@ WHERE t1.a=v1_x AND v1_x<2 AND v1_y>30 AND EVAL $no_pushdown $query; EVAL $query; EVAL EXPLAIN $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; --echo # conjunctive subformula : pushing into WHERE @@ -349,6 +366,7 @@ WHERE ((t1.b<3 OR t1.b=4) AND t1.a<3) AND EVAL $no_pushdown $query; EVAL $query; EVAL EXPLAIN $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; --echo # conjunctive subformula using addition : pushing into HAVING @@ -367,6 +385,7 @@ WHERE (t1.a+t1.c>41) AND EVAL $no_pushdown $query; EVAL $query; EVAL EXPLAIN $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; --echo # conjunctive subformula using substitution : pushing into HAVING @@ -385,6 +404,7 @@ WHERE (t1.c-t1.a<35) AND EVAL $no_pushdown $query; EVAL $query; EVAL EXPLAIN $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; --echo # conjunctive subformula using multiplication : pushing into HAVING @@ -403,6 +423,7 @@ WHERE (t1.c*t1.a>100) AND EVAL $no_pushdown $query; EVAL $query; EVAL EXPLAIN $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; --echo # conjunctive subformula using division : pushing into HAVING @@ -421,6 +442,7 @@ WHERE (t1.c/t1.a>30) AND EVAL $no_pushdown $query; EVAL $query; EVAL EXPLAIN $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; --echo # conjunctive subformula using BETWEEN : pushing into HAVING @@ -439,6 +461,7 @@ WHERE (t1.c BETWEEN 50 AND 100) AND EVAL $no_pushdown $query; EVAL $query; EVAL EXPLAIN $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; --echo # conjunctive subformula using addition : pushing into WHERE @@ -457,6 +480,7 @@ WHERE (t1.a+t1.b > 5) AND EVAL $no_pushdown $query; EVAL $query; EVAL EXPLAIN $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; --echo # conjunctive subformula using substitution : pushing into WHERE @@ -475,6 +499,7 @@ WHERE (t1.a-t1.b > 0) AND EVAL $no_pushdown $query; EVAL $query; EVAL EXPLAIN $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; --echo # conjunctive subformula using multiplication : pushing into WHERE @@ -493,6 +518,7 @@ WHERE (t1.a*t1.b > 6) AND EVAL $no_pushdown $query; EVAL $query; EVAL EXPLAIN $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; --echo # conjunctive subformula using division : pushing into WHERE @@ -511,6 +537,7 @@ WHERE (t1.b/t1.a > 2) AND EVAL $no_pushdown $query; EVAL $query; EVAL EXPLAIN $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; --echo # conjunctive subformula using BETWEEN : pushing into WHERE @@ -529,6 +556,7 @@ WHERE (t1.a BETWEEN 1 AND 3) AND EVAL $no_pushdown $query; EVAL $query; EVAL EXPLAIN $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; --echo # conjunctive subformula : pushing into HAVING of the IN subquery @@ -548,6 +576,7 @@ WHERE t1.c>3 AND EVAL $no_pushdown $query; EVAL $query; EVAL EXPLAIN $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; --echo # conjunctive subformula : pushing into WHERE of the IN subquery @@ -568,6 +597,7 @@ WHERE t1.a>1 AND EVAL $no_pushdown $query; EVAL $query; EVAL EXPLAIN $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; --echo # conjunctive subformula : pushing into WHERE and HAVING @@ -589,6 +619,7 @@ WHERE t1.a>1 AND t1.c<100 AND EVAL $no_pushdown $query; EVAL $query; EVAL EXPLAIN $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; --echo # conjunctive subformula : pushing into WHERE of the IN subquery @@ -615,6 +646,7 @@ WHERE t1.a>1 AND EVAL $no_pushdown $query; EVAL $query; EVAL EXPLAIN $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; --echo # conjunctive subformula : pushing into HAVING of the derived table @@ -640,6 +672,7 @@ WHERE d_tab.a=t3.x AND d_tab.b>2; EVAL $no_pushdown $query; EVAL $query; EVAL EXPLAIN $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; --echo # conjunctive subformula : pushing into WHERE of the derived table @@ -665,6 +698,7 @@ WHERE d_tab.a=t3.x AND d_tab.a<5; EVAL $no_pushdown $query; EVAL $query; EVAL EXPLAIN $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; --echo # conjunctive subformula : pushing into WHERE and HAVING @@ -692,6 +726,7 @@ WHERE d_tab.a=t3.x AND d_tab.a<5 AND d_tab.max_c<70; EVAL $no_pushdown $query; EVAL $query; EVAL EXPLAIN $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; --echo # conjunctive subformula : pushing into WHERE of the derived table @@ -717,6 +752,7 @@ WHERE d_tab.a=t3.x AND d_tab.a<5; EVAL $no_pushdown $query; EVAL $query; EVAL EXPLAIN $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; --echo # conjunctive subformula : pushing into WHERE @@ -735,6 +771,7 @@ WHERE (t1.b>1) AND EVAL $no_pushdown $query; EVAL $query; EVAL EXPLAIN $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; --echo # conjunctive subformula : pushing into WHERE @@ -753,6 +790,7 @@ WHERE (t1.b>1) AND EVAL $no_pushdown $query; EVAL $query; EVAL EXPLAIN $query; +--source include/explain-no-costs.inc EVAL EXPLAIN FORMAT=JSON $query; DROP TABLE t1,t2,t3; diff --git a/mysql-test/main/innodb_ext_key.result b/mysql-test/main/innodb_ext_key.result index ab893974c47..1c81d2b2d08 100644 --- a/mysql-test/main/innodb_ext_key.result +++ b/mysql-test/main/innodb_ext_key.result @@ -759,12 +759,13 @@ PRIMARY KEY (pk1,pk2), KEY(f2) ) ENGINE=InnoDB CHARSET utf8 ROW_FORMAT= DYNAMIC; INSERT INTO t1 VALUES (1,2,'2','abc'),(2,3,'3','def'); -explain format= json +explain format=json select * from t1 force index(f2) where pk1 <= 5 and pk2 <=5 and f2 = 'abc' and f1 <= '3'; EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -775,6 +776,7 @@ EXPLAIN "key_length": "3070", "used_key_parts": ["f2", "pk1"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 50, "index_condition": "t1.pk1 <= 5 and t1.pk2 <= 5 and t1.f2 = 'abc'", "attached_condition": "t1.f1 <= '3'" @@ -793,12 +795,13 @@ PRIMARY KEY (pk1,pk2), KEY k1(pk1,f2) ) ENGINE=InnoDB CHARSET utf8 ROW_FORMAT= DYNAMIC; INSERT INTO t1 VALUES (1,2,'2','abc'),(2,3,'3','def'); -explain format= json +explain format=json select * from t1 force index(k1) where f2 <= 5 and pk2 <=5 and pk1 = 'abc' and f1 <= '3'; EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -809,6 +812,7 @@ EXPLAIN "key_length": "3011", "used_key_parts": ["pk1", "f2", "pk2"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 50, "index_condition": "t1.f2 <= 5 and t1.pk2 <= 5 and t1.pk1 = 'abc'", "attached_condition": "t1.f1 <= '3'" diff --git a/mysql-test/main/innodb_ext_key.test b/mysql-test/main/innodb_ext_key.test index 2b868154bd3..b14a5d5cab3 100644 --- a/mysql-test/main/innodb_ext_key.test +++ b/mysql-test/main/innodb_ext_key.test @@ -614,7 +614,8 @@ CREATE TABLE t1 ( ) ENGINE=InnoDB CHARSET utf8 ROW_FORMAT= DYNAMIC; INSERT INTO t1 VALUES (1,2,'2','abc'),(2,3,'3','def'); -explain format= json +--source include/explain-no-costs.inc +explain format=json select * from t1 force index(f2) where pk1 <= 5 and pk2 <=5 and f2 = 'abc' and f1 <= '3'; drop table t1; @@ -627,7 +628,8 @@ PRIMARY KEY (pk1,pk2), KEY k1(pk1,f2) ) ENGINE=InnoDB CHARSET utf8 ROW_FORMAT= DYNAMIC; INSERT INTO t1 VALUES (1,2,'2','abc'),(2,3,'3','def'); -explain format= json +--source include/explain-no-costs.inc +explain format=json select * from t1 force index(k1) where f2 <= 5 and pk2 <=5 and pk1 = 'abc' and f1 <= '3'; drop table t1; diff --git a/mysql-test/main/intersect.result b/mysql-test/main/intersect.result index 299737e794b..614fbf2951e 100644 --- a/mysql-test/main/intersect.result +++ b/mysql-test/main/intersect.result @@ -51,12 +51,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -67,12 +69,14 @@ EXPLAIN "query_block": { "select_id": 2, "operation": "INTERSECT", + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -83,12 +87,14 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "INTERSECT", + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t3", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -115,6 +121,7 @@ ANALYZE { "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -125,6 +132,7 @@ ANALYZE "r_loops": 1, "rows": 3, "r_rows": 3, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -138,6 +146,7 @@ ANALYZE "query_block": { "select_id": 2, "operation": "INTERSECT", + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -148,6 +157,7 @@ ANALYZE "r_loops": 1, "rows": 3, "r_rows": 3, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -161,6 +171,7 @@ ANALYZE "query_block": { "select_id": 3, "operation": "INTERSECT", + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -171,6 +182,7 @@ ANALYZE "r_loops": 1, "rows": 3, "r_rows": 3, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -192,6 +204,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -202,6 +215,7 @@ ANALYZE "r_loops": 1, "rows": 3, "r_rows": 1, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -217,6 +231,7 @@ ANALYZE { "query_block": { "select_id": 2, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -227,6 +242,7 @@ ANALYZE "r_loops": 1, "rows": 3, "r_rows": 3, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -240,6 +256,7 @@ ANALYZE "query_block": { "select_id": 3, "operation": "INTERSECT", + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -250,6 +267,7 @@ ANALYZE "r_loops": 1, "rows": 3, "r_rows": 3, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -263,6 +281,7 @@ ANALYZE "query_block": { "select_id": 4, "operation": "INTERSECT", + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -273,6 +292,7 @@ ANALYZE "r_loops": 1, "rows": 3, "r_rows": 3, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -346,12 +366,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -362,12 +384,14 @@ EXPLAIN "query_block": { "select_id": 2, "operation": "INTERSECT", + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -377,6 +401,7 @@ EXPLAIN "table_name": "t3", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 }, "buffer_type": "flat", @@ -407,6 +432,7 @@ ANALYZE { "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -417,6 +443,7 @@ ANALYZE "r_loops": 1, "rows": 3, "r_rows": 3, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -430,6 +457,7 @@ ANALYZE "query_block": { "select_id": 2, "operation": "INTERSECT", + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -440,6 +468,7 @@ ANALYZE "r_loops": 1, "rows": 3, "r_rows": 3, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -454,6 +483,7 @@ ANALYZE "r_loops": 1, "rows": 3, "r_rows": 3, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -481,6 +511,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -491,6 +522,7 @@ ANALYZE "r_loops": 1, "rows": 3, "r_rows": 1, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -506,6 +538,7 @@ ANALYZE { "query_block": { "select_id": 2, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -516,6 +549,7 @@ ANALYZE "r_loops": 1, "rows": 3, "r_rows": 3, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -529,6 +563,7 @@ ANALYZE "query_block": { "select_id": 3, "operation": "INTERSECT", + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -539,6 +574,7 @@ ANALYZE "r_loops": 1, "rows": 3, "r_rows": 3, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -553,6 +589,7 @@ ANALYZE "r_loops": 1, "rows": 3, "r_rows": 3, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, diff --git a/mysql-test/main/intersect.test b/mysql-test/main/intersect.test index 5e811f1f56d..30f99b20aa2 100644 --- a/mysql-test/main/intersect.test +++ b/mysql-test/main/intersect.test @@ -23,6 +23,7 @@ insert into t3 values (1,1),(2,2),(5,5); EXPLAIN (select a,b from t1) intersect (select c,d from t2) intersect (select e,f from t3); EXPLAIN extended (select a,b from t1) intersect (select c,d from t2) intersect (select e,f from t3); EXPLAIN extended select * from ((select a,b from t1) intersect (select c,d from t2) intersect (select e,f from t3)) a; +--source include/explain-no-costs.inc EXPLAIN format=json (select a,b from t1) intersect (select c,d from t2) intersect (select e,f from t3); --source include/analyze-format.inc ANALYZE format=json (select a,b from t1) intersect (select c,d from t2) intersect (select e,f from t3); @@ -43,6 +44,7 @@ EXPLAIN (select a,b from t1) intersect (select c,e from t2,t3); EXPLAIN extended (select a,b from t1) intersect (select c,e from t2,t3); EXPLAIN extended select * from ((select a,b from t1) intersect (select c,e from t2,t3)) a; set @@optimizer_switch='optimize_join_buffer_size=off'; +--source include/explain-no-costs.inc EXPLAIN format=json (select a,b from t1) intersect (select c,e from t2,t3); --source include/analyze-format.inc ANALYZE format=json (select a,b from t1) intersect (select c,e from t2,t3); diff --git a/mysql-test/main/intersect_all.result b/mysql-test/main/intersect_all.result index e47a8872211..7b5bc2c2b95 100644 --- a/mysql-test/main/intersect_all.result +++ b/mysql-test/main/intersect_all.result @@ -63,12 +63,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 4, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -79,12 +81,14 @@ EXPLAIN "query_block": { "select_id": 2, "operation": "INTERSECT", + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 4, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -95,12 +99,14 @@ EXPLAIN "query_block": { "select_id": 3, "operation": "INTERSECT", + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t3", "access_type": "ALL", "rows": 4, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -127,6 +133,7 @@ ANALYZE { "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -137,6 +144,7 @@ ANALYZE "r_loops": 1, "rows": 4, "r_rows": 4, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -150,6 +158,7 @@ ANALYZE "query_block": { "select_id": 2, "operation": "INTERSECT", + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -160,6 +169,7 @@ ANALYZE "r_loops": 1, "rows": 4, "r_rows": 4, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -173,6 +183,7 @@ ANALYZE "query_block": { "select_id": 3, "operation": "INTERSECT", + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -183,6 +194,7 @@ ANALYZE "r_loops": 1, "rows": 4, "r_rows": 4, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -204,6 +216,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -214,6 +227,7 @@ ANALYZE "r_loops": 1, "rows": 4, "r_rows": 2, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -229,6 +243,7 @@ ANALYZE { "query_block": { "select_id": 2, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -239,6 +254,7 @@ ANALYZE "r_loops": 1, "rows": 4, "r_rows": 4, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -252,6 +268,7 @@ ANALYZE "query_block": { "select_id": 3, "operation": "INTERSECT", + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -262,6 +279,7 @@ ANALYZE "r_loops": 1, "rows": 4, "r_rows": 4, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -275,6 +293,7 @@ ANALYZE "query_block": { "select_id": 4, "operation": "INTERSECT", + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -285,6 +304,7 @@ ANALYZE "r_loops": 1, "rows": 4, "r_rows": 4, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -377,12 +397,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 6, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -393,12 +415,14 @@ EXPLAIN "query_block": { "select_id": 2, "operation": "INTERSECT", + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t3", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -408,6 +432,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 7, + "cost": "COST_REPLACED", "filtered": 100 }, "buffer_type": "flat", @@ -438,6 +463,7 @@ ANALYZE { "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -448,6 +474,7 @@ ANALYZE "r_loops": 1, "rows": 6, "r_rows": 6, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -461,6 +488,7 @@ ANALYZE "query_block": { "select_id": 2, "operation": "INTERSECT", + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -471,6 +499,7 @@ ANALYZE "r_loops": 1, "rows": 5, "r_rows": 5, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -485,6 +514,7 @@ ANALYZE "r_loops": 1, "rows": 7, "r_rows": 7, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -512,6 +542,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -522,6 +553,7 @@ ANALYZE "r_loops": 1, "rows": 6, "r_rows": 3, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -537,6 +569,7 @@ ANALYZE { "query_block": { "select_id": 2, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -547,6 +580,7 @@ ANALYZE "r_loops": 1, "rows": 6, "r_rows": 6, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -560,6 +594,7 @@ ANALYZE "query_block": { "select_id": 3, "operation": "INTERSECT", + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -570,6 +605,7 @@ ANALYZE "r_loops": 1, "rows": 5, "r_rows": 5, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -584,6 +620,7 @@ ANALYZE "r_loops": 1, "rows": 7, "r_rows": 7, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, diff --git a/mysql-test/main/intersect_all.test b/mysql-test/main/intersect_all.test index 5d2b038fde9..769b25393dd 100644 --- a/mysql-test/main/intersect_all.test +++ b/mysql-test/main/intersect_all.test @@ -22,6 +22,7 @@ insert into t3 values (1,1),(2,2),(5,5),(2,2); EXPLAIN (select a,b from t1) intersect all (select c,d from t2) intersect all (select e,f from t3); EXPLAIN extended (select a,b from t1) intersect all (select c,d from t2) intersect all (select e,f from t3); EXPLAIN extended select * from ((select a,b from t1) intersect all (select c,d from t2) intersect all (select e,f from t3)) a; +--source include/explain-no-costs.inc EXPLAIN format=json (select a,b from t1) intersect all (select c,d from t2) intersect all (select e,f from t3); --source include/analyze-format.inc ANALYZE format=json (select a,b from t1) intersect all (select c,d from t2) intersect all (select e,f from t3); @@ -50,6 +51,7 @@ insert into t3 values (2,2); EXPLAIN (select a,b from t1) intersect all (select c,e from t2,t3); EXPLAIN extended (select a,b from t1) intersect all (select c,e from t2,t3); EXPLAIN extended select * from ((select a,b from t1) intersect all (select c,e from t2,t3)) a; +--source include/explain-no-costs.inc EXPLAIN format=json (select a,b from t1) intersect all (select c,e from t2,t3); --source include/analyze-format.inc ANALYZE format=json (select a,b from t1) intersect all (select c,e from t2,t3); @@ -325,4 +327,4 @@ select * from t2 where a < 5 intersect all select * from t3 where a < 5; -drop table t1,t2,t3;
\ No newline at end of file +drop table t1,t2,t3; diff --git a/mysql-test/main/join_cache.result b/mysql-test/main/join_cache.result index 0f7ad1d23f7..f5baec125e8 100644 --- a/mysql-test/main/join_cache.result +++ b/mysql-test/main/join_cache.result @@ -6254,6 +6254,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -6264,6 +6265,7 @@ EXPLAIN "key_length": "4", "used_key_parts": ["a"], "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "a.a <= 10", "using_index": true @@ -6279,6 +6281,7 @@ EXPLAIN "key_length": "10", "used_key_parts": ["kp1", "kp2"], "rows": 836, + "cost": "COST_REPLACED", "filtered": 9.090909004, "index_condition": "b.kp2 <= 10", "attached_condition": "b.kp2 <= 10 and b.col1 + 1 < 33333" diff --git a/mysql-test/main/join_cache.test b/mysql-test/main/join_cache.test index c4401997b1d..ad2eacbe2bb 100644 --- a/mysql-test/main/join_cache.test +++ b/mysql-test/main/join_cache.test @@ -4245,6 +4245,7 @@ analyze table t3; --echo # The following must have "B.col1 + 1 < 33333" attached to table B --echo # and not to the block-nl-join node: +--source include/explain-no-costs.inc explain format=json select * from t1 a, t3 b diff --git a/mysql-test/main/multi_update.result b/mysql-test/main/multi_update.result index 674dc79fe12..c9504125568 100644 --- a/mysql-test/main/multi_update.result +++ b/mysql-test/main/multi_update.result @@ -1184,6 +1184,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -1214,6 +1215,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -1244,6 +1246,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { diff --git a/mysql-test/main/multi_update.test b/mysql-test/main/multi_update.test index 54c64918e03..6ec3de6a78b 100644 --- a/mysql-test/main/multi_update.test +++ b/mysql-test/main/multi_update.test @@ -1121,12 +1121,15 @@ INSERT INTO t1 (part,a,b) VALUES (0,0,0),(1,1,1),(2,2,2); INSERT INTO t2 (part,a,b) VALUES (0,0,0),(1,1,1),(2,2,2); --echo # Expecting partition "Current" +--source include/explain-no-costs.inc EXPLAIN FORMAT=JSON UPDATE t2 JOIN t1 USING(a) SET t2.part=3 WHERE t2.part=0 AND t1.part=0; --echo # Expecting partition "Relevant" +--source include/explain-no-costs.inc EXPLAIN FORMAT=JSON UPDATE t2 JOIN t1 USING(a) SET t2.part=2 WHERE t2.part=1 AND t1.part=1; --echo # Expecting partition "Archive" +--source include/explain-no-costs.inc EXPLAIN FORMAT=JSON UPDATE t2 JOIN t1 USING(a) SET t2.part=3 WHERE t2.part=2 AND t1.part=2; DROP TABLES t1, t2; diff --git a/mysql-test/main/opt_trace.result b/mysql-test/main/opt_trace.result index 5eb24dd3df1..f167debcab0 100644 --- a/mysql-test/main/opt_trace.result +++ b/mysql-test/main/opt_trace.result @@ -11051,6 +11051,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": 1.235599899, "nested_loop": [ { "table": { @@ -11061,6 +11062,7 @@ EXPLAIN "key_length": "8", "used_key_parts": ["start_date", "end_date"], "rows": 1000, + "cost": 1.235599899, "filtered": 100, "index_condition": "t1.start_date >= '2019-02-10' and t1.end_date < '2019-04-01'" } @@ -12879,12 +12881,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": 2.30309056, "nested_loop": [ { "table": { "table_name": "three", "access_type": "ALL", "rows": 3, + "cost": 0.010504815, "filtered": 100, "attached_condition": "three.a is not null" } @@ -12907,6 +12911,7 @@ EXPLAIN "selectivity_pct": 43.12 }, "rows": 1000, + "cost": 2.292585745, "filtered": 43.11999893, "attached_condition": "t1.b < 5000 and t1.c < 1000" } @@ -12920,12 +12925,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": 1.712236739, "nested_loop": [ { "table": { "table_name": "three", "access_type": "ALL", "rows": 3, + "cost": 0.010504815, "filtered": 100 } }, @@ -12936,6 +12943,7 @@ EXPLAIN "access_type": "ALL", "possible_keys": ["a", "b"], "rows": 10000, + "cost": 1.701731924, "filtered": 4.307688236, "attached_condition": "t1.b < 5000 and t1.c < 1000" }, diff --git a/mysql-test/main/opt_trace_ucs2.result b/mysql-test/main/opt_trace_ucs2.result index 5ae8a5fd6b8..11d9e89d599 100644 --- a/mysql-test/main/opt_trace_ucs2.result +++ b/mysql-test/main/opt_trace_ucs2.result @@ -7,6 +7,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -17,6 +18,7 @@ EXPLAIN "key_length": "21", "used_key_parts": ["col1"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "index_condition": "t1.col1 >= 'a'" } diff --git a/mysql-test/main/opt_trace_ucs2.test b/mysql-test/main/opt_trace_ucs2.test index 1a79ea9780e..7e06955d666 100644 --- a/mysql-test/main/opt_trace_ucs2.test +++ b/mysql-test/main/opt_trace_ucs2.test @@ -5,6 +5,7 @@ create or replace table t1 (col1 char(10) character set ucs2, filler char(100), insert into t1 values ('a', 'a'); insert into t1 values ('a', 'a'); set optimizer_trace=1; +--source include/explain-no-costs.inc explain format=json select * from t1 force index(col1) where col1 >='a'; #enable after fix MDEV-27871 --disable_view_protocol diff --git a/mysql-test/main/order_by.result b/mysql-test/main/order_by.result index cb5459532ee..f9c0d59e66a 100644 --- a/mysql-test/main/order_by.result +++ b/mysql-test/main/order_by.result @@ -1564,6 +1564,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -1589,6 +1590,7 @@ ANALYZE "r_loops": 1, "rows": 2, "r_rows": 1, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 50, @@ -3455,6 +3457,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -3475,6 +3478,7 @@ ANALYZE "r_loops": 1, "rows": 100, "r_rows": 100, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -3804,6 +3808,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -3824,6 +3829,7 @@ ANALYZE "r_loops": 1, "rows": 100, "r_rows": 100, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -3970,6 +3976,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -3990,6 +3997,7 @@ ANALYZE "r_loops": 1, "rows": 5, "r_rows": 5, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -4019,6 +4027,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -4039,6 +4048,7 @@ ANALYZE "r_loops": 1, "rows": 6, "r_rows": 6, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -4074,6 +4084,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -4094,6 +4105,7 @@ ANALYZE "r_loops": 1, "rows": 6, "r_rows": 6, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -4143,6 +4155,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -4163,6 +4176,7 @@ ANALYZE "r_loops": 1, "rows": 10, "r_rows": 10, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -4325,6 +4339,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -4335,6 +4350,7 @@ ANALYZE "r_loops": 1, "rows": 50, "r_rows": 50, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -4349,6 +4365,7 @@ ANALYZE "r_hit_ratio": 0, "query_block": { "select_id": 2, + "cost": "REPLACED", "r_loops": 50, "r_total_time_ms": "REPLACED", "filesort": { @@ -4368,6 +4385,7 @@ ANALYZE "r_loops": 50, "rows": 50, "r_rows": 50, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -4466,6 +4484,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -4476,6 +4495,7 @@ EXPLAIN "key_length": "4", "used_key_parts": ["a"], "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "using_index": true } @@ -4501,6 +4521,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 97, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.b = 3" } @@ -4537,6 +4558,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "read_sorted_file": { @@ -4547,6 +4569,7 @@ EXPLAIN "access_type": "ALL", "possible_keys": ["PRIMARY"], "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -4573,6 +4596,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 97, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.b = 3" } diff --git a/mysql-test/main/order_by.test b/mysql-test/main/order_by.test index c336a6784a5..a292e468ef2 100644 --- a/mysql-test/main/order_by.test +++ b/mysql-test/main/order_by.test @@ -2692,6 +2692,7 @@ let $query= SELECT t1.a ORDER BY t1.a DESC; eval EXPLAIN $query; +--source include/explain-no-costs.inc eval EXPLAIN FORMAT=JSON $query; eval $query; @@ -2701,6 +2702,7 @@ let $query= SELECT t1.a, group_concat(t1.b) GROUP BY t1.a DESC; eval EXPLAIN $query; +--source include/explain-no-costs.inc eval EXPLAIN FORMAT=JSON $query; eval $query; DROP TABLE t1, t2; diff --git a/mysql-test/main/order_by_pack_big.result b/mysql-test/main/order_by_pack_big.result index 6b33d7d8202..adc7fc807a0 100644 --- a/mysql-test/main/order_by_pack_big.result +++ b/mysql-test/main/order_by_pack_big.result @@ -94,6 +94,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -114,6 +115,7 @@ ANALYZE "r_loops": 1, "rows": 10000, "r_rows": 10000, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -258,6 +260,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -279,6 +282,7 @@ ANALYZE "r_loops": 1, "rows": 10000, "r_rows": 10000, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -420,6 +424,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -440,6 +445,7 @@ ANALYZE "r_loops": 1, "rows": 10000, "r_rows": 10000, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -476,6 +482,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -496,6 +503,7 @@ ANALYZE "r_loops": 1, "rows": 10000, "r_rows": 10000, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, diff --git a/mysql-test/main/range.result b/mysql-test/main/range.result index 2166981ccbe..f08e4cdb0aa 100644 --- a/mysql-test/main/range.result +++ b/mysql-test/main/range.result @@ -2424,6 +2424,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -2434,6 +2435,7 @@ EXPLAIN "key_length": "10", "used_key_parts": ["a", "b"], "rows": 6, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(t1.a,t1.b) in (<cache>((2,3)),<cache>((3,3)),<cache>((8,8)),<cache>((7,7)))" } @@ -2488,6 +2490,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -2498,6 +2501,7 @@ EXPLAIN "key_length": "5", "used_key_parts": ["a"], "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(t1.a,t1.b + t1.a) in (<cache>((4,9)),<cache>((8,8)),<cache>((7,7)))" } @@ -2518,6 +2522,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -2528,6 +2533,7 @@ EXPLAIN "key_length": "5", "used_key_parts": ["a"], "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(t1.a,t1.b) in ((4,t1.a - 1),(8,t1.a + 8),(7,t1.a + 7))" } @@ -2562,6 +2568,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -2580,6 +2587,7 @@ EXPLAIN "selectivity_pct": 60 }, "rows": 3, + "cost": "COST_REPLACED", "filtered": 60, "index_condition": "t2.d is not null", "attached_condition": "(t2.d,t2.e) in (<cache>((3,3)),<cache>((7,7)),<cache>((2,2)))" @@ -2595,6 +2603,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.d"], "rows": 8, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -2648,6 +2657,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -2666,6 +2676,7 @@ EXPLAIN "selectivity_pct": 14.42307692 }, "rows": 8, + "cost": "COST_REPLACED", "filtered": 14.42307663, "index_condition": "t2.d is not null", "attached_condition": "(t2.d,t2.e) in (<cache>((3,3)),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1" @@ -2681,6 +2692,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.d"], "rows": 8, + "cost": "COST_REPLACED", "filtered": 73.17073059 } } @@ -2759,6 +2771,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -2777,6 +2790,7 @@ EXPLAIN "selectivity_pct": 6.730769231 }, "rows": 7, + "cost": "COST_REPLACED", "filtered": 6.730769157, "index_condition": "t2.d is not null", "attached_condition": "(t2.d,t2.e) in (<cache>((4,4)),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1" @@ -2792,6 +2806,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.d"], "rows": 11, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -2823,6 +2838,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -2833,6 +2849,7 @@ EXPLAIN "key_length": "10", "used_key_parts": ["d", "e"], "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "index_condition": "t2.d is not null", "attached_condition": "(t2.d,t2.e) in (<cache>((4,4)),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1" @@ -2848,6 +2865,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.d"], "rows": 11, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -2878,6 +2896,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -2888,6 +2907,7 @@ EXPLAIN "key_length": "5", "used_key_parts": ["a"], "rows": 15, + "cost": "COST_REPLACED", "filtered": 100, "index_condition": "t1.a is not null" } @@ -2902,6 +2922,7 @@ EXPLAIN "used_key_parts": ["d"], "ref": ["test.t1.a"], "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(t1.a,t2.e) in ((4,t1.a + 1),(7,t1.a + 1),(8,t1.a + 1)) and octet_length(t2.f) = 1" } @@ -2941,6 +2962,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -2948,6 +2970,7 @@ EXPLAIN "access_type": "ALL", "possible_keys": ["idx"], "rows": 144, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a is not null" } @@ -2962,6 +2985,7 @@ EXPLAIN "used_key_parts": ["d"], "ref": ["test.t1.a"], "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(t1.a,t2.e) in ((t2.e,t1.a + 1),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1" } @@ -2995,6 +3019,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -3005,6 +3030,7 @@ EXPLAIN "key_length": "5", "used_key_parts": ["a"], "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "index_condition": "t1.a is not null", "attached_condition": "(t1.a,2) in (<cache>((2,2)),<cache>((7,7)),<cache>((8,8))) and octet_length(t1.c) = 1" @@ -3020,6 +3046,7 @@ EXPLAIN "used_key_parts": ["d"], "ref": ["test.t1.a"], "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "octet_length(t2.f) = 1" } @@ -3078,6 +3105,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -3101,6 +3129,7 @@ EXPLAIN "key_length": "5", "used_key_parts": ["a"], "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "index_condition": "t1.a is not null", "attached_condition": "(t1.a,1 + 1) in (<cache>((2,2)),<cache>((7,7)),<cache>((8,8))) and octet_length(t1.c) = 1" @@ -3116,6 +3145,7 @@ EXPLAIN "used_key_parts": ["d"], "ref": ["test.t1.a"], "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "octet_length(t2.f) = 1" } diff --git a/mysql-test/main/range.test b/mysql-test/main/range.test index 5327d4fcef1..8b3c096b4d2 100644 --- a/mysql-test/main/range.test +++ b/mysql-test/main/range.test @@ -1920,6 +1920,7 @@ insert into t1 values let $q1= select * from t1 where (a,b) IN ((2, 3),(3,3),(8,8),(7,7)); eval explain $q1; +--source include/explain-no-costs.inc eval explain format=json $q1; eval $q1; eval prepare stmt from "$q1"; @@ -1931,6 +1932,7 @@ deallocate prepare stmt; let $q2= select * from t1 where (a,b+a) IN ((4,9),(8,8),(7,7)); eval explain $q2; +--source include/explain-no-costs.inc eval explain format=json $q2; eval $q2; @@ -1938,6 +1940,7 @@ eval $q2; let $q3= select * from t1 where (a,b) IN ((4,a-1),(8,a+8),(7,a+7)); eval explain $q3; +--source include/explain-no-costs.inc eval explain format=json $q3; eval $q3; @@ -1961,6 +1964,7 @@ let $q4= select * from t1,t2 where a = d and (a,e) in ((3,3),(7,7),(2,2)); eval explain $q4; +--source include/explain-no-costs.inc eval explain format=json $q4; eval $q4; @@ -1986,6 +1990,7 @@ let $q5= select * from t1,t2 where a = d and (a,e) in ((3,3),(7,7),(8,8)) and length(f) = 1; eval explain $q5; +--source include/explain-no-costs.inc eval explain format=json $q5; --sorted_result eval $q5; @@ -2004,6 +2009,7 @@ let $q6= select * from t1,t2 where a = d and (a,e) in ((4,4),(7,7),(8,8)) and length(f) = 1; eval explain $q6; +--source include/explain-no-costs.inc eval explain format=json $q6; --sorted_result eval $q6; @@ -2016,6 +2022,7 @@ let $q7= select * from t1,t2 where a = d and (a,e) in ((4,4),(7,7),(8,8)) and length(f) = 1; eval explain $q7; +--source include/explain-no-costs.inc eval explain format=json $q7; eval $q7; @@ -2025,6 +2032,7 @@ let $q8= select * from t1,t2 where a = d and (a,e) in ((4,d+1),(7,d+1),(8,d+1)) and length(f) = 1; eval explain $q8; +--source include/explain-no-costs.inc eval explain format=json $q8; --sorted_result eval $q8; @@ -2035,6 +2043,7 @@ let $q9= select * from t1,t2 where a = d and (a,e) in ((e,d+1),(7,7),(8,8)) and length(f) = 1; eval explain $q9; +--source include/explain-no-costs.inc eval explain format=json $q9; --sorted_result eval $q9; @@ -2046,6 +2055,7 @@ select * from t1,t2 where a = d and (a,2) in ((2,2),(7,7),(8,8)) and length(c) = 1 and length(f) = 1; eval explain $q10; +--source include/explain-no-costs.inc eval explain format=json $q10; eval $q10; eval prepare stmt from "$q10"; @@ -2066,6 +2076,7 @@ select * from t1,t2,t3 (a,v+1) in ((2,2),(7,7),(8,8)) and length(c) = 1 and length(f) = 1; eval explain $q11; +--source include/explain-no-costs.inc eval explain format=json $q11; eval $q11; diff --git a/mysql-test/main/range_mrr_icp.result b/mysql-test/main/range_mrr_icp.result index 586b75b2298..b0ea1e03059 100644 --- a/mysql-test/main/range_mrr_icp.result +++ b/mysql-test/main/range_mrr_icp.result @@ -2427,6 +2427,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -2437,6 +2438,7 @@ EXPLAIN "key_length": "10", "used_key_parts": ["a", "b"], "rows": 6, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(t1.a,t1.b) in (<cache>((2,3)),<cache>((3,3)),<cache>((8,8)),<cache>((7,7)))", "mrr_type": "Rowid-ordered scan" @@ -2492,6 +2494,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -2502,6 +2505,7 @@ EXPLAIN "key_length": "5", "used_key_parts": ["a"], "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(t1.a,t1.b + t1.a) in (<cache>((4,9)),<cache>((8,8)),<cache>((7,7)))", "mrr_type": "Rowid-ordered scan" @@ -2523,6 +2527,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -2533,6 +2538,7 @@ EXPLAIN "key_length": "5", "used_key_parts": ["a"], "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(t1.a,t1.b) in ((4,t1.a - 1),(8,t1.a + 8),(7,t1.a + 7))", "mrr_type": "Rowid-ordered scan" @@ -2568,6 +2574,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -2578,6 +2585,7 @@ EXPLAIN "key_length": "5", "used_key_parts": ["d"], "rows": 3, + "cost": "COST_REPLACED", "filtered": 60, "index_condition": "t2.d is not null", "attached_condition": "(t2.d,t2.e) in (<cache>((3,3)),<cache>((7,7)),<cache>((2,2)))", @@ -2594,6 +2602,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.d"], "rows": 8, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -2647,6 +2656,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -2657,6 +2667,7 @@ EXPLAIN "key_length": "5", "used_key_parts": ["d"], "rows": 8, + "cost": "COST_REPLACED", "filtered": 14.42307663, "index_condition": "t2.d is not null", "attached_condition": "(t2.d,t2.e) in (<cache>((3,3)),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1", @@ -2673,6 +2684,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.d"], "rows": 8, + "cost": "COST_REPLACED", "filtered": 73.17073059 } } @@ -2751,6 +2763,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -2761,6 +2774,7 @@ EXPLAIN "key_length": "5", "used_key_parts": ["d"], "rows": 7, + "cost": "COST_REPLACED", "filtered": 6.730769157, "index_condition": "t2.d is not null", "attached_condition": "(t2.d,t2.e) in (<cache>((4,4)),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1", @@ -2777,6 +2791,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.d"], "rows": 11, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -2808,6 +2823,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -2818,6 +2834,7 @@ EXPLAIN "key_length": "10", "used_key_parts": ["d", "e"], "rows": 5, + "cost": "COST_REPLACED", "filtered": 100, "index_condition": "t2.d is not null", "attached_condition": "(t2.d,t2.e) in (<cache>((4,4)),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1", @@ -2834,6 +2851,7 @@ EXPLAIN "used_key_parts": ["a"], "ref": ["test.t2.d"], "rows": 11, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -2864,6 +2882,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -2874,6 +2893,7 @@ EXPLAIN "key_length": "5", "used_key_parts": ["a"], "rows": 15, + "cost": "COST_REPLACED", "filtered": 100, "index_condition": "t1.a is not null", "mrr_type": "Rowid-ordered scan" @@ -2889,6 +2909,7 @@ EXPLAIN "used_key_parts": ["d"], "ref": ["test.t1.a"], "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(t1.a,t2.e) in ((4,t1.a + 1),(7,t1.a + 1),(8,t1.a + 1)) and octet_length(t2.f) = 1" } @@ -2928,6 +2949,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -2935,6 +2957,7 @@ EXPLAIN "access_type": "ALL", "possible_keys": ["idx"], "rows": 144, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a is not null" } @@ -2949,6 +2972,7 @@ EXPLAIN "used_key_parts": ["d"], "ref": ["test.t1.a"], "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "(t1.a,t2.e) in ((t2.e,t1.a + 1),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1" } @@ -2982,6 +3006,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -2992,6 +3017,7 @@ EXPLAIN "key_length": "5", "used_key_parts": ["a"], "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "index_condition": "t1.a is not null", "attached_condition": "(t1.a,2) in (<cache>((2,2)),<cache>((7,7)),<cache>((8,8))) and octet_length(t1.c) = 1", @@ -3008,6 +3034,7 @@ EXPLAIN "used_key_parts": ["d"], "ref": ["test.t1.a"], "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "octet_length(t2.f) = 1" } @@ -3066,6 +3093,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -3089,6 +3117,7 @@ EXPLAIN "key_length": "5", "used_key_parts": ["a"], "rows": 12, + "cost": "COST_REPLACED", "filtered": 100, "index_condition": "t1.a is not null", "attached_condition": "(t1.a,1 + 1) in (<cache>((2,2)),<cache>((7,7)),<cache>((8,8))) and octet_length(t1.c) = 1", @@ -3105,6 +3134,7 @@ EXPLAIN "used_key_parts": ["d"], "ref": ["test.t1.a"], "rows": 3, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "octet_length(t2.f) = 1" } diff --git a/mysql-test/main/rowid_filter.result b/mysql-test/main/rowid_filter.result index 51d7cd94395..ec44ac15689 100644 --- a/mysql-test/main/rowid_filter.result +++ b/mysql-test/main/rowid_filter.result @@ -77,6 +77,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -95,6 +96,7 @@ EXPLAIN "selectivity_pct": 11.69025812 }, "rows": 509, + "cost": "COST_REPLACED", "filtered": 11.69025803, "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'", "attached_condition": "lineitem.l_quantity > 45" @@ -118,6 +120,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -144,6 +147,7 @@ ANALYZE "r_loops": 1, "rows": 509, "r_rows": 60, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 11.69025803, @@ -231,6 +235,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -241,6 +246,7 @@ EXPLAIN "key_length": "4", "used_key_parts": ["l_shipDATE"], "rows": 509, + "cost": "COST_REPLACED", "filtered": 11.69025803, "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'", "attached_condition": "lineitem.l_quantity > 45" @@ -264,6 +270,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -278,6 +285,7 @@ ANALYZE "r_loops": 1, "rows": 509, "r_rows": 510, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 11.69025803, @@ -368,6 +376,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -378,6 +387,7 @@ EXPLAIN "key_length": "9", "used_key_parts": ["o_totalprice"], "rows": 69, + "cost": "COST_REPLACED", "filtered": 100, "index_condition": "orders.o_totalprice between 200000 and 230000" } @@ -405,6 +415,7 @@ EXPLAIN "selectivity_pct": 1.631973356 }, "rows": 4, + "cost": "COST_REPLACED", "filtered": 1.631973386, "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-01-31'" } @@ -430,6 +441,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -444,6 +456,7 @@ ANALYZE "r_loops": 1, "rows": 69, "r_rows": 71, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -480,6 +493,7 @@ ANALYZE "r_loops": 71, "rows": 4, "r_rows": 0.154929577, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 1.631973386, @@ -521,6 +535,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -536,6 +551,7 @@ EXPLAIN "key_length": "4", "used_key_parts": ["l_shipDATE"], "rows": 98, + "cost": "COST_REPLACED", "filtered": 100, "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-01-31'" } @@ -550,6 +566,7 @@ EXPLAIN "used_key_parts": ["o_orderkey"], "ref": ["dbt3_s001.lineitem.l_orderkey"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 4.599999905, "attached_condition": "orders.o_totalprice between 200000 and 230000" } @@ -575,6 +592,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -594,6 +612,7 @@ ANALYZE "r_loops": 1, "rows": 98, "r_rows": 98, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -613,6 +632,7 @@ ANALYZE "r_loops": 98, "rows": 1, "r_rows": 1, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 4.599999905, @@ -656,6 +676,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -680,6 +701,7 @@ EXPLAIN "selectivity_pct": 11.69025812 }, "rows": 509, + "cost": "COST_REPLACED", "filtered": 11.69025803, "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'", "attached_condition": "lineitem.l_quantity > 45" @@ -703,6 +725,7 @@ EXPLAIN "selectivity_pct": 9.266666667 }, "rows": 1, + "cost": "COST_REPLACED", "filtered": 9.266666412, "attached_condition": "orders.o_totalprice between 180000 and 230000" } @@ -730,6 +753,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -762,6 +786,7 @@ ANALYZE "r_loops": 1, "rows": 509, "r_rows": 60, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 11.69025803, @@ -794,6 +819,7 @@ ANALYZE "r_loops": 60, "rows": 1, "r_rows": 0.266666667, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 9.266666412, @@ -843,6 +869,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -859,6 +886,7 @@ EXPLAIN "key_length": "4", "used_key_parts": ["l_shipDATE"], "rows": 509, + "cost": "COST_REPLACED", "filtered": 11.69025803, "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'", "attached_condition": "lineitem.l_quantity > 45" @@ -874,6 +902,7 @@ EXPLAIN "used_key_parts": ["o_orderkey"], "ref": ["dbt3_s001.lineitem.l_orderkey"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 9.266666412, "attached_condition": "orders.o_totalprice between 180000 and 230000" } @@ -901,6 +930,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -921,6 +951,7 @@ ANALYZE "r_loops": 1, "rows": 509, "r_rows": 510, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 11.69025803, @@ -941,6 +972,7 @@ ANALYZE "r_loops": 60, "rows": 1, "r_rows": 1, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 9.266666412, @@ -996,6 +1028,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -1006,6 +1039,7 @@ EXPLAIN "key_length": "9", "used_key_parts": ["o_totalprice"], "rows": 69, + "cost": "COST_REPLACED", "filtered": 100, "index_condition": "orders.o_totalprice between 200000 and 230000" } @@ -1033,6 +1067,7 @@ EXPLAIN "selectivity_pct": 8.476269775 }, "rows": 4, + "cost": "COST_REPLACED", "filtered": 8.476269722, "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'" } @@ -1058,6 +1093,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -1072,6 +1108,7 @@ ANALYZE "r_loops": 1, "rows": 69, "r_rows": 71, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -1108,6 +1145,7 @@ ANALYZE "r_loops": 71, "rows": 4, "r_rows": 0.521126761, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 8.476269722, @@ -1175,6 +1213,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -1185,6 +1224,7 @@ EXPLAIN "key_length": "9", "used_key_parts": ["o_totalprice"], "rows": 69, + "cost": "COST_REPLACED", "filtered": 100, "index_condition": "orders.o_totalprice between 200000 and 230000" } @@ -1204,6 +1244,7 @@ EXPLAIN "used_key_parts": ["l_orderkey"], "ref": ["dbt3_s001.orders.o_orderkey"], "rows": 4, + "cost": "COST_REPLACED", "filtered": 8.476269722, "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'" } @@ -1229,6 +1270,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -1243,6 +1285,7 @@ ANALYZE "r_loops": 1, "rows": 69, "r_rows": 71, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -1267,6 +1310,7 @@ ANALYZE "r_loops": 71, "rows": 4, "r_rows": 6.704225352, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 8.476269722, @@ -1345,6 +1389,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -1361,6 +1406,7 @@ EXPLAIN "key_length": "4", "used_key_parts": ["l_receiptDATE"], "rows": 18, + "cost": "COST_REPLACED", "filtered": 0.566194832, "index_condition": "lineitem.l_receiptDATE between '1996-10-05' and '1996-10-10'", "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-10-10'" @@ -1376,6 +1422,7 @@ EXPLAIN "used_key_parts": ["o_orderkey"], "ref": ["dbt3_s001.lineitem.l_orderkey"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 7.466666698, "attached_condition": "orders.o_totalprice between 200000 and 250000" } @@ -1405,6 +1452,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -1425,6 +1473,7 @@ ANALYZE "r_loops": 1, "rows": 18, "r_rows": 18, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 0.566194832, @@ -1445,6 +1494,7 @@ ANALYZE "r_loops": 7, "rows": 1, "r_rows": 1, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 7.466666698, @@ -1482,6 +1532,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -1498,6 +1549,7 @@ EXPLAIN "key_length": "4", "used_key_parts": ["l_receiptDATE"], "rows": 18, + "cost": "COST_REPLACED", "filtered": 0.566194832, "index_condition": "lineitem.l_receiptDATE between '1996-10-05' and '1996-10-10'", "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-10-10'" @@ -1513,6 +1565,7 @@ EXPLAIN "used_key_parts": ["o_orderkey"], "ref": ["dbt3_s001.lineitem.l_orderkey"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 7.466666698, "attached_condition": "orders.o_totalprice between 200000 and 250000" } @@ -1542,6 +1595,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -1562,6 +1616,7 @@ ANALYZE "r_loops": 1, "rows": 18, "r_rows": 18, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 0.566194832, @@ -1582,6 +1637,7 @@ ANALYZE "r_loops": 7, "rows": 1, "r_rows": 1, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 7.466666698, @@ -1626,6 +1682,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -1636,6 +1693,7 @@ EXPLAIN "key_length": "9", "used_key_parts": ["o_totaldiscount"], "rows": 39, + "cost": "COST_REPLACED", "filtered": 3.200000048, "index_condition": "orders.o_totaldiscount between 18000 and 20000", "attached_condition": "orders.o_totalprice between 200000 and 220000" @@ -1664,6 +1722,7 @@ EXPLAIN "selectivity_pct": 3.04746045 }, "rows": 4, + "cost": "COST_REPLACED", "filtered": 3.047460556, "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'" } @@ -1693,6 +1752,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -1707,6 +1767,7 @@ ANALYZE "r_loops": 1, "rows": 39, "r_rows": 41, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 3.200000048, @@ -1744,6 +1805,7 @@ ANALYZE "r_loops": 1, "rows": 4, "r_rows": 4, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 3.047460556, @@ -1784,6 +1846,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -1794,6 +1857,7 @@ EXPLAIN "key_length": "9", "used_key_parts": ["o_totaldiscount"], "rows": 39, + "cost": "COST_REPLACED", "filtered": 3.200000048, "index_condition": "orders.o_totaldiscount between 18000 and 20000", "attached_condition": "orders.o_totalprice between 200000 and 220000" @@ -1814,6 +1878,7 @@ EXPLAIN "used_key_parts": ["l_orderkey"], "ref": ["dbt3_s001.orders.o_orderkey"], "rows": 4, + "cost": "COST_REPLACED", "filtered": 3.047460556, "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'" } @@ -1843,6 +1908,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -1857,6 +1923,7 @@ ANALYZE "r_loops": 1, "rows": 39, "r_rows": 41, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 3.200000048, @@ -1882,6 +1949,7 @@ ANALYZE "r_loops": 1, "rows": 4, "r_rows": 6, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 3.047460556, @@ -1925,6 +1993,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "REPLACED", "nested_loop": [ { "table": { @@ -1940,6 +2009,7 @@ EXPLAIN "key_length": "9", "used_key_parts": ["o_totaldiscount"], "rows": 39, + "cost": "REPLACED", "filtered": "REPLACED", "index_condition": "orders.o_totaldiscount between 18000 and 20000", "attached_condition": "orders.o_totalprice between 200000 and 220000 and orders.o_orderDATE between '1992-12-01' and '1997-01-01'" @@ -1960,6 +2030,7 @@ EXPLAIN "used_key_parts": ["l_orderkey"], "ref": ["dbt3_s001.orders.o_orderkey"], "rows": 4, + "cost": "REPLACED", "filtered": "REPLACED", "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'" } @@ -1989,6 +2060,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -2008,6 +2080,7 @@ ANALYZE "r_loops": 1, "rows": 39, "r_rows": 41, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": "REPLACED", @@ -2033,6 +2106,7 @@ ANALYZE "r_loops": 1, "rows": 4, "r_rows": 6, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": "REPLACED", @@ -2073,6 +2147,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "REPLACED", "nested_loop": [ { "table": { @@ -2088,6 +2163,7 @@ EXPLAIN "key_length": "9", "used_key_parts": ["o_totaldiscount"], "rows": 39, + "cost": "REPLACED", "filtered": "REPLACED", "index_condition": "orders.o_totaldiscount between 18000 and 20000", "attached_condition": "orders.o_totalprice between 200000 and 220000 and orders.o_orderDATE between '1992-12-01' and '1997-01-01'" @@ -2108,6 +2184,7 @@ EXPLAIN "used_key_parts": ["l_orderkey"], "ref": ["dbt3_s001.orders.o_orderkey"], "rows": 4, + "cost": "REPLACED", "filtered": "REPLACED", "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'" } @@ -2137,6 +2214,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -2156,6 +2234,7 @@ ANALYZE "r_loops": 1, "rows": 39, "r_rows": 41, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": "REPLACED", @@ -2181,6 +2260,7 @@ ANALYZE "r_loops": 1, "rows": 4, "r_rows": 6, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": "REPLACED", diff --git a/mysql-test/main/rowid_filter.test b/mysql-test/main/rowid_filter.test index 8ba4cc64845..bbf0334fbbf 100644 --- a/mysql-test/main/rowid_filter.test +++ b/mysql-test/main/rowid_filter.test @@ -55,6 +55,7 @@ SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem l_quantity > 45; eval $with_filter EXPLAIN $q1; +--source include/explain-no-costs.inc eval $with_filter EXPLAIN FORMAT=JSON $q1; eval $with_filter ANALYZE $q1; --source include/analyze-format.inc @@ -63,6 +64,7 @@ eval $with_filter ANALYZE FORMAT=JSON $q1; eval $with_filter $q1; eval $without_filter EXPLAIN $q1; +--source include/explain-no-costs.inc eval $without_filter EXPLAIN FORMAT=JSON $q1; eval $without_filter ANALYZE $q1; --source include/analyze-format.inc @@ -77,6 +79,7 @@ SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice o_totalprice between 200000 and 230000; eval $with_filter EXPLAIN $q2; +--source include/explain-no-costs.inc eval $with_filter EXPLAIN FORMAT=JSON $q2; eval $with_filter ANALYZE $q2; --source include/analyze-format.inc @@ -85,6 +88,7 @@ eval $with_filter ANALYZE FORMAT=JSON $q2; eval $with_filter $q2; eval $without_filter EXPLAIN $q2; +--source include/explain-no-costs.inc eval $without_filter EXPLAIN FORMAT=JSON $q2; eval $without_filter ANALYZE $q2; --source include/analyze-format.inc @@ -100,6 +104,7 @@ SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice o_totalprice between 180000 and 230000; eval $with_filter EXPLAIN $q3; +--source include/explain-no-costs.inc eval $with_filter EXPLAIN FORMAT=JSON $q3; eval $with_filter ANALYZE $q3; --source include/analyze-format.inc @@ -108,6 +113,7 @@ eval $with_filter ANALYZE FORMAT=JSON $q3; eval $with_filter $q3; eval $without_filter EXPLAIN $q3; +--source include/explain-no-costs.inc eval $without_filter EXPLAIN FORMAT=JSON $q3; eval $without_filter ANALYZE $q3; --source include/analyze-format.inc @@ -129,6 +135,7 @@ SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice o_totalprice between 200000 and 230000; eval $with_filter EXPLAIN $q4; +--source include/explain-no-costs.inc eval $with_filter EXPLAIN FORMAT=JSON $q4; eval $with_filter ANALYZE $q4; --source include/analyze-format.inc @@ -137,6 +144,7 @@ eval $with_filter ANALYZE FORMAT=JSON $q4; eval $with_filter $q4; eval $without_filter EXPLAIN $q4; +--source include/explain-no-costs.inc eval $without_filter EXPLAIN FORMAT=JSON $q4; eval $without_filter ANALYZE $q4; --source include/analyze-format.inc @@ -162,6 +170,7 @@ WHERE o_orderkey=l_orderkey AND o_totalprice BETWEEN 200000 AND 250000; eval $with_filter EXPLAIN $q5; +--source include/explain-no-costs.inc eval $with_filter EXPLAIN FORMAT=JSON $q5; eval $with_filter ANALYZE $q5; --source include/analyze-format.inc @@ -170,6 +179,7 @@ eval $with_filter ANALYZE FORMAT=JSON $q5; eval $with_filter $q5; eval $without_filter EXPLAIN $q5; +--source include/explain-no-costs.inc eval $without_filter EXPLAIN FORMAT=JSON $q5; eval $without_filter ANALYZE $q5; --source include/analyze-format.inc @@ -195,6 +205,7 @@ WHERE o_orderkey=l_orderkey AND l_shipdate BETWEEN '1996-10-01' AND '1996-12-01'; eval $with_filter EXPLAIN $q6; +--source include/explain-no-costs.inc eval $with_filter EXPLAIN FORMAT=JSON $q6; eval $with_filter ANALYZE $q6; --source include/analyze-format.inc @@ -203,6 +214,7 @@ eval $with_filter ANALYZE FORMAT=JSON $q6; eval $with_filter $q6; eval $without_filter EXPLAIN $q6; +--source include/explain-no-costs.inc eval $without_filter EXPLAIN FORMAT=JSON $q6; eval $without_filter ANALYZE $q6; --source include/analyze-format.inc @@ -223,21 +235,21 @@ WHERE o_orderkey=l_orderkey AND l_shipdate BETWEEN '1996-10-01' AND '1996-12-01'; eval $with_filter EXPLAIN $q7; ---replace_regex /"filtered": [0-9e\.\-+]*,/"filtered": "REPLACED",/ +--source include/explain-no-costs-filtered.inc eval $with_filter EXPLAIN FORMAT=JSON $q7; --replace_column 11 # eval $with_filter ANALYZE $q7; ---replace_regex /("(r_(total|table|other)_time_ms|r_buffer_size|r_filling_time_ms|filtered)": )[^, \n]*/\1"REPLACED"/ +--source include/analyze-no-filtered.inc eval $with_filter ANALYZE FORMAT=JSON $q7; --sorted_result eval $with_filter $q7; eval $without_filter EXPLAIN $q7; ---replace_regex /"filtered": [0-9e\.\-+]*,/"filtered": "REPLACED",/ +--source include/explain-no-costs-filtered.inc eval $without_filter EXPLAIN FORMAT=JSON $q7; --replace_column 11 # eval $without_filter ANALYZE $q7; ---replace_regex /("(r_(total|table|other)_time_ms|r_buffer_size|r_filling_time_ms|filtered)": )[^, \n]*/\1"REPLACED"/ +--source include/analyze-no-filtered.inc eval $without_filter ANALYZE FORMAT=JSON $q7; --sorted_result eval $without_filter $q7; diff --git a/mysql-test/main/rowid_filter_aria.result b/mysql-test/main/rowid_filter_aria.result index 7f101826850..d5b33ddf7f3 100644 --- a/mysql-test/main/rowid_filter_aria.result +++ b/mysql-test/main/rowid_filter_aria.result @@ -78,6 +78,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -96,6 +97,7 @@ EXPLAIN "selectivity_pct": 15.80349709 }, "rows": 482, + "cost": "COST_REPLACED", "filtered": 15.80349731, "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'", "attached_condition": "lineitem.l_quantity > 45" @@ -119,6 +121,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -145,6 +148,7 @@ ANALYZE "r_loops": 1, "rows": 482, "r_rows": 60, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 15.80349731, @@ -232,6 +236,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -242,6 +247,7 @@ EXPLAIN "key_length": "4", "used_key_parts": ["l_shipDATE"], "rows": 482, + "cost": "COST_REPLACED", "filtered": 15.80349731, "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'", "attached_condition": "lineitem.l_quantity > 45" @@ -265,6 +271,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -279,6 +286,7 @@ ANALYZE "r_loops": 1, "rows": 482, "r_rows": 510, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 15.80349731, @@ -369,6 +377,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -384,6 +393,7 @@ EXPLAIN "key_length": "4", "used_key_parts": ["l_shipDATE"], "rows": 92, + "cost": "COST_REPLACED", "filtered": 100, "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-01-31'" } @@ -406,6 +416,7 @@ EXPLAIN "selectivity_pct": 7.066666667 }, "rows": 1, + "cost": "COST_REPLACED", "filtered": 7.066666603, "attached_condition": "orders.o_totalprice between 200000 and 230000" } @@ -431,6 +442,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -450,6 +462,7 @@ ANALYZE "r_loops": 1, "rows": 92, "r_rows": 98, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -481,6 +494,7 @@ ANALYZE "r_loops": 98, "rows": 1, "r_rows": 0.112244898, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 7.066666603, @@ -522,6 +536,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -537,6 +552,7 @@ EXPLAIN "key_length": "4", "used_key_parts": ["l_shipDATE"], "rows": 92, + "cost": "COST_REPLACED", "filtered": 100, "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-01-31'" } @@ -551,6 +567,7 @@ EXPLAIN "used_key_parts": ["o_orderkey"], "ref": ["dbt3_s001.lineitem.l_orderkey"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 7.066666603, "attached_condition": "orders.o_totalprice between 200000 and 230000" } @@ -576,6 +593,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -595,6 +613,7 @@ ANALYZE "r_loops": 1, "rows": 92, "r_rows": 98, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -614,6 +633,7 @@ ANALYZE "r_loops": 98, "rows": 1, "r_rows": 1, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 7.066666603, @@ -657,6 +677,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -681,6 +702,7 @@ EXPLAIN "selectivity_pct": 15.80349709 }, "rows": 482, + "cost": "COST_REPLACED", "filtered": 15.80349731, "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'", "attached_condition": "lineitem.l_quantity > 45" @@ -704,6 +726,7 @@ EXPLAIN "selectivity_pct": 14.4 }, "rows": 1, + "cost": "COST_REPLACED", "filtered": 14.39999962, "attached_condition": "orders.o_totalprice between 180000 and 230000" } @@ -731,6 +754,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -763,6 +787,7 @@ ANALYZE "r_loops": 1, "rows": 482, "r_rows": 60, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 15.80349731, @@ -795,6 +820,7 @@ ANALYZE "r_loops": 60, "rows": 1, "r_rows": 0.266666667, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 14.39999962, @@ -844,6 +870,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -860,6 +887,7 @@ EXPLAIN "key_length": "4", "used_key_parts": ["l_shipDATE"], "rows": 482, + "cost": "COST_REPLACED", "filtered": 15.80349731, "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'", "attached_condition": "lineitem.l_quantity > 45" @@ -875,6 +903,7 @@ EXPLAIN "used_key_parts": ["o_orderkey"], "ref": ["dbt3_s001.lineitem.l_orderkey"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 14.39999962, "attached_condition": "orders.o_totalprice between 180000 and 230000" } @@ -902,6 +931,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -922,6 +952,7 @@ ANALYZE "r_loops": 1, "rows": 482, "r_rows": 510, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 15.80349731, @@ -942,6 +973,7 @@ ANALYZE "r_loops": 60, "rows": 1, "r_rows": 1, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 14.39999962, @@ -997,6 +1029,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -1007,6 +1040,7 @@ EXPLAIN "key_length": "9", "used_key_parts": ["o_totalprice"], "rows": 106, + "cost": "COST_REPLACED", "filtered": 100, "index_condition": "orders.o_totalprice between 200000 and 230000" } @@ -1034,6 +1068,7 @@ EXPLAIN "selectivity_pct": 8.026644463 }, "rows": 4, + "cost": "COST_REPLACED", "filtered": 8.026644707, "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'" } @@ -1059,6 +1094,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -1073,6 +1109,7 @@ ANALYZE "r_loops": 1, "rows": 106, "r_rows": 71, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -1109,6 +1146,7 @@ ANALYZE "r_loops": 71, "rows": 4, "r_rows": 0.521126761, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 8.026644707, @@ -1176,6 +1214,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -1186,6 +1225,7 @@ EXPLAIN "key_length": "9", "used_key_parts": ["o_totalprice"], "rows": 106, + "cost": "COST_REPLACED", "filtered": 100, "index_condition": "orders.o_totalprice between 200000 and 230000" } @@ -1205,6 +1245,7 @@ EXPLAIN "used_key_parts": ["l_orderkey"], "ref": ["dbt3_s001.orders.o_orderkey"], "rows": 4, + "cost": "COST_REPLACED", "filtered": 8.026644707, "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'" } @@ -1230,6 +1271,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -1244,6 +1286,7 @@ ANALYZE "r_loops": 1, "rows": 106, "r_rows": 71, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -1268,6 +1311,7 @@ ANALYZE "r_loops": 71, "rows": 4, "r_rows": 6.704225352, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 8.026644707, @@ -1346,6 +1390,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -1362,6 +1407,7 @@ EXPLAIN "key_length": "4", "used_key_parts": ["l_receiptDATE"], "rows": 17, + "cost": "COST_REPLACED", "filtered": 0.532889247, "index_condition": "lineitem.l_receiptDATE between '1996-10-05' and '1996-10-10'", "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-10-10'" @@ -1377,6 +1423,7 @@ EXPLAIN "used_key_parts": ["o_orderkey"], "ref": ["dbt3_s001.lineitem.l_orderkey"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 8.466666222, "attached_condition": "orders.o_totalprice between 200000 and 250000" } @@ -1406,6 +1453,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -1426,6 +1474,7 @@ ANALYZE "r_loops": 1, "rows": 17, "r_rows": 18, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 0.532889247, @@ -1446,6 +1495,7 @@ ANALYZE "r_loops": 7, "rows": 1, "r_rows": 1, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 8.466666222, @@ -1483,6 +1533,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -1499,6 +1550,7 @@ EXPLAIN "key_length": "4", "used_key_parts": ["l_receiptDATE"], "rows": 17, + "cost": "COST_REPLACED", "filtered": 0.532889247, "index_condition": "lineitem.l_receiptDATE between '1996-10-05' and '1996-10-10'", "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-10-10'" @@ -1514,6 +1566,7 @@ EXPLAIN "used_key_parts": ["o_orderkey"], "ref": ["dbt3_s001.lineitem.l_orderkey"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 8.466666222, "attached_condition": "orders.o_totalprice between 200000 and 250000" } @@ -1543,6 +1596,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -1563,6 +1617,7 @@ ANALYZE "r_loops": 1, "rows": 17, "r_rows": 18, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 0.532889247, @@ -1583,6 +1638,7 @@ ANALYZE "r_loops": 7, "rows": 1, "r_rows": 1, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 8.466666222, @@ -1627,6 +1683,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -1637,6 +1694,7 @@ EXPLAIN "key_length": "9", "used_key_parts": ["o_totaldiscount"], "rows": 61, + "cost": "COST_REPLACED", "filtered": 5, "index_condition": "orders.o_totaldiscount between 18000 and 20000", "attached_condition": "orders.o_totalprice between 200000 and 220000" @@ -1665,6 +1723,7 @@ EXPLAIN "selectivity_pct": 2.897585346 }, "rows": 4, + "cost": "COST_REPLACED", "filtered": 2.897585392, "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'" } @@ -1694,6 +1753,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -1708,6 +1768,7 @@ ANALYZE "r_loops": 1, "rows": 61, "r_rows": 41, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 5, @@ -1745,6 +1806,7 @@ ANALYZE "r_loops": 1, "rows": 4, "r_rows": 4, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 2.897585392, @@ -1785,6 +1847,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -1795,6 +1858,7 @@ EXPLAIN "key_length": "9", "used_key_parts": ["o_totaldiscount"], "rows": 61, + "cost": "COST_REPLACED", "filtered": 5, "index_condition": "orders.o_totaldiscount between 18000 and 20000", "attached_condition": "orders.o_totalprice between 200000 and 220000" @@ -1815,6 +1879,7 @@ EXPLAIN "used_key_parts": ["l_orderkey"], "ref": ["dbt3_s001.orders.o_orderkey"], "rows": 4, + "cost": "COST_REPLACED", "filtered": 2.897585392, "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'" } @@ -1844,6 +1909,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -1858,6 +1924,7 @@ ANALYZE "r_loops": 1, "rows": 61, "r_rows": 41, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 5, @@ -1883,6 +1950,7 @@ ANALYZE "r_loops": 1, "rows": 4, "r_rows": 6, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 2.897585392, @@ -1926,6 +1994,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "REPLACED", "nested_loop": [ { "table": { @@ -1941,6 +2010,7 @@ EXPLAIN "key_length": "9", "used_key_parts": ["o_totaldiscount"], "rows": 61, + "cost": "REPLACED", "filtered": "REPLACED", "index_condition": "orders.o_totaldiscount between 18000 and 20000", "attached_condition": "orders.o_totalprice between 200000 and 220000 and orders.o_orderDATE between '1992-12-01' and '1997-01-01'" @@ -1961,6 +2031,7 @@ EXPLAIN "used_key_parts": ["l_orderkey"], "ref": ["dbt3_s001.orders.o_orderkey"], "rows": 4, + "cost": "REPLACED", "filtered": "REPLACED", "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'" } @@ -1990,6 +2061,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -2009,6 +2081,7 @@ ANALYZE "r_loops": 1, "rows": 61, "r_rows": 41, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": "REPLACED", @@ -2034,6 +2107,7 @@ ANALYZE "r_loops": 1, "rows": 4, "r_rows": 6, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": "REPLACED", @@ -2074,6 +2148,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "REPLACED", "nested_loop": [ { "table": { @@ -2089,6 +2164,7 @@ EXPLAIN "key_length": "9", "used_key_parts": ["o_totaldiscount"], "rows": 61, + "cost": "REPLACED", "filtered": "REPLACED", "index_condition": "orders.o_totaldiscount between 18000 and 20000", "attached_condition": "orders.o_totalprice between 200000 and 220000 and orders.o_orderDATE between '1992-12-01' and '1997-01-01'" @@ -2109,6 +2185,7 @@ EXPLAIN "used_key_parts": ["l_orderkey"], "ref": ["dbt3_s001.orders.o_orderkey"], "rows": 4, + "cost": "REPLACED", "filtered": "REPLACED", "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'" } @@ -2138,6 +2215,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -2157,6 +2235,7 @@ ANALYZE "r_loops": 1, "rows": 61, "r_rows": 41, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": "REPLACED", @@ -2182,6 +2261,7 @@ ANALYZE "r_loops": 1, "rows": 4, "r_rows": 6, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": "REPLACED", diff --git a/mysql-test/main/rowid_filter_innodb.result b/mysql-test/main/rowid_filter_innodb.result index 5b0ee2cc433..d335990a322 100644 --- a/mysql-test/main/rowid_filter_innodb.result +++ b/mysql-test/main/rowid_filter_innodb.result @@ -80,6 +80,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -98,6 +99,7 @@ EXPLAIN "selectivity_pct": 10.07493755 }, "rows": 510, + "cost": "COST_REPLACED", "filtered": 10.07493782, "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'", "attached_condition": "lineitem.l_quantity > 45" @@ -121,6 +123,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -147,6 +150,7 @@ ANALYZE "r_loops": 1, "rows": 510, "r_rows": 60, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 10.07493782, @@ -234,6 +238,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -244,6 +249,7 @@ EXPLAIN "key_length": "4", "used_key_parts": ["l_shipDATE"], "rows": 510, + "cost": "COST_REPLACED", "filtered": 10.07493782, "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'", "attached_condition": "lineitem.l_quantity > 45" @@ -267,6 +273,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -281,6 +288,7 @@ ANALYZE "r_loops": 1, "rows": 510, "r_rows": 510, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 10.07493782, @@ -371,6 +379,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -386,6 +395,7 @@ EXPLAIN "key_length": "4", "used_key_parts": ["l_shipDATE"], "rows": 98, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-01-31'", "using_index": true @@ -401,6 +411,7 @@ EXPLAIN "used_key_parts": ["o_orderkey"], "ref": ["dbt3_s001.lineitem.l_orderkey"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 4.733333111, "attached_condition": "orders.o_totalprice between 200000 and 230000" } @@ -426,6 +437,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -445,6 +457,7 @@ ANALYZE "r_loops": 1, "rows": 98, "r_rows": 98, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -465,6 +478,7 @@ ANALYZE "r_loops": 98, "rows": 1, "r_rows": 1, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 4.733333111, @@ -506,6 +520,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -521,6 +536,7 @@ EXPLAIN "key_length": "4", "used_key_parts": ["l_shipDATE"], "rows": 98, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-01-31'", "using_index": true @@ -536,6 +552,7 @@ EXPLAIN "used_key_parts": ["o_orderkey"], "ref": ["dbt3_s001.lineitem.l_orderkey"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 4.733333111, "attached_condition": "orders.o_totalprice between 200000 and 230000" } @@ -561,6 +578,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -580,6 +598,7 @@ ANALYZE "r_loops": 1, "rows": 98, "r_rows": 98, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -600,6 +619,7 @@ ANALYZE "r_loops": 98, "rows": 1, "r_rows": 1, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 4.733333111, @@ -643,6 +663,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -667,6 +688,7 @@ EXPLAIN "selectivity_pct": 10.07493755 }, "rows": 510, + "cost": "COST_REPLACED", "filtered": 10.07493782, "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'", "attached_condition": "lineitem.l_quantity > 45" @@ -682,6 +704,7 @@ EXPLAIN "used_key_parts": ["o_orderkey"], "ref": ["dbt3_s001.lineitem.l_orderkey"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 9.600000381, "attached_condition": "orders.o_totalprice between 180000 and 230000" } @@ -709,6 +732,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -741,6 +765,7 @@ ANALYZE "r_loops": 1, "rows": 510, "r_rows": 60, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 10.07493782, @@ -761,6 +786,7 @@ ANALYZE "r_loops": 60, "rows": 1, "r_rows": 1, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 9.600000381, @@ -810,6 +836,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -820,6 +847,7 @@ EXPLAIN "key_length": "9", "used_key_parts": ["o_totalprice"], "rows": 144, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "orders.o_totalprice between 180000 and 230000", "using_index": true @@ -841,6 +869,7 @@ EXPLAIN "used_key_parts": ["l_orderkey"], "ref": ["dbt3_s001.orders.o_orderkey"], "rows": 4, + "cost": "COST_REPLACED", "filtered": 0.855656624, "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30' and lineitem.l_quantity > 45" } @@ -868,6 +897,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -882,6 +912,7 @@ ANALYZE "r_loops": 1, "rows": 144, "r_rows": 144, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -908,6 +939,7 @@ ANALYZE "r_loops": 144, "rows": 4, "r_rows": 6.625, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 0.855656624, @@ -963,6 +995,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -973,6 +1006,7 @@ EXPLAIN "key_length": "9", "used_key_parts": ["o_totalprice"], "rows": 71, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "orders.o_totalprice between 200000 and 230000", "using_index": true @@ -993,6 +1027,7 @@ EXPLAIN "used_key_parts": ["l_orderkey"], "ref": ["dbt3_s001.orders.o_orderkey"], "rows": 4, + "cost": "COST_REPLACED", "filtered": 8.492922783, "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'" } @@ -1018,6 +1053,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -1032,6 +1068,7 @@ ANALYZE "r_loops": 1, "rows": 71, "r_rows": 71, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -1057,6 +1094,7 @@ ANALYZE "r_loops": 71, "rows": 4, "r_rows": 6.704225352, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 8.492922783, @@ -1124,6 +1162,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -1134,6 +1173,7 @@ EXPLAIN "key_length": "9", "used_key_parts": ["o_totalprice"], "rows": 71, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "orders.o_totalprice between 200000 and 230000", "using_index": true @@ -1154,6 +1194,7 @@ EXPLAIN "used_key_parts": ["l_orderkey"], "ref": ["dbt3_s001.orders.o_orderkey"], "rows": 4, + "cost": "COST_REPLACED", "filtered": 8.492922783, "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'" } @@ -1179,6 +1220,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -1193,6 +1235,7 @@ ANALYZE "r_loops": 1, "rows": 71, "r_rows": 71, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -1218,6 +1261,7 @@ ANALYZE "r_loops": 71, "rows": 4, "r_rows": 6.704225352, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 8.492922783, @@ -1296,6 +1340,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -1312,6 +1357,7 @@ EXPLAIN "key_length": "4", "used_key_parts": ["l_receiptDATE"], "rows": 18, + "cost": "COST_REPLACED", "filtered": 0.566194832, "index_condition": "lineitem.l_receiptDATE between '1996-10-05' and '1996-10-10'", "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-10-10'" @@ -1327,6 +1373,7 @@ EXPLAIN "used_key_parts": ["o_orderkey"], "ref": ["dbt3_s001.lineitem.l_orderkey"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 5.666666508, "attached_condition": "orders.o_totalprice between 200000 and 250000" } @@ -1356,6 +1403,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -1376,6 +1424,7 @@ ANALYZE "r_loops": 1, "rows": 18, "r_rows": 18, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 0.566194832, @@ -1396,6 +1445,7 @@ ANALYZE "r_loops": 7, "rows": 1, "r_rows": 1, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 5.666666508, @@ -1433,6 +1483,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -1449,6 +1500,7 @@ EXPLAIN "key_length": "4", "used_key_parts": ["l_receiptDATE"], "rows": 18, + "cost": "COST_REPLACED", "filtered": 0.566194832, "index_condition": "lineitem.l_receiptDATE between '1996-10-05' and '1996-10-10'", "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-10-10'" @@ -1464,6 +1516,7 @@ EXPLAIN "used_key_parts": ["o_orderkey"], "ref": ["dbt3_s001.lineitem.l_orderkey"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 5.666666508, "attached_condition": "orders.o_totalprice between 200000 and 250000" } @@ -1493,6 +1546,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -1513,6 +1567,7 @@ ANALYZE "r_loops": 1, "rows": 18, "r_rows": 18, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 0.566194832, @@ -1533,6 +1588,7 @@ ANALYZE "r_loops": 7, "rows": 1, "r_rows": 1, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 5.666666508, @@ -1577,6 +1633,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -1587,6 +1644,7 @@ EXPLAIN "key_length": "9", "used_key_parts": ["o_totaldiscount"], "rows": 41, + "cost": "COST_REPLACED", "filtered": 3.333333254, "index_condition": "orders.o_totaldiscount between 18000 and 20000", "attached_condition": "orders.o_totalprice between 200000 and 220000" @@ -1607,6 +1665,7 @@ EXPLAIN "used_key_parts": ["l_orderkey"], "ref": ["dbt3_s001.orders.o_orderkey"], "rows": 4, + "cost": "COST_REPLACED", "filtered": 3.047460556, "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'" } @@ -1636,6 +1695,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -1650,6 +1710,7 @@ ANALYZE "r_loops": 1, "rows": 41, "r_rows": 41, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 3.333333254, @@ -1675,6 +1736,7 @@ ANALYZE "r_loops": 1, "rows": 4, "r_rows": 6, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 3.047460556, @@ -1715,6 +1777,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -1725,6 +1788,7 @@ EXPLAIN "key_length": "9", "used_key_parts": ["o_totaldiscount"], "rows": 41, + "cost": "COST_REPLACED", "filtered": 3.333333254, "index_condition": "orders.o_totaldiscount between 18000 and 20000", "attached_condition": "orders.o_totalprice between 200000 and 220000" @@ -1745,6 +1809,7 @@ EXPLAIN "used_key_parts": ["l_orderkey"], "ref": ["dbt3_s001.orders.o_orderkey"], "rows": 4, + "cost": "COST_REPLACED", "filtered": 3.047460556, "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'" } @@ -1774,6 +1839,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -1788,6 +1854,7 @@ ANALYZE "r_loops": 1, "rows": 41, "r_rows": 41, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 3.333333254, @@ -1813,6 +1880,7 @@ ANALYZE "r_loops": 1, "rows": 4, "r_rows": 6, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 3.047460556, @@ -1856,6 +1924,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "REPLACED", "nested_loop": [ { "table": { @@ -1871,6 +1940,7 @@ EXPLAIN "key_length": "9", "used_key_parts": ["o_totaldiscount"], "rows": 41, + "cost": "REPLACED", "filtered": "REPLACED", "index_condition": "orders.o_totaldiscount between 18000 and 20000", "attached_condition": "orders.o_totalprice between 200000 and 220000 and orders.o_orderDATE between '1992-12-01' and '1997-01-01'" @@ -1891,6 +1961,7 @@ EXPLAIN "used_key_parts": ["l_orderkey"], "ref": ["dbt3_s001.orders.o_orderkey"], "rows": 4, + "cost": "REPLACED", "filtered": "REPLACED", "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'" } @@ -1920,6 +1991,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -1939,6 +2011,7 @@ ANALYZE "r_loops": 1, "rows": 41, "r_rows": 41, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": "REPLACED", @@ -1964,6 +2037,7 @@ ANALYZE "r_loops": 1, "rows": 4, "r_rows": 6, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": "REPLACED", @@ -2004,6 +2078,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "REPLACED", "nested_loop": [ { "table": { @@ -2019,6 +2094,7 @@ EXPLAIN "key_length": "9", "used_key_parts": ["o_totaldiscount"], "rows": 41, + "cost": "REPLACED", "filtered": "REPLACED", "index_condition": "orders.o_totaldiscount between 18000 and 20000", "attached_condition": "orders.o_totalprice between 200000 and 220000 and orders.o_orderDATE between '1992-12-01' and '1997-01-01'" @@ -2039,6 +2115,7 @@ EXPLAIN "used_key_parts": ["l_orderkey"], "ref": ["dbt3_s001.orders.o_orderkey"], "rows": 4, + "cost": "REPLACED", "filtered": "REPLACED", "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'" } @@ -2068,6 +2145,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -2087,6 +2165,7 @@ ANALYZE "r_loops": 1, "rows": 41, "r_rows": 41, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": "REPLACED", @@ -2112,6 +2191,7 @@ ANALYZE "r_loops": 1, "rows": 4, "r_rows": 6, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": "REPLACED", @@ -2193,6 +2273,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -2212,6 +2293,7 @@ EXPLAIN "selectivity_pct": 1.587301587 }, "rows": 1, + "cost": "COST_REPLACED", "filtered": 1.587301612, "index_condition": "t1.f1 is null", "attached_condition": "t1.f2 is null and (t1.f2 between 'a' and 'z' or t1.f1 = 'a')" @@ -2224,6 +2306,7 @@ EXPLAIN "query_block": { "select_id": 2, "operation": "UNION", + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -2243,6 +2326,7 @@ EXPLAIN "selectivity_pct": 1.587301587 }, "rows": 1, + "cost": "COST_REPLACED", "filtered": 1.587301612, "index_condition": "t1.f1 is null", "attached_condition": "t1.f2 is null and (t1.f2 between 'a' and 'z' or t1.f1 = 'a')" @@ -2880,6 +2964,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -2908,6 +2993,7 @@ ANALYZE "r_loops": 1, "rows": 2, "r_rows": 3, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -2929,6 +3015,7 @@ ANALYZE "r_loops": 1, "rows": 1, "r_rows": 3, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -2968,6 +3055,7 @@ ANALYZE "r_loops": 1, "rows": 1, "r_rows": 2, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 17.1428566, diff --git a/mysql-test/main/rowid_filter_innodb.test b/mysql-test/main/rowid_filter_innodb.test index 651d7188808..658f2b57ade 100644 --- a/mysql-test/main/rowid_filter_innodb.test +++ b/mysql-test/main/rowid_filter_innodb.test @@ -47,6 +47,7 @@ let $q= eval $q; eval explain $q; +--source include/explain-no-costs.inc eval explain format=json $q; drop table t1; diff --git a/mysql-test/main/rowid_filter_myisam.result b/mysql-test/main/rowid_filter_myisam.result index 1d892111c69..9984cc9ea1c 100644 --- a/mysql-test/main/rowid_filter_myisam.result +++ b/mysql-test/main/rowid_filter_myisam.result @@ -136,12 +136,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 101, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a2 <> t2.pk2 and t2.a2 is not null" } @@ -164,6 +166,7 @@ EXPLAIN "selectivity_pct": 87 }, "rows": 1, + "cost": "COST_REPLACED", "filtered": 87, "attached_condition": "t1.b1 <= (subquery#2)" } @@ -173,6 +176,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -183,6 +187,7 @@ EXPLAIN "key_length": "4", "used_key_parts": ["pk2"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "index_condition": "t2.pk2 <= 1" } diff --git a/mysql-test/main/rowid_filter_myisam.test b/mysql-test/main/rowid_filter_myisam.test index 7a1cbc9a37b..cb6acb4f836 100644 --- a/mysql-test/main/rowid_filter_myisam.test +++ b/mysql-test/main/rowid_filter_myisam.test @@ -1735,6 +1735,7 @@ SELECT * FROM t1 INNER JOIN t2 ON ( pk1 <> pk2 AND pk1 = a2 ) eval $q; eval EXPLAIN EXTENDED $q; +--source include/explain-no-costs.inc eval EXPLAIN FORMAT=JSON $q; DROP TABLE t1,t2; diff --git a/mysql-test/main/set_operation.result b/mysql-test/main/set_operation.result index 977bc40c0e2..cbd3ce37085 100644 --- a/mysql-test/main/set_operation.result +++ b/mysql-test/main/set_operation.result @@ -571,12 +571,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "REPLACED", "filtered": 100 } } @@ -587,12 +589,14 @@ EXPLAIN "query_block": { "select_id": 8, "operation": "UNION", + "cost": "REPLACED", "nested_loop": [ { "table": { "table_name": "<derived2>", "access_type": "ALL", "rows": 5, + "cost": "REPLACED", "filtered": 100, "materialized": { "query_block": { @@ -603,12 +607,14 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 6, + "cost": "REPLACED", "filtered": 100 } } @@ -628,12 +634,14 @@ EXPLAIN "query_block": { "select_id": 4, "operation": "INTERSECT", + "cost": "REPLACED", "nested_loop": [ { "table": { "table_name": "<derived5>", "access_type": "ALL", "rows": 10, + "cost": "REPLACED", "filtered": 100, "materialized": { "query_block": { @@ -642,12 +650,14 @@ EXPLAIN { "query_block": { "select_id": 5, + "cost": "REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "REPLACED", "filtered": 100 } } @@ -658,12 +668,14 @@ EXPLAIN "query_block": { "select_id": 6, "operation": "UNION", + "cost": "REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "REPLACED", "filtered": 100 } } @@ -692,12 +704,14 @@ EXPLAIN "query_block": { "select_id": 7, "operation": "EXCEPT", + "cost": "REPLACED", "nested_loop": [ { "table": { "table_name": "t3", "access_type": "ALL", "rows": 5, + "cost": "REPLACED", "filtered": 100 } } @@ -708,12 +722,14 @@ EXPLAIN "query_block": { "select_id": 9, "operation": "UNION", + "cost": "REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 6, + "cost": "REPLACED", "filtered": 100 } } @@ -724,12 +740,14 @@ EXPLAIN "query_block": { "select_id": 10, "operation": "UNION", + "cost": "REPLACED", "nested_loop": [ { "table": { "table_name": "t3", "access_type": "ALL", "rows": 5, + "cost": "REPLACED", "filtered": 100 } } @@ -740,12 +758,14 @@ EXPLAIN "query_block": { "select_id": 11, "operation": "EXCEPT", + "cost": "REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "REPLACED", "filtered": 100 } }, @@ -755,6 +775,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 6, + "cost": "REPLACED", "filtered": 100 }, "buffer_type": "flat", @@ -769,12 +790,14 @@ EXPLAIN "query_block": { "select_id": 12, "operation": "UNION", + "cost": "REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 5, + "cost": "REPLACED", "filtered": 100, "attached_condition": "t1.a < 4" } @@ -785,6 +808,7 @@ EXPLAIN "table_name": "t2", "access_type": "ALL", "rows": 6, + "cost": "REPLACED", "filtered": 100 }, "buffer_type": "flat", @@ -799,12 +823,14 @@ EXPLAIN "query_block": { "select_id": 13, "operation": "UNION", + "cost": "REPLACED", "nested_loop": [ { "table": { "table_name": "t3", "access_type": "ALL", "rows": 5, + "cost": "REPLACED", "filtered": 100 } } diff --git a/mysql-test/main/set_operation.test b/mysql-test/main/set_operation.test index c422042f371..e9f71a7e448 100644 --- a/mysql-test/main/set_operation.test +++ b/mysql-test/main/set_operation.test @@ -272,6 +272,7 @@ select * from v0 where g < 4 UNION ALL select * from t3; +--source include/analyze-format.inc EXPLAIN format=json select * from t1 UNION ALL diff --git a/mysql-test/main/show_analyze.result b/mysql-test/main/show_analyze.result index 5595fadd60b..1cda2f20514 100644 --- a/mysql-test/main/show_analyze.result +++ b/mysql-test/main/show_analyze.result @@ -405,6 +405,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "filesort": { @@ -424,6 +425,7 @@ ANALYZE "r_loops": 1, "rows": 2, "r_rows": 2, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, diff --git a/mysql-test/main/show_analyze_json.result b/mysql-test/main/show_analyze_json.result index 8506c4b9402..38a73695e9a 100644 --- a/mysql-test/main/show_analyze_json.result +++ b/mysql-test/main/show_analyze_json.result @@ -44,6 +44,7 @@ SHOW ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "nested_loop": [ { @@ -53,6 +54,7 @@ SHOW ANALYZE "r_loops": 1, "rows": 1000, "r_rows": 1000, + "cost": "REPLACED", "filtered": 50, "r_filtered": 50, "attached_condition": "t1.c < 500" @@ -77,6 +79,7 @@ SHOW ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "nested_loop": [ { @@ -86,6 +89,7 @@ SHOW ANALYZE "r_loops": 1, "rows": 1000, "r_rows": 1000, + "cost": "REPLACED", "filtered": 10, "r_filtered": 10, "attached_condition": "t1.c < 10" @@ -111,6 +115,7 @@ SHOW ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -122,6 +127,7 @@ SHOW ANALYZE "r_loops": 1, "rows": 1000, "r_rows": 1000, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 99.90000153, @@ -160,6 +166,7 @@ SHOW ANALYZE { "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "nested_loop": [ { @@ -169,6 +176,7 @@ SHOW ANALYZE "r_loops": 1, "rows": 10, "r_rows": 10, + "cost": "REPLACED", "filtered": 100, "r_filtered": 60, "attached_condition": "a.a <= 5" @@ -181,6 +189,7 @@ SHOW ANALYZE "query_block": { "select_id": 2, "operation": "UNION", + "cost": "REPLACED", "nested_loop": [ { "table": { @@ -189,6 +198,7 @@ SHOW ANALYZE "r_loops": 0, "rows": 10, "r_rows": null, + "cost": "REPLACED", "filtered": 100, "r_filtered": null, "attached_condition": "b.a >= 9" @@ -229,6 +239,7 @@ SHOW ANALYZE { "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "nested_loop": [ { @@ -238,6 +249,7 @@ SHOW ANALYZE "r_loops": 1, "rows": 10, "r_rows": 10, + "cost": "REPLACED", "filtered": 100, "r_filtered": 60, "attached_condition": "a.a <= 5" @@ -250,6 +262,7 @@ SHOW ANALYZE "query_block": { "select_id": 2, "operation": "UNION", + "cost": "REPLACED", "r_loops": 1, "nested_loop": [ { @@ -259,6 +272,7 @@ SHOW ANALYZE "r_loops": 1, "rows": 10, "r_rows": 10, + "cost": "REPLACED", "filtered": 100, "r_filtered": 10, "attached_condition": "b.a >= 9" @@ -299,6 +313,7 @@ SHOW ANALYZE { "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -309,6 +324,7 @@ SHOW ANALYZE "r_loops": 1, "rows": 10, "r_rows": 10, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -323,6 +339,7 @@ SHOW ANALYZE "query_block": { "select_id": 2, "operation": "UNION", + "cost": "REPLACED", "nested_loop": [ { "table": { @@ -331,6 +348,7 @@ SHOW ANALYZE "r_loops": 0, "rows": 10, "r_rows": null, + "cost": "REPLACED", "filtered": 100, "r_filtered": null, "attached_condition": "b.a >= 9" @@ -371,6 +389,7 @@ SHOW ANALYZE { "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -381,6 +400,7 @@ SHOW ANALYZE "r_loops": 1, "rows": 10, "r_rows": 10, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -395,6 +415,7 @@ SHOW ANALYZE "query_block": { "select_id": 2, "operation": "UNION", + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -405,6 +426,7 @@ SHOW ANALYZE "r_loops": 1, "rows": 10, "r_rows": 10, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -441,6 +463,7 @@ SHOW ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "nested_loop": [ { @@ -450,6 +473,7 @@ SHOW ANALYZE "r_loops": 1, "rows": 10, "r_rows": 10, + "cost": "REPLACED", "filtered": 100, "r_filtered": 20, "attached_condition": "a.a < 2" @@ -460,6 +484,7 @@ SHOW ANALYZE { "query_block": { "select_id": 2, + "cost": "REPLACED", "r_loops": 1, "nested_loop": [ { @@ -469,6 +494,7 @@ SHOW ANALYZE "r_loops": 1, "rows": 10, "r_rows": 10, + "cost": "REPLACED", "filtered": 100, "r_filtered": 30, "attached_condition": "b.a > 6" @@ -501,6 +527,7 @@ SHOW ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -511,6 +538,7 @@ SHOW ANALYZE "r_loops": 1, "rows": 10, "r_rows": 10, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -523,6 +551,7 @@ SHOW ANALYZE { "query_block": { "select_id": 2, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -533,6 +562,7 @@ SHOW ANALYZE "r_loops": 1, "rows": 10, "r_rows": 10, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -567,6 +597,7 @@ SHOW ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "nested_loop": [ { "table": { @@ -575,6 +606,7 @@ SHOW ANALYZE "r_loops": 0, "rows": 10, "r_rows": null, + "cost": "REPLACED", "filtered": 100, "r_filtered": null, "attached_condition": "a.a < 2" @@ -588,6 +620,7 @@ SHOW ANALYZE "r_loops": 0, "query_block": { "select_id": 2, + "cost": "REPLACED", "nested_loop": [ { "table": { @@ -596,6 +629,7 @@ SHOW ANALYZE "r_loops": 0, "rows": 10, "r_rows": null, + "cost": "REPLACED", "filtered": 100, "r_filtered": null, "attached_condition": "b.a + a.a < 10" @@ -629,6 +663,7 @@ SHOW ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "nested_loop": [ { @@ -638,6 +673,7 @@ SHOW ANALYZE "r_loops": 1, "rows": 10, "r_rows": 10, + "cost": "REPLACED", "filtered": 100, "r_filtered": 20, "attached_condition": "a.a < 2" @@ -651,6 +687,7 @@ SHOW ANALYZE "r_hit_ratio": 0, "query_block": { "select_id": 2, + "cost": "REPLACED", "r_loops": 2, "nested_loop": [ { @@ -660,6 +697,7 @@ SHOW ANALYZE "r_loops": 2, "rows": 10, "r_rows": 10, + "cost": "REPLACED", "filtered": 100, "r_filtered": 95, "attached_condition": "b.a + a.a < 10" @@ -693,6 +731,7 @@ SHOW ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -703,6 +742,7 @@ SHOW ANALYZE "r_loops": 1, "rows": 10, "r_rows": 10, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -718,6 +758,7 @@ SHOW ANALYZE "r_hit_ratio": 0, "query_block": { "select_id": 2, + "cost": "REPLACED", "r_loops": 2, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -728,6 +769,7 @@ SHOW ANALYZE "r_loops": 2, "rows": 10, "r_rows": 10, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -791,6 +833,7 @@ SHOW ANALYZE { "query_block": { "select_id": 2, + "cost": "REPLACED", "nested_loop": [ { "table": { @@ -799,6 +842,7 @@ SHOW ANALYZE "r_loops": 0, "rows": 10, "r_rows": null, + "cost": "REPLACED", "filtered": 100, "r_filtered": null, "attached_condition": "t2.a + t0.a < 3" @@ -834,6 +878,7 @@ SHOW ANALYZE { "query_block": { "select_id": 2, + "cost": "REPLACED", "r_loops": 1, "nested_loop": [ { @@ -843,6 +888,7 @@ SHOW ANALYZE "r_loops": 1, "rows": 10, "r_rows": 10, + "cost": "REPLACED", "filtered": 100, "r_filtered": 30, "attached_condition": "t2.a + t0.a < 3" @@ -889,6 +935,7 @@ SHOW ANALYZE { "query_block": { "select_id": 2, + "cost": "REPLACED", "nested_loop": [ { "table": { @@ -897,6 +944,7 @@ SHOW ANALYZE "r_loops": 0, "rows": 10, "r_rows": null, + "cost": "REPLACED", "filtered": 100, "r_filtered": null, "attached_condition": "t2.a + t0.a < 3" @@ -932,6 +980,7 @@ SHOW ANALYZE { "query_block": { "select_id": 2, + "cost": "REPLACED", "r_loops": 1, "nested_loop": [ { @@ -941,6 +990,7 @@ SHOW ANALYZE "r_loops": 1, "rows": 10, "r_rows": 10, + "cost": "REPLACED", "filtered": 100, "r_filtered": 30, "attached_condition": "t2.a + t0.a < 3" @@ -974,6 +1024,7 @@ SHOW ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "nested_loop": [ { @@ -983,6 +1034,7 @@ SHOW ANALYZE "r_loops": 1, "rows": 3, "r_rows": 1, + "cost": "REPLACED", "filtered": 100, "r_filtered": 100 } @@ -995,6 +1047,7 @@ SHOW ANALYZE "r_hit_ratio": 0, "query_block": { "select_id": 2, + "cost": "REPLACED", "nested_loop": [ { "table": { @@ -1003,6 +1056,7 @@ SHOW ANALYZE "r_loops": 0, "rows": 10, "r_rows": null, + "cost": "REPLACED", "filtered": 100, "r_filtered": null, "attached_condition": "t2.a + t0.a < 3" @@ -1026,6 +1080,7 @@ SHOW ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "nested_loop": [ { @@ -1035,6 +1090,7 @@ SHOW ANALYZE "r_loops": 1, "rows": 3, "r_rows": 2, + "cost": "REPLACED", "filtered": 100, "r_filtered": 100 } @@ -1047,6 +1103,7 @@ SHOW ANALYZE "r_hit_ratio": 0, "query_block": { "select_id": 2, + "cost": "REPLACED", "r_loops": 1, "nested_loop": [ { @@ -1056,6 +1113,7 @@ SHOW ANALYZE "r_loops": 1, "rows": 10, "r_rows": 10, + "cost": "REPLACED", "filtered": 100, "r_filtered": 30, "attached_condition": "t2.a + t0.a < 3" @@ -1079,6 +1137,7 @@ SHOW ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "nested_loop": [ { @@ -1088,6 +1147,7 @@ SHOW ANALYZE "r_loops": 1, "rows": 3, "r_rows": 3, + "cost": "REPLACED", "filtered": 100, "r_filtered": 100 } @@ -1100,6 +1160,7 @@ SHOW ANALYZE "r_hit_ratio": 0, "query_block": { "select_id": 2, + "cost": "REPLACED", "r_loops": 2, "nested_loop": [ { @@ -1109,6 +1170,7 @@ SHOW ANALYZE "r_loops": 2, "rows": 10, "r_rows": 10, + "cost": "REPLACED", "filtered": 100, "r_filtered": 25, "attached_condition": "t2.a + t0.a < 3" @@ -1146,6 +1208,7 @@ SHOW ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "nested_loop": [ { @@ -1164,6 +1227,7 @@ SHOW ANALYZE "r_loops": 1, "rows": 10, "r_rows": 10, + "cost": "REPLACED", "filtered": 100, "r_filtered": 100 } @@ -1205,6 +1269,7 @@ SHOW ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "temporary_table": { "nested_loop": [ @@ -1215,6 +1280,7 @@ SHOW ANALYZE "r_loops": 1, "rows": 10, "r_rows": 10, + "cost": "REPLACED", "filtered": 100, "r_filtered": 100 } @@ -1254,6 +1320,7 @@ SHOW ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "temporary_table": { "nested_loop": [ @@ -1264,6 +1331,7 @@ SHOW ANALYZE "r_loops": 1, "rows": 10, "r_rows": 10, + "cost": "REPLACED", "filtered": 100, "r_filtered": 100 } diff --git a/mysql-test/main/show_explain_json.result b/mysql-test/main/show_explain_json.result index a5c441af5b8..1dad0ea2388 100644 --- a/mysql-test/main/show_explain_json.result +++ b/mysql-test/main/show_explain_json.result @@ -47,6 +47,7 @@ SHOW EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -57,6 +58,7 @@ SHOW EXPLAIN "key_length": "5", "used_key_parts": ["a"], "rows": 999, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.a < 100000", "using_index": true @@ -77,6 +79,7 @@ SHOW EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -87,6 +90,7 @@ SHOW EXPLAIN "key_length": "5", "used_key_parts": ["a"], "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "index_condition": "t1.a < 10" } @@ -106,6 +110,7 @@ SHOW EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -116,6 +121,7 @@ SHOW EXPLAIN "key_length": "5", "used_key_parts": ["a"], "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "index_condition": "t1.a < 10" } @@ -138,6 +144,7 @@ SHOW EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -148,6 +155,7 @@ SHOW EXPLAIN "key_length": "5", "used_key_parts": ["a"], "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "index_condition": "t1.a < 10", "mrr_type": "Rowid-ordered scan" @@ -169,6 +177,7 @@ SHOW EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -179,6 +188,7 @@ SHOW EXPLAIN "key_length": "5", "used_key_parts": ["a"], "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "index_condition": "t1.a < 10", "mrr_type": "Rowid-ordered scan" @@ -210,12 +220,14 @@ SHOW EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "A", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -226,12 +238,14 @@ SHOW EXPLAIN "query_block": { "select_id": 2, "operation": "UNION", + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "B", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -266,12 +280,14 @@ SHOW EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "A", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -282,12 +298,14 @@ SHOW EXPLAIN "query_block": { "select_id": 2, "operation": "UNION", + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "B", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -378,12 +396,14 @@ SHOW EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "a", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "a.a < 1" } @@ -394,12 +414,14 @@ SHOW EXPLAIN "expression_cache": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "b", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "b.a + a.a < 10" } @@ -427,12 +449,14 @@ SHOW EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "a", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "a.a < 1" } @@ -443,12 +467,14 @@ SHOW EXPLAIN "expression_cache": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "b", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "b.a + a.a < 10" } @@ -476,12 +502,14 @@ SHOW EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "a", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "a.a < 1" } @@ -492,12 +520,14 @@ SHOW EXPLAIN "expression_cache": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "b", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "b.a + a.a < 10" } @@ -552,12 +582,14 @@ SHOW EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t0", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a + t0.a < 3" } @@ -586,12 +618,14 @@ SHOW EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t0", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a + t0.a < 3" } @@ -628,12 +662,14 @@ SHOW EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t0", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a + t0.a < 3" } @@ -662,12 +698,14 @@ SHOW EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t0", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a + t0.a < 3" } @@ -707,12 +745,14 @@ SHOW EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t0", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a + t0.a < 3" } @@ -741,12 +781,14 @@ SHOW EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t0", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a + t0.a < 3" } @@ -786,12 +828,14 @@ SHOW EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t0", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a + t0.a < 3" } @@ -820,12 +864,14 @@ SHOW EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t0", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a + t0.a < 3" } @@ -854,12 +900,14 @@ SHOW EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -869,12 +917,14 @@ SHOW EXPLAIN "expression_cache": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t0", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a + t0.a < 3" } @@ -893,12 +943,14 @@ SHOW EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -908,12 +960,14 @@ SHOW EXPLAIN "expression_cache": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t0", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a + t0.a < 3" } @@ -932,12 +986,14 @@ SHOW EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -947,12 +1003,14 @@ SHOW EXPLAIN "expression_cache": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t0", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a + t0.a < 3" } @@ -986,12 +1044,14 @@ SHOW EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1001,12 +1061,14 @@ SHOW EXPLAIN "expression_cache": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t0", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a + t0.a < 3" } @@ -1025,12 +1087,14 @@ SHOW EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1040,12 +1104,14 @@ SHOW EXPLAIN "expression_cache": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t0", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a + t0.a < 3" } @@ -1064,12 +1130,14 @@ SHOW EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1079,12 +1147,14 @@ SHOW EXPLAIN "expression_cache": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t0", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t2.a + t0.a < 3" } @@ -1120,6 +1190,7 @@ SHOW EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "read_sorted_file": { @@ -1129,6 +1200,7 @@ SHOW EXPLAIN "table_name": "t0", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1169,6 +1241,7 @@ SHOW EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "temporary_table": { "nested_loop": [ { @@ -1176,6 +1249,7 @@ SHOW EXPLAIN "table_name": "t0", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1215,6 +1289,7 @@ SHOW EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "temporary_table": { "nested_loop": [ { @@ -1222,6 +1297,7 @@ SHOW EXPLAIN "table_name": "t0", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1264,12 +1340,14 @@ SHOW EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t0", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t0.a = <cache>(octet_length('гы'))" } diff --git a/mysql-test/main/show_explain_json.test b/mysql-test/main/show_explain_json.test index 8d2a6aa82bb..321fa46be87 100644 --- a/mysql-test/main/show_explain_json.test +++ b/mysql-test/main/show_explain_json.test @@ -118,6 +118,7 @@ send select count(*) from t1 where a < 100000; connection default; --source include/wait_condition.inc +--source include/explain-no-costs.inc evalp show explain FORMAT=JSON for $thr2; connection con1; reap; @@ -126,6 +127,7 @@ reap; send select max(c) from t1 where a < 10; connection default; --source include/wait_condition.inc +--source include/explain-no-costs.inc evalp explain FORMAT=JSON for connection $thr2; connection con1; reap; @@ -134,6 +136,7 @@ reap; send select max(c) from t1 where a < 10; connection default; --source include/wait_condition.inc +--source include/explain-no-costs.inc evalp explain format=JSON for connection $thr2; connection con1; reap; @@ -145,6 +148,7 @@ set optimizer_switch='index_condition_pushdown=on,mrr=on,mrr_sort_keys=on'; send explain select max(c) from t1 where a < 10; connection default; --source include/wait_condition.inc +--source include/explain-no-costs.inc evalp show explain format=json for $thr2; connection con1; reap; @@ -153,6 +157,7 @@ reap; send explain select max(c) from t1 where a < 10; connection default; --source include/wait_condition.inc +--source include/explain-no-costs.inc evalp explain format=JSON for connection $thr2; connection con1; reap; @@ -165,6 +170,7 @@ SET debug_dbug='+d,show_explain_probe_join_exec_start'; send explain select a from t0 A union select a+1 from t0 B; connection default; --source include/wait_condition.inc +--source include/explain-no-costs.inc evalp show explain format = JSON for $thr2; connection con1; reap; @@ -177,6 +183,7 @@ SET debug_dbug='+d,show_explain_probe_join_exec_start'; send explain select a from t0 A union select a+1 from t0 B; connection default; --source include/wait_condition.inc +--source include/explain-no-costs.inc evalp show explain format=JSON for $thr2; connection con1; reap; @@ -234,6 +241,7 @@ SET debug_dbug='+d,show_explain_probe_join_exec_start'; send select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1; connection default; --source include/wait_condition.inc +--source include/explain-no-costs.inc evalp show explain format=JSON for $thr2; connection con1; reap; @@ -245,6 +253,7 @@ SET debug_dbug='+d,show_explain_probe_join_exec_start'; send select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1; connection default; --source include/wait_condition.inc +--source include/explain-no-costs.inc evalp show explain format=JSON for $thr2; connection con1; reap; @@ -256,6 +265,7 @@ SET debug_dbug='+d,show_explain_probe_join_exec_end'; send select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1; connection default; --source include/wait_condition.inc +--source include/explain-no-costs.inc evalp show explain format=JSON for $thr2; connection con1; reap; @@ -293,8 +303,10 @@ SET debug_dbug='+d,show_explain_probe_join_exec_start'; send update t2 set dummy=0 where (select max(a) from t0 where t2.a + t0.a <3) >3 ; connection default; --source include/wait_condition.inc +--source include/explain-no-costs.inc evalp show explain format=JSON for $thr2; --source include/wait_condition.inc +--source include/explain-no-costs.inc evalp show explain format=JSON for $thr2; connection con1; reap; @@ -308,8 +320,10 @@ SET debug_dbug='+d,show_explain_probe_join_exec_start'; send update t2 set dummy=0 where (select max(a) from t0 where t2.a + t0.a <3) >3 ; connection default; --source include/wait_condition.inc +--source include/explain-no-costs.inc evalp explain format=JSON for connection $thr2; --source include/wait_condition.inc +--source include/explain-no-costs.inc evalp explain format=JSON for connection $thr2; connection con1; reap; @@ -326,8 +340,10 @@ SET debug_dbug='+d,show_explain_probe_join_exec_start'; send delete from t2 where (select max(a) from t0 where t2.a + t0.a <3) >3 ; connection default; --source include/wait_condition.inc +--source include/explain-no-costs.inc evalp show explain format=JSON for $thr2; --source include/wait_condition.inc +--source include/explain-no-costs.inc evalp show explain format=JSON for $thr2; connection con1; reap; @@ -343,8 +359,10 @@ SET debug_dbug='+d,show_explain_probe_join_exec_start'; send delete from t2 where (select max(a) from t0 where t2.a + t0.a <3) >3 ; connection default; --source include/wait_condition.inc +--source include/explain-no-costs.inc evalp explain format=JSON for connection $thr2; --source include/wait_condition.inc +--source include/explain-no-costs.inc evalp explain format=JSON for connection $thr2; connection con1; reap; @@ -360,10 +378,13 @@ SET debug_dbug='+d,show_explain_probe_join_exec_start'; send select t2.a, ((select max(a) from t0 where t2.a + t0.a <3) >3) as SUBQ from t2; connection default; --source include/wait_condition.inc +--source include/explain-no-costs.inc evalp show explain format=json for $thr2; --source include/wait_condition.inc +--source include/explain-no-costs.inc evalp show explain format=json for $thr2; --source include/wait_condition.inc +--source include/explain-no-costs.inc evalp show explain format=json for $thr2; connection con1; reap; @@ -380,10 +401,13 @@ SET debug_dbug='+d,show_explain_probe_join_exec_start'; send select t2.a, ((select max(a) from t0 where t2.a + t0.a <3) >3) as SUBQ from t2; connection default; --source include/wait_condition.inc +--source include/explain-no-costs.inc evalp explain format=JSON for connection $thr2; --source include/wait_condition.inc +--source include/explain-no-costs.inc evalp explain format=JSON for connection $thr2; --source include/wait_condition.inc +--source include/explain-no-costs.inc evalp explain format=JSON for connection $thr2; connection con1; reap; @@ -400,6 +424,7 @@ set @show_explain_probe_select_id=1; send select * from t0 order by a; connection default; --source include/wait_condition.inc +--source include/explain-no-costs.inc evalp show explain format=json for $thr2; connection con1; reap; @@ -417,6 +442,7 @@ set @show_explain_probe_select_id=1; send select distinct a from t0; connection default; --source include/wait_condition.inc +--source include/explain-no-costs.inc evalp show explain format=json for $thr2; connection con1; reap; @@ -435,6 +461,7 @@ set @show_explain_probe_select_id=1; send select distinct a from t0; connection default; --source include/wait_condition.inc +--source include/explain-no-costs.inc evalp show explain format=json for $thr2; connection con1; reap; @@ -461,6 +488,7 @@ select * from t0 where length('ãû') = a; connection default; set names utf8; --source include/wait_condition.inc +--source include/explain-no-costs.inc evalp show explain format=JSON for $thr2; set names default; diff --git a/mysql-test/main/statistics_json.result b/mysql-test/main/statistics_json.result index 748287152b1..14d3720e06e 100644 --- a/mysql-test/main/statistics_json.result +++ b/mysql-test/main/statistics_json.result @@ -8338,12 +8338,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 18, + "cost": "COST_REPLACED", "filtered": 5.555555344, "attached_condition": "t1.a > 'y'" } diff --git a/mysql-test/main/statistics_json.test b/mysql-test/main/statistics_json.test index 5263a98fff7..b9a5c3dbea2 100644 --- a/mysql-test/main/statistics_json.test +++ b/mysql-test/main/statistics_json.test @@ -477,6 +477,7 @@ INSERT INTO t1 VALUES ('o'),('s'),('j'),('s'),('y'),('s'),('l'), set histogram_type=json_hb; analyze table t1 persistent for all; --echo # filtered must not be negative: +--source include/explain-no-costs.inc explain format=json select * from t1 where a > 'y'; drop table t1; diff --git a/mysql-test/main/subselect4.result b/mysql-test/main/subselect4.result index c96379ee856..2e864355afb 100644 --- a/mysql-test/main/subselect4.result +++ b/mysql-test/main/subselect4.result @@ -2927,6 +2927,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "duplicate_removal": { @@ -2939,6 +2940,7 @@ ANALYZE "r_loops": 1, "rows": 2, "r_rows": 2, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -2953,6 +2955,7 @@ ANALYZE "r_loops": 0, "query_block": { "select_id": 2, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -2963,6 +2966,7 @@ ANALYZE "r_loops": 1, "rows": 2, "r_rows": 2, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -2975,6 +2979,7 @@ ANALYZE { "query_block": { "select_id": 3, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -2985,6 +2990,7 @@ ANALYZE "r_loops": 1, "rows": 2, "r_rows": 2, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, diff --git a/mysql-test/main/subselect_cache.result b/mysql-test/main/subselect_cache.result index 5c2fd3e66fc..4e8c3a46205 100644 --- a/mysql-test/main/subselect_cache.result +++ b/mysql-test/main/subselect_cache.result @@ -49,6 +49,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -59,6 +60,7 @@ ANALYZE "r_loops": 1, "rows": 10, "r_rows": 10, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -73,6 +75,7 @@ ANALYZE "r_hit_ratio": 60, "query_block": { "select_id": 2, + "cost": "REPLACED", "r_loops": 4, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -83,6 +86,7 @@ ANALYZE "r_loops": 4, "rows": 4, "r_rows": 4, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -106,6 +110,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -116,6 +121,7 @@ ANALYZE "r_loops": 1, "rows": 10, "r_rows": 10, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -138,6 +144,7 @@ ANALYZE { "query_block": { "select_id": 3, + "cost": "REPLACED", "r_loops": 4, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -148,6 +155,7 @@ ANALYZE "r_loops": 4, "rows": 4, "r_rows": 4, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -178,6 +186,7 @@ ANALYZE "r_hit_ratio": 60, "query_block": { "select_id": 2, + "cost": "REPLACED", "r_loops": 4, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -188,6 +197,7 @@ ANALYZE "r_loops": 4, "rows": 4, "r_rows": 4, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -208,12 +218,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -224,12 +236,14 @@ EXPLAIN "state": "uninitialized", "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 4, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b = t2.c" } @@ -247,12 +261,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -269,12 +285,14 @@ EXPLAIN { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 4, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b = t2.c" } @@ -301,12 +319,14 @@ EXPLAIN "state": "uninitialized", "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t2", "access_type": "ALL", "rows": 4, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "t1.b = t2.c" } diff --git a/mysql-test/main/subselect_cache.test b/mysql-test/main/subselect_cache.test index cf647afb994..7695b01b1ea 100644 --- a/mysql-test/main/subselect_cache.test +++ b/mysql-test/main/subselect_cache.test @@ -34,8 +34,10 @@ select a, (select d from t2 where b=c) from t1; --source include/analyze-format.inc analyze format=json select a, (select d from t2 where b=c), (select d from t2 where b=c union select 1 order by 1 limit 1) from t1; +--source include/explain-no-costs.inc explain format=json select a, (select d from t2 where b=c) from t1; +--source include/explain-no-costs.inc explain format=json select a, (select d from t2 where b=c), (select d from t2 where b=c union select 1 order by 1 limit 1) from t1; set optimizer_switch='subquery_cache=off'; diff --git a/mysql-test/main/subselect_no_semijoin.result b/mysql-test/main/subselect_no_semijoin.result index 0f2a28905d0..383ecf81b48 100644 --- a/mysql-test/main/subselect_no_semijoin.result +++ b/mysql-test/main/subselect_no_semijoin.result @@ -7427,12 +7427,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t1", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -7441,6 +7443,7 @@ EXPLAIN { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "pseudo_bits_condition": "1 = t1.a or <in_optimizer>(1,<exists>(subquery#3))", "nested_loop": [ { @@ -7456,12 +7459,14 @@ EXPLAIN { "query_block": { "select_id": 3, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t3", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "1 = t3.c" } diff --git a/mysql-test/main/subselect_no_semijoin.test b/mysql-test/main/subselect_no_semijoin.test index 84d312c03c8..83488829448 100644 --- a/mysql-test/main/subselect_no_semijoin.test +++ b/mysql-test/main/subselect_no_semijoin.test @@ -24,6 +24,7 @@ INSERT INTO t3 VALUES (4),(5); SET @tmp19714=@@optimizer_switch; SET optimizer_switch='subquery_cache=off'; +--source include/explain-no-costs.inc explain format=json SELECT ( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1; diff --git a/mysql-test/main/table_elim.result b/mysql-test/main/table_elim.result index a99afdef3ec..024225733fd 100644 --- a/mysql-test/main/table_elim.result +++ b/mysql-test/main/table_elim.result @@ -737,6 +737,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "const_condition": "1", "nested_loop": [ { @@ -744,6 +745,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -769,6 +771,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "const_condition": "1", "nested_loop": [ { @@ -776,6 +779,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -789,11 +793,13 @@ EXPLAIN "used_key_parts": ["b"], "ref": ["test.t1.a"], "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "trigcond(t1.a = v2b.b and trigcond(t1.a is not null))", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "const_condition": "1", "filesort": { "sort_key": "t11.a", @@ -804,6 +810,7 @@ EXPLAIN "table_name": "t11", "access_type": "ALL", "rows": 1000, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -831,6 +838,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "const_condition": "1", "nested_loop": [ { @@ -838,6 +846,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -857,6 +866,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "const_condition": "1", "nested_loop": [ { @@ -864,6 +874,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -877,11 +888,13 @@ EXPLAIN "used_key_parts": ["b"], "ref": ["test.t1.a"], "rows": 10, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "trigcond(trigcond(t1.a is not null))", "materialized": { "query_block": { "select_id": 2, + "cost": "COST_REPLACED", "const_condition": "1", "filesort": { "sort_key": "t11.a", @@ -892,6 +905,7 @@ EXPLAIN "table_name": "t11", "access_type": "ALL", "rows": 1000, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -905,6 +919,7 @@ EXPLAIN "used_key_parts": ["pk"], "ref": ["test.t11.b"], "rows": 1, + "cost": "COST_REPLACED", "filtered": 100, "attached_condition": "trigcond(trigcond(t11.b is not null))" } diff --git a/mysql-test/main/table_elim.test b/mysql-test/main/table_elim.test index bd10599ac0b..8127dc9f487 100644 --- a/mysql-test/main/table_elim.test +++ b/mysql-test/main/table_elim.test @@ -680,6 +680,7 @@ group by t11.a; explain select t1.* from t1 left join v2b on v2b.a=t1.a; --echo # Check format JSON as well +--source include/explain-no-costs.inc explain format=JSON select t1.* from t1 left join v2b on t1.a=v2b.a; --echo # Elimination of a whole subquery @@ -692,6 +693,7 @@ explain select t1.* from t1 left join explain select t1.* from t1 left join v2b on t1.a=v2b.b; --echo # Check format JSON as well +--source include/explain-no-costs.inc explain format=JSON select t1.* from t1 left join v2b on t1.a=v2b.b; create view v2c as @@ -703,12 +705,14 @@ group by t11.a; explain select t1.* from t1 left join v2c on v2c.a=t1.a; --echo # Check format JSON as well +--source include/explain-no-costs.inc explain format=JSON select t1.* from t1 left join v2c on v2c.a=t1.a; --echo # In this case v2c cannot be eliminated (since v2c.b is not unique)! explain select t1.* from t1 left join v2c on t1.a=v2c.b; --echo # Check format JSON as well +--source include/explain-no-costs.inc explain format=JSON select t1.* from t1 left join v2c on t1.a=v2c.b; --echo # Create a view with multiple fields in the GROUP BY clause: diff --git a/mysql-test/main/table_value_constr.test b/mysql-test/main/table_value_constr.test index b86244f9605..ade90400b63 100644 --- a/mysql-test/main/table_value_constr.test +++ b/mysql-test/main/table_value_constr.test @@ -833,6 +833,7 @@ deallocate prepare stmt1; explain values (1,2); +--source include/explain-no-costs.inc explain format=json values (1,2); @@ -853,16 +854,19 @@ values (5,6) union values (1,2),(3,4); +--source include/explain-no-costs.inc explain format=json select 1,2 union values (1,2),(3,4); +--source include/explain-no-costs.inc explain format=json values (1,2),(3,4) union select 1,2; +--source include/explain-no-costs.inc explain format=json values (5,6) union @@ -875,6 +879,7 @@ values (3,4) union values (1,2); +--source include/explain-no-costs.inc explain format=json select 1,2 union @@ -899,16 +904,19 @@ values (1,2) union all values (1,2),(3,4); +--source include/explain-no-costs.inc explain format=json values (1,2),(3,4) union all select 1,2; +--source include/explain-no-costs.inc explain format=json select 1,2 union values (1,2),(3,4); +--source include/explain-no-costs.inc explain format=json values (1,2) union all @@ -921,6 +929,7 @@ values (3,4) union all values (1,2); +--source include/explain-no-costs.inc explain format=json select 1,2 union all diff --git a/mysql-test/main/win.result b/mysql-test/main/win.result index 08e6c62c843..6980f39f476 100644 --- a/mysql-test/main/win.result +++ b/mysql-test/main/win.result @@ -1402,6 +1402,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "window_functions_computation": { "sorts": [ { @@ -1417,6 +1418,7 @@ EXPLAIN "table_name": "t0", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1437,6 +1439,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a", "window_functions_computation": { @@ -1454,6 +1457,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1474,6 +1478,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "window_functions_computation": { "sorts": [ { @@ -1489,6 +1494,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1511,6 +1517,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "MX in (3,5,7)", "filesort": { "sort_key": "t1.b", @@ -1529,6 +1536,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1665,6 +1673,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "window_functions_computation": { "sorts": [ { @@ -1680,6 +1689,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1697,6 +1707,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "window_functions_computation": { "sorts": [ { @@ -1712,6 +1723,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1729,6 +1741,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "window_functions_computation": { "sorts": [ { @@ -1744,6 +1757,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1761,6 +1775,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "window_functions_computation": { "sorts": [ { @@ -1776,6 +1791,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1821,6 +1837,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "row_number() over ( order by t1.s1,t1.s2) desc", "window_functions_computation": { @@ -1838,6 +1855,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 6, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1981,6 +1999,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "duplicate_removal": { "window_functions_computation": { "sorts": [ @@ -1997,6 +2016,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -2161,6 +2181,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "window_functions_computation": { "sorts": [ { @@ -2176,6 +2197,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 11, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -2228,6 +2250,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "window_functions_computation": { "sorts": [ { @@ -2243,6 +2266,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 6, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -3827,6 +3851,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "window_functions_computation": { @@ -3852,6 +3877,7 @@ ANALYZE "r_loops": 1, "rows": 3, "r_rows": 3, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, diff --git a/mysql-test/main/win.test b/mysql-test/main/win.test index 5a216123369..f4898d21663 100644 --- a/mysql-test/main/win.test +++ b/mysql-test/main/win.test @@ -927,11 +927,13 @@ drop table t0,t1; create table t0 (a int); insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +--source include/explain-no-costs.inc explain format=json select rank() over (order by a) from t0; create table t1 (a int, b int, c int); insert into t1 select a,a,a from t0; +--source include/explain-no-costs.inc explain format=json select a, @@ -939,6 +941,7 @@ select from t1 group by a; +--source include/explain-no-costs.inc explain format=json select a, @@ -952,6 +955,7 @@ order by null; --echo # select b,max(a) as MX, rank() over (order by b) from t1 group by b having MX in (3,5,7); +--source include/explain-no-costs.inc explain format=json select b,max(a) as MX, rank() over (order by b) from t1 group by b having MX in (3,5,7); @@ -1040,24 +1044,28 @@ from t1; show status like '%sort%'; # Check using EXPLAIN FORMAT=JSON +--source include/explain-no-costs.inc explain format=json select rank() over (partition by c order by a), rank() over (partition by c order by a) from t1; +--source include/explain-no-costs.inc explain format=json select rank() over (order by a), row_number() over (order by a) from t1; +--source include/explain-no-costs.inc explain format=json select rank() over (partition by c order by a), count(*) over (partition by c) from t1; +--source include/explain-no-costs.inc explain format=json select count(*) over (partition by c), @@ -1089,6 +1097,7 @@ insert into t1 values (null,'a'); insert into t1 values (2,'b'); insert into t1 values (-1,''); +--source include/explain-no-costs.inc explain format=json select *, row_number() over (order by s1, s2) as X from t1 order by X desc; select *, row_number() over (order by s1, s2) as X from t1 order by X desc; @@ -1177,6 +1186,7 @@ insert into t1 values select rank() over (partition by part_id order by a) from t1; select distinct rank() over (partition by part_id order by a) from t1; +--source include/explain-no-costs.inc explain format=json select distinct rank() over (partition by part_id order by a) from t1; @@ -1301,6 +1311,7 @@ select pk, a, d, sum(d) over (order by a ROWS BETWEEN 1 preceding and 2 following) as sum_2 from t1; +--source include/explain-no-costs.inc explain format=json select pk, a, d, sum(d) over (partition by a order by pk @@ -1336,6 +1347,7 @@ insert into t1 values (10, 5, 1000), (10, 1, 100); +--source include/explain-no-costs.inc explain format=json select a,b,c, diff --git a/mysql-test/main/win_empty_over.result b/mysql-test/main/win_empty_over.result index 4fa53bb4eae..acb83724d72 100644 --- a/mysql-test/main/win_empty_over.result +++ b/mysql-test/main/win_empty_over.result @@ -36,6 +36,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "window_functions_computation": { "sorts": [ { @@ -54,6 +55,7 @@ EXPLAIN "key_length": "4", "used_key_parts": ["pk"], "rows": 11, + "cost": "COST_REPLACED", "filtered": 100, "using_index": true } @@ -68,6 +70,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "window_functions_computation": { "sorts": [ { @@ -86,6 +89,7 @@ EXPLAIN "key_length": "4", "used_key_parts": ["pk"], "rows": 11, + "cost": "COST_REPLACED", "filtered": 100, "using_index": true } diff --git a/mysql-test/main/win_empty_over.test b/mysql-test/main/win_empty_over.test index 91344d76865..dff15a41e30 100644 --- a/mysql-test/main/win_empty_over.test +++ b/mysql-test/main/win_empty_over.test @@ -21,7 +21,9 @@ insert into t1 values (11, 2, 10, NULL, 0.9, NULL); select pk, row_number() over () from t1; +--source include/explain-no-costs.inc explain FORMAT=JSON select pk, row_number() over () from t1; +--source include/explain-no-costs.inc explain FORMAT=JSON select row_number() over (), pk from t1; select row_number() over () from (select 4) as t; diff --git a/mysql-test/suite/encryption/r/tempfiles_encrypted.result b/mysql-test/suite/encryption/r/tempfiles_encrypted.result index e6cd4d697d0..7baed305b50 100644 --- a/mysql-test/suite/encryption/r/tempfiles_encrypted.result +++ b/mysql-test/suite/encryption/r/tempfiles_encrypted.result @@ -1408,6 +1408,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "window_functions_computation": { "sorts": [ { @@ -1423,6 +1424,7 @@ EXPLAIN "table_name": "t0", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1443,6 +1445,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "t1.a", "window_functions_computation": { @@ -1460,6 +1463,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1480,6 +1484,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "window_functions_computation": { "sorts": [ { @@ -1495,6 +1500,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1517,6 +1523,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "having_condition": "MX in (3,5,7)", "filesort": { "sort_key": "t1.b", @@ -1535,6 +1542,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 10, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1671,6 +1679,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "window_functions_computation": { "sorts": [ { @@ -1686,6 +1695,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1703,6 +1713,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "window_functions_computation": { "sorts": [ { @@ -1718,6 +1729,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1735,6 +1747,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "window_functions_computation": { "sorts": [ { @@ -1750,6 +1763,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1767,6 +1781,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "window_functions_computation": { "sorts": [ { @@ -1782,6 +1797,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 3, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1827,6 +1843,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "filesort": { "sort_key": "row_number() over ( order by t1.s1,t1.s2) desc", "window_functions_computation": { @@ -1844,6 +1861,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 6, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -1987,6 +2005,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "duplicate_removal": { "window_functions_computation": { "sorts": [ @@ -2003,6 +2022,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 9, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -2167,6 +2187,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "window_functions_computation": { "sorts": [ { @@ -2182,6 +2203,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 11, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -2234,6 +2256,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "window_functions_computation": { "sorts": [ { @@ -2249,6 +2272,7 @@ EXPLAIN "table_name": "t1", "access_type": "ALL", "rows": 6, + "cost": "COST_REPLACED", "filtered": 100 } } @@ -3833,6 +3857,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "window_functions_computation": { @@ -3858,6 +3883,7 @@ ANALYZE "r_loops": 1, "rows": 3, "r_rows": 3, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, diff --git a/mysql-test/suite/federated/federatedx_create_handlers.result b/mysql-test/suite/federated/federatedx_create_handlers.result index feb9c77de7f..b4e369e64e1 100644 --- a/mysql-test/suite/federated/federatedx_create_handlers.result +++ b/mysql-test/suite/federated/federatedx_create_handlers.result @@ -160,12 +160,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t3", "access_type": "ALL", "rows": 7, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -179,6 +181,7 @@ EXPLAIN "used_key_parts": ["name"], "ref": ["federated.t3.name"], "rows": 2, + "cost": "COST_REPLACED", "filtered": 100, "materialized": { "query_block": { @@ -231,6 +234,7 @@ ANALYZE }, "query_block": { "select_id": 1, + "cost": "REPLACED", "r_loops": 1, "r_total_time_ms": "REPLACED", "nested_loop": [ @@ -241,6 +245,7 @@ ANALYZE "r_loops": 1, "rows": 7, "r_rows": 7, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -259,6 +264,7 @@ ANALYZE "r_loops": 7, "rows": 2, "r_rows": 0, + "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, @@ -364,12 +370,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "t5", "access_type": "ALL", "rows": 2, + "cost": "COST_REPLACED", "filtered": 100 } }, @@ -379,6 +387,7 @@ EXPLAIN "table_name": "<derived2>", "access_type": "ALL", "rows": 5, + "cost": "COST_REPLACED", "filtered": 100 }, "buffer_type": "flat", diff --git a/mysql-test/suite/federated/federatedx_create_handlers.test b/mysql-test/suite/federated/federatedx_create_handlers.test index 8863a057b47..ebe9b403d5b 100644 --- a/mysql-test/suite/federated/federatedx_create_handlers.test +++ b/mysql-test/suite/federated/federatedx_create_handlers.test @@ -75,6 +75,7 @@ SELECT id FROM federated.t1 WHERE id < 5; EXPLAIN EXTENDED SELECT id FROM federated.t1 WHERE id < 5; +--source include/explain-no-costs.inc EXPLAIN FORMAT=JSON SELECT id FROM federated.t1 WHERE id < 5; @@ -102,6 +103,7 @@ SELECT * FROM federated.t3, (SELECT * FROM federated.t1 WHERE id > 3) t WHERE federated.t3.name=t.name; +--source include/explain-no-costs.inc EXPLAIN FORMAT=JSON SELECT * FROM federated.t3, (SELECT * FROM federated.t1 WHERE id > 3) t @@ -176,6 +178,7 @@ explain select * from federated.t1 where name in (select name from federated.t2); +--source include/explain-no-costs.inc explain format=json select * from federated.t1 where name in (select name from federated.t2); @@ -195,6 +198,7 @@ select * from t5, where name in (select name from federated.t2) or name like 'foo%') as TQ; --echo # Must not show elements with select_id=3 +--source include/explain-no-costs.inc explain format=json select * from t5, (select id from federated.t1 diff --git a/mysql-test/suite/json/r/json_table.result b/mysql-test/suite/json/r/json_table.result index 44957352865..3eefaa72c1d 100644 --- a/mysql-test/suite/json/r/json_table.result +++ b/mysql-test/suite/json/r/json_table.result @@ -211,12 +211,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "tt", "access_type": "ALL", "rows": 40, + "cost": "COST_REPLACED", "filtered": 100, "table_function": "json_table" } diff --git a/mysql-test/suite/json/r/json_table_mysql.result b/mysql-test/suite/json/r/json_table_mysql.result index cdca41b3a24..44ca370f01f 100644 --- a/mysql-test/suite/json/r/json_table_mysql.result +++ b/mysql-test/suite/json/r/json_table_mysql.result @@ -189,12 +189,14 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { "table_name": "tt", "access_type": "ALL", "rows": 40, + "cost": "COST_REPLACED", "filtered": 100, "table_function": "json_table" } diff --git a/mysql-test/suite/json/t/json_table.test b/mysql-test/suite/json/t/json_table.test index 492be2d48bf..982922ff595 100644 --- a/mysql-test/suite/json/t/json_table.test +++ b/mysql-test/suite/json/t/json_table.test @@ -145,6 +145,7 @@ create view v2 as select * from json_table('[{"co\\\\lor": "blue", "price": 50 select * from v2; drop view v2; +--source include/explain-no-costs.inc explain format=json select * from json_table('[{"a": 1, "b": [11,111]}, {"a": 2, "b": [22,222]}]', '$[*]' COLUMNS( a INT PATH '$.a')) as tt; explain select * from diff --git a/mysql-test/suite/json/t/json_table_mysql.test b/mysql-test/suite/json/t/json_table_mysql.test index 9f77ad964f3..3b0fb556260 100644 --- a/mysql-test/suite/json/t/json_table_mysql.test +++ b/mysql-test/suite/json/t/json_table_mysql.test @@ -167,6 +167,7 @@ select * from #eval $query; #eval explain $query; +--source include/explain-no-costs.inc explain format=json select * from json_table( diff --git a/sql/sql_explain.cc b/sql/sql_explain.cc index 9f907c9ed2c..b4b9698bff5 100644 --- a/sql/sql_explain.cc +++ b/sql/sql_explain.cc @@ -1022,6 +1022,9 @@ void Explain_select::print_explain_json(Explain_query *query, writer->add_member("select_id").add_ll(select_id); add_linkage(writer); + if (cost != 0.0) + writer->add_member("cost").add_double(cost); + if (is_analyze && time_tracker.get_loops()) { writer->add_member("r_loops").add_ll(time_tracker.get_loops()); @@ -1930,7 +1933,13 @@ void Explain_table_access::print_explain_json(Explain_query *query, else writer->add_null(); } + } + + if (cost != 0.0) + writer->add_member("cost").add_double(cost); + if (is_analyze) + { if (op_tracker.get_loops()) { double total_time= op_tracker.get_time_ms(); diff --git a/sql/sql_explain.h b/sql/sql_explain.h index 42a1c360e5b..9e560c0be23 100644 --- a/sql/sql_explain.h +++ b/sql/sql_explain.h @@ -216,6 +216,7 @@ public: message(NULL), having(NULL), having_value(Item::COND_UNDEF), using_temporary(false), using_filesort(false), + cost(0.0), time_tracker(is_analyze), aggr_tree(NULL) {} @@ -249,9 +250,10 @@ public: bool using_temporary; bool using_filesort; + double cost; /* ANALYZE members */ Time_and_counter_tracker time_tracker; - + /* Part of query plan describing sorting, temp.table usage, and duplicate removal @@ -824,6 +826,9 @@ public: ha_rows rows; double filtered; + /* Total cost incurred during one execution of this select */ + double cost; + /* Contents of the 'Extra' column. Some are converted into strings, some have parameters, values for which are stored below. diff --git a/sql/sql_select.cc b/sql/sql_select.cc index f7995877ed4..51a5a2b76b2 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -11945,6 +11945,7 @@ bool JOIN::get_best_combination() j->records_init= j->records_out= j->records_read; j->records= (ha_rows) j->records_read; j->cond_selectivity= 1.0; + j->join_read_time= 0.0; /* Not saved currently */ JOIN_TAB *jt; JOIN_TAB_RANGE *jt_range; if (!(jt= (JOIN_TAB*) thd->alloc(sizeof(JOIN_TAB)*sjm->tables)) || @@ -12005,6 +12006,7 @@ bool JOIN::get_best_combination() j->records_init= cur_pos->records_init; j->records_read= cur_pos->records_read; j->records_out= cur_pos->records_out; + j->join_read_time= cur_pos->read_time; loop_end: j->cond_selectivity= cur_pos->cond_selectivity; @@ -28476,6 +28478,7 @@ bool JOIN_TAB::save_explain_data(Explain_table_access *eta, explain_plan= eta; eta->key.clear(); eta->quick_info= NULL; + eta->cost= join_read_time; SQL_SELECT *tab_select; /* @@ -29089,6 +29092,7 @@ int JOIN::save_explain_data_intern(Explain_query *output, table_map used_tables=0; join->select_lex->set_explain_type(true); + xpl_sel->cost= best_read; xpl_sel->select_id= join->select_lex->select_number; xpl_sel->select_type= join->select_lex->type; xpl_sel->linkage= select_lex->get_linkage(); diff --git a/sql/sql_select.h b/sql/sql_select.h index 416c13da16f..3418159a50f 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -350,6 +350,12 @@ typedef struct st_join_table { /* Copy of POSITION::records_out, set by get_best_combination() */ double records_out; + /* + Copy of POSITION::read_time, set by get_best_combination(). The cost of + accessing the table in course of the join execution. + */ + double join_read_time; + /* The selectivity of the conditions that can be pushed to the table */ double cond_selectivity; diff --git a/storage/rocksdb/mysql-test/rocksdb/include/rocksdb_icp.inc b/storage/rocksdb/mysql-test/rocksdb/include/rocksdb_icp.inc index c76b52d4cc1..bf593ec9b0c 100644 --- a/storage/rocksdb/mysql-test/rocksdb/include/rocksdb_icp.inc +++ b/storage/rocksdb/mysql-test/rocksdb/include/rocksdb_icp.inc @@ -49,7 +49,7 @@ insert into t3 select a,a/10,a,a from t1; explain select * from t3 where kp1=3 and kp2 like '%foo%'; ---replace_column 9 # +--source include/explain-no-costs.inc explain format=json select * from t3 where kp1 between 2 and 4 and mod(kp1,3)=0 and kp2 like '%foo%'; diff --git a/storage/rocksdb/mysql-test/rocksdb/r/rocksdb_icp.result b/storage/rocksdb/mysql-test/rocksdb/r/rocksdb_icp.result index f9e3129c73f..7443909b1ac 100644 --- a/storage/rocksdb/mysql-test/rocksdb/r/rocksdb_icp.result +++ b/storage/rocksdb/mysql-test/rocksdb/r/rocksdb_icp.result @@ -47,6 +47,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -57,6 +58,7 @@ EXPLAIN "key_length": "5", "used_key_parts": ["kp1"], "rows": 1000, + "cost": "COST_REPLACED", "filtered": 100, "index_condition": "t3.kp1 between 2 and 4 and t3.kp1 MOD 3 = 0", "attached_condition": "t3.kp2 like '%foo%'" diff --git a/storage/rocksdb/mysql-test/rocksdb/r/rocksdb_icp_rev.result b/storage/rocksdb/mysql-test/rocksdb/r/rocksdb_icp_rev.result index 3634f8c023e..ece58586d8b 100644 --- a/storage/rocksdb/mysql-test/rocksdb/r/rocksdb_icp_rev.result +++ b/storage/rocksdb/mysql-test/rocksdb/r/rocksdb_icp_rev.result @@ -47,6 +47,7 @@ EXPLAIN { "query_block": { "select_id": 1, + "cost": "COST_REPLACED", "nested_loop": [ { "table": { @@ -57,6 +58,7 @@ EXPLAIN "key_length": "5", "used_key_parts": ["kp1"], "rows": 1000, + "cost": "COST_REPLACED", "filtered": 100, "index_condition": "t3.kp1 between 2 and 4 and t3.kp1 MOD 3 = 0", "attached_condition": "t3.kp2 like '%foo%'" |