summaryrefslogtreecommitdiffstats
path: root/mysql-test/main/derived_cond_pushdown.result
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/main/derived_cond_pushdown.result')
-rw-r--r--mysql-test/main/derived_cond_pushdown.result2669
1 files changed, 2292 insertions, 377 deletions
diff --git a/mysql-test/main/derived_cond_pushdown.result b/mysql-test/main/derived_cond_pushdown.result
index e08abc22..d91b4510 100644
--- a/mysql-test/main/derived_cond_pushdown.result
+++ b/mysql-test/main/derived_cond_pushdown.result
@@ -122,12 +122,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -136,7 +139,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.max_c > 214"
},
@@ -147,6 +152,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",
@@ -156,7 +162,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -208,12 +216,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null"
}
@@ -227,12 +238,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 9,
"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",
@@ -242,7 +256,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -297,12 +313,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -311,7 +330,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.max_c > 400 or v1.max_c < 135"
},
@@ -322,6 +343,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",
@@ -331,7 +353,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -375,12 +399,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -389,7 +416,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.max_c > 300 or v1.max_c < 135"
},
@@ -400,6 +429,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",
@@ -409,7 +439,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -442,12 +474,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -456,7 +491,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a > 6"
},
@@ -467,6 +504,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -476,7 +514,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 6"
}
@@ -519,12 +559,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -533,7 +576,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v2.b > 25"
},
@@ -544,6 +589,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -553,7 +599,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5 and t1.b > 25"
}
@@ -617,12 +665,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -631,7 +682,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a > 7 or v1.a < 2"
},
@@ -642,6 +695,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -651,7 +705,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 7 or t1.a < 2"
}
@@ -708,12 +764,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -722,7 +781,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v2.a > 7 or v2.a > 5"
},
@@ -733,6 +794,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -742,7 +804,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5 and (t1.a > 7 or t1.a > 5)"
}
@@ -785,12 +849,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -799,7 +866,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a > 4 or v1.a < 2"
},
@@ -810,6 +879,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -819,7 +889,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 4 or t1.a < 2"
}
@@ -855,12 +927,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -869,7 +944,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a < 2 and v1.max_c > 400"
},
@@ -880,6 +957,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",
@@ -889,7 +967,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 2"
}
@@ -928,7 +1008,7 @@ explain select * from v_double as v,t2_double as t where
(v.a=t.a) and (v.avg_a>0.45) and (v.b>10);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t.a 2 Using where
+1 PRIMARY <derived2> ref key0 key0 5 test.t.a 1 Using where
2 DERIVED t1_double ALL NULL NULL NULL NULL 9 Using where; Using temporary; Using filesort
explain format=json select * from v_double as v,t2_double as t where
(v.a=t.a) and (v.avg_a>0.45) and (v.b>10);
@@ -936,12 +1016,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t.a is not null"
}
@@ -955,12 +1038,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t.a"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "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",
@@ -970,7 +1056,9 @@ EXPLAIN
"table": {
"table_name": "t1_double",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1_double.b > 12.2 and t1_double.b > 10"
}
@@ -997,7 +1085,7 @@ explain select * from v_decimal as v,t2_decimal as t where
(v.a=t.a) and (v.avg_c>15) and (v.b>1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 3 test.t.a 2 Using where
+1 PRIMARY <derived2> ref key0 key0 3 test.t.a 1 Using where
2 DERIVED t1_decimal ALL NULL NULL NULL NULL 9 Using where; Using temporary; Using filesort
explain format=json select * from v_decimal as v,t2_decimal as t where
(v.a=t.a) and (v.avg_c>15) and (v.b>1);
@@ -1005,12 +1093,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t.a is not null"
}
@@ -1024,12 +1115,15 @@ EXPLAIN
"key_length": "3",
"used_key_parts": ["a"],
"ref": ["test.t.a"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "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",
@@ -1039,7 +1133,9 @@ EXPLAIN
"table": {
"table_name": "t1_decimal",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1_decimal.b > 1"
}
@@ -1097,12 +1193,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -1111,7 +1210,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"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 +1223,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",
@@ -1131,7 +1233,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 7 or t1.a < 4"
}
@@ -1196,12 +1300,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -1210,7 +1317,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a < 2 and v1.max_c > 120 or v1.a > 7"
},
@@ -1221,6 +1330,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",
@@ -1230,7 +1340,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 2 or t1.a > 7"
}
@@ -1284,12 +1396,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -1298,7 +1413,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a < 2 and v1.max_c > 120 or v1.a > 7"
},
@@ -1309,6 +1426,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",
@@ -1318,7 +1436,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 2 or t1.a > 7"
}
@@ -1361,12 +1481,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -1375,7 +1498,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a < 2 and v1.max_c < 200 or v1.a > 4"
},
@@ -1386,6 +1511,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",
@@ -1395,7 +1521,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 2 or t1.a > 4"
}
@@ -1448,12 +1576,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -1462,7 +1593,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.max_c > 400 or v1.max_c < 135"
},
@@ -1473,6 +1606,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",
@@ -1482,7 +1616,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1501,12 +1637,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -1515,7 +1654,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.max_c > 400 or v1.max_c < 135"
},
@@ -1526,6 +1667,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",
@@ -1535,7 +1677,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1570,12 +1714,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a = 1 and t2.b is not null"
}
@@ -1589,12 +1736,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["test.t2.b"],
+ "loops": 9,
"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",
@@ -1604,7 +1754,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1"
}
@@ -1635,12 +1787,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.d is not null"
}
@@ -1654,12 +1809,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["max_c"],
"ref": ["test.t2.d"],
+ "loops": 9,
"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",
@@ -1669,7 +1827,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 5"
}
@@ -1707,12 +1867,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a < 5 and t2.a is not null"
}
@@ -1726,11 +1889,14 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 9,
"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",
@@ -1740,7 +1906,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 5"
}
@@ -1769,12 +1937,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null and t2.a is not null"
}
@@ -1788,11 +1959,14 @@ EXPLAIN
"key_length": "10",
"used_key_parts": ["a", "b"],
"ref": ["test.t2.a", "test.t2.a"],
+ "loops": 9,
"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",
@@ -1802,7 +1976,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b = t1.a"
}
@@ -1836,12 +2012,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.c > 150 and t2.c is not null"
}
@@ -1855,11 +2034,14 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["max_c"],
"ref": ["test.t2.c"],
+ "loops": 9,
"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",
@@ -1869,7 +2051,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1899,12 +2083,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a = 3"
}
@@ -1914,7 +2101,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a = 3 and v1.b = 3"
},
@@ -1924,13 +2113,16 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 3 and t1.b = 3"
}
@@ -1959,12 +2151,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a = 2"
}
@@ -1974,7 +2169,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a = 1 and v1.b = 21"
},
@@ -1984,13 +2181,16 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1 and t1.b = 21"
}
@@ -2025,17 +2225,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"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",
@@ -2045,7 +2249,9 @@ EXPLAIN
"table": {
"table_name": "t1_char",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1_char.a = 'c' and t1_char.b < 'Hermes'"
}
@@ -2062,7 +2268,9 @@ EXPLAIN
"table": {
"table_name": "t",
"access_type": "ALL",
+ "loops": 12,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -2100,7 +2308,7 @@ explain select * from v_decimal as v,t2_decimal as t where
(v.a=v.b) and (v.b=t.b) and ((t.b>1) or (v.a=1));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 6 test.t.b,test.t.b 2
+1 PRIMARY <derived2> ref key0 key0 6 test.t.b,test.t.b 1
2 DERIVED t1_decimal ALL NULL NULL NULL NULL 9 Using where; Using temporary; Using filesort
explain format=json select * from v_decimal as v,t2_decimal as t where
(v.a=v.b) and (v.b=t.b) and ((t.b>1) or (v.a=1));
@@ -2108,12 +2316,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t",
"access_type": "ALL",
+ "loops": 1,
"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"
}
@@ -2127,11 +2338,14 @@ EXPLAIN
"key_length": "6",
"used_key_parts": ["a", "b"],
"ref": ["test.t.b", "test.t.b"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "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",
@@ -2141,7 +2355,9 @@ EXPLAIN
"table": {
"table_name": "t1_decimal",
"access_type": "ALL",
+ "loops": 1,
"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 +2403,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a < 4 or t2.c > 150"
}
@@ -2202,7 +2421,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -2212,6 +2433,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",
@@ -2221,7 +2443,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -2256,12 +2480,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"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"
}
@@ -2275,11 +2502,14 @@ EXPLAIN
"key_length": "10",
"used_key_parts": ["a", "max_c"],
"ref": ["test.t2.a", "test.t2.c"],
+ "loops": 9,
"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",
@@ -2289,7 +2519,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5"
}
@@ -2336,12 +2568,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a = 8"
}
@@ -2351,7 +2586,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a = 8 and v1.max_c = 404"
},
@@ -2361,6 +2598,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c = 404",
"filesort": {
"sort_key": "t1.b",
@@ -2370,7 +2608,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 8"
}
@@ -2406,12 +2646,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.d is not null"
}
@@ -2425,12 +2668,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["max_c"],
"ref": ["test.t2.d"],
+ "loops": 9,
"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",
@@ -2440,7 +2686,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 3"
}
@@ -2468,7 +2716,7 @@ explain select * from v_double as v,t2_double as t where
(v.b=v.c) and (v.c=t.c) and ((t.c>10) or (v.a=1));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 18 test.t.c,test.t.c 2 Using where
+1 PRIMARY <derived2> ref key0 key0 18 test.t.c,test.t.c 1 Using where
2 DERIVED t1_double ALL NULL NULL NULL NULL 9 Using where; Using temporary; Using filesort
explain format=json select * from v_double as v,t2_double as t where
(v.b=v.c) and (v.c=t.c) and ((t.c>10) or (v.a=1));
@@ -2476,12 +2724,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t.c is not null and t.c is not null"
}
@@ -2495,12 +2746,15 @@ EXPLAIN
"key_length": "18",
"used_key_parts": ["b", "c"],
"ref": ["test.t.c", "test.t.c"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "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",
@@ -2510,7 +2764,9 @@ EXPLAIN
"table": {
"table_name": "t1_double",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1_double.c = t1_double.b and t1_double.b > 12.2"
}
@@ -2543,7 +2799,7 @@ explain select * from v_double as v,t2_double as t where
(((v.a>0.2) or (v.b<17)) or (t.c>17)) and (t.c=v.c) and (v.c>18);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 9 test.t.c 2 Using where
+1 PRIMARY <derived2> ref key0 key0 9 test.t.c 1 Using where
2 DERIVED t1_double ALL NULL NULL NULL NULL 9 Using where; Using temporary; Using filesort
explain format=json select * from v_double as v,t2_double as t where
(((v.a>0.2) or (v.b<17)) or (t.c>17)) and (t.c=v.c) and (v.c>18);
@@ -2551,12 +2807,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t.c > 18 and t.c is not null"
}
@@ -2570,12 +2829,15 @@ EXPLAIN
"key_length": "9",
"used_key_parts": ["c"],
"ref": ["test.t.c"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "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",
@@ -2585,7 +2847,9 @@ EXPLAIN
"table": {
"table_name": "t1_double",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1_double.b > 12.2 and t1_double.c > 18"
}
@@ -2657,17 +2921,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"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",
@@ -2677,7 +2945,9 @@ EXPLAIN
"table": {
"table_name": "t1_decimal",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1_decimal.a > 4 or t1_decimal.a = 2 or t1_decimal.b > 3"
}
@@ -2694,7 +2964,9 @@ EXPLAIN
"table": {
"table_name": "t",
"access_type": "ALL",
+ "loops": 9,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -2731,12 +3003,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null and t2.a is not null"
}
@@ -2750,12 +3025,15 @@ EXPLAIN
"key_length": "10",
"used_key_parts": ["a", "b"],
"ref": ["test.t2.a", "test.t2.a"],
+ "loops": 9,
"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",
@@ -2765,7 +3043,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b = t1.a and t1.a > 5"
}
@@ -2807,12 +3087,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a < 2 and t2.c > 900"
}
@@ -2822,7 +3105,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -2831,6 +3116,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -2840,7 +3126,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -2874,12 +3162,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null and t2.b is not null"
}
@@ -2893,11 +3184,14 @@ EXPLAIN
"key_length": "10",
"used_key_parts": ["a", "b"],
"ref": ["test.t2.a", "test.t2.b"],
+ "loops": 9,
"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",
@@ -2907,7 +3201,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -2955,12 +3251,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -2969,7 +3268,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -2979,6 +3280,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -2988,7 +3290,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -3060,12 +3364,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -3074,7 +3381,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -3084,6 +3393,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -3093,7 +3403,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -3137,12 +3449,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a < 2 and t2.c > 900"
}
@@ -3152,7 +3467,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -3162,6 +3479,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -3171,7 +3489,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -3214,12 +3534,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null and t2.a is not null"
}
@@ -3233,11 +3556,14 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 9,
"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",
@@ -3247,7 +3573,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -3267,12 +3595,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 18,
"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",
@@ -3282,7 +3613,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5 and t1.b < 50"
}
@@ -3345,12 +3678,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.b < 50"
}
@@ -3360,7 +3696,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -3370,6 +3708,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -3379,7 +3718,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -3399,12 +3740,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["v1.b"],
+ "loops": 180,
"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",
@@ -3414,7 +3758,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5"
}
@@ -3457,12 +3803,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -3471,7 +3820,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -3481,6 +3832,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -3490,7 +3842,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -3506,7 +3860,9 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 180,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
},
"buffer_type": "incremental",
@@ -3516,6 +3872,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -3525,7 +3882,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5"
}
@@ -3572,12 +3931,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -3586,7 +3948,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.max_c < 300"
},
@@ -3596,6 +3960,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",
@@ -3605,7 +3970,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -3621,7 +3988,9 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 180,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v2.b < 50 or v2.b = 19"
},
@@ -3632,6 +4001,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -3641,7 +4011,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5 and (t1.b < 50 or t1.b = 19)"
}
@@ -3679,12 +4051,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"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"
}
@@ -3698,11 +4073,14 @@ EXPLAIN
"key_length": "10",
"used_key_parts": ["a", "b"],
"ref": ["test.t2.a", "test.t2.a"],
+ "loops": 9,
"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",
@@ -3712,7 +4090,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b = t1.a"
}
@@ -3733,12 +4113,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 18,
"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",
@@ -3748,7 +4131,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5"
}
@@ -3783,12 +4168,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -3797,7 +4185,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a = 1 and v1.b > 10"
},
@@ -3808,6 +4198,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.b",
@@ -3817,7 +4208,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1 and t1.b > 10"
}
@@ -3838,11 +4231,14 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["v1.b"],
+ "loops": 180,
"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",
@@ -3852,7 +4248,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5 and t1.b > 10"
}
@@ -3898,17 +4296,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"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",
@@ -3918,7 +4320,9 @@ EXPLAIN
"table": {
"table_name": "t1_char",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1_char.a = 'b' and (t1_char.b = 'Vika' or t1_char.b = 'Ali')"
}
@@ -3935,7 +4339,9 @@ EXPLAIN
"table": {
"table_name": "t",
"access_type": "ALL",
+ "loops": 12,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t.a = 'b'"
},
@@ -4005,12 +4411,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null"
}
@@ -4024,12 +4433,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 9,
"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",
@@ -4039,7 +4451,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 10 and (t1.b < 50 or t1.b = 33)"
}
@@ -4056,7 +4470,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 18,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.max_c < 500"
},
@@ -4066,6 +4482,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",
@@ -4075,7 +4492,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -4091,7 +4510,9 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 360,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v2.max_c > 300"
},
@@ -4102,6 +4523,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",
@@ -4111,7 +4533,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5"
}
@@ -4164,12 +4588,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.b is not null"
}
@@ -4183,12 +4610,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["test.t2.b"],
+ "loops": 9,
"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",
@@ -4198,7 +4628,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5"
}
@@ -4219,12 +4651,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["v1.a"],
+ "loops": 18,
"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",
@@ -4234,7 +4669,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5"
}
@@ -4320,12 +4757,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -4334,7 +4774,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.avg_c < 400 or v1.a > 1"
},
@@ -4345,6 +4787,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",
@@ -4354,7 +4797,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5"
}
@@ -4375,12 +4820,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["v1.a"],
+ "loops": 180,
"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",
@@ -4390,7 +4838,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5"
}
@@ -4411,12 +4861,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["v1.b"],
+ "loops": 360,
"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",
@@ -4426,7 +4879,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 8"
}
@@ -4487,12 +4942,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -4501,7 +4959,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(v1.a = 1 or v1.max_c < 300) and v1.b > 25"
},
@@ -4512,6 +4972,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",
@@ -4521,7 +4982,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 25"
}
@@ -4568,12 +5031,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null"
}
@@ -4587,12 +5053,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 9,
"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",
@@ -4602,7 +5071,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5 and t1.b < 30"
}
@@ -4656,12 +5127,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.c > 800 and t2.b is not null"
}
@@ -4675,12 +5149,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["test.t2.b"],
+ "loops": 9,
"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",
@@ -4690,7 +5167,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 5"
}
@@ -4709,12 +5188,15 @@ EXPLAIN
"query_block": {
"select_id": 2,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.d > 800"
}
@@ -4724,7 +5206,9 @@ EXPLAIN
"table": {
"table_name": "<derived4>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.max_c > 100 and v1.a > 7"
},
@@ -4734,6 +5218,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",
@@ -4743,7 +5228,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 7"
}
@@ -4820,12 +5307,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.b = 19"
}
@@ -4835,7 +5325,9 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.b = 19 and v1.a < 5"
},
@@ -4845,6 +5337,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a",
@@ -4854,7 +5347,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b = 19 and t1.a < 5"
}
@@ -4873,12 +5368,15 @@ EXPLAIN
"query_block": {
"select_id": 2,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -4887,7 +5385,9 @@ EXPLAIN
"table": {
"table_name": "<derived4>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.max_c > 400 or v1.avg_c > 270"
},
@@ -4898,6 +5398,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",
@@ -4907,7 +5408,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -4995,12 +5498,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -5009,7 +5515,9 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a = 1 or v1.a = 6"
},
@@ -5020,6 +5528,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -5029,7 +5538,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1 or t1.a = 6"
}
@@ -5048,12 +5559,15 @@ EXPLAIN
"query_block": {
"select_id": 2,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -5062,7 +5576,9 @@ EXPLAIN
"table": {
"table_name": "<derived4>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a > 3 and v1.b > 27 or v1.max_c > 550"
},
@@ -5073,6 +5589,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",
@@ -5082,7 +5599,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -5171,12 +5690,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a = 1"
}
@@ -5186,7 +5708,9 @@ EXPLAIN
"table": {
"table_name": "<derived4>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a = 1 and (v1.max_c < 500 or v1.avg_c > 500)"
},
@@ -5197,6 +5721,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",
@@ -5206,7 +5731,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1"
}
@@ -5225,12 +5752,15 @@ EXPLAIN
"query_block": {
"select_id": 2,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a < 2"
}
@@ -5240,7 +5770,9 @@ EXPLAIN
"table": {
"table_name": "<derived5>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v2.b > 10"
},
@@ -5251,6 +5783,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 5,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -5260,7 +5793,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5 and t1.b > 10"
}
@@ -5279,12 +5814,15 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.c is not null"
}
@@ -5298,12 +5836,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["max_c"],
"ref": ["test.t2.c"],
+ "loops": 9,
"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",
@@ -5313,7 +5854,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5 and t1.b < 10"
}
@@ -5368,12 +5911,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -5382,7 +5928,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 40,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v_union.a < 3 and v_union.c > 100"
},
@@ -5398,6 +5946,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 109 and c > 100",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -5407,7 +5956,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 10 and t1.a < 3"
}
@@ -5421,6 +5972,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",
@@ -5430,7 +5982,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and t1.a < 3"
}
@@ -5490,12 +6044,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -5504,7 +6061,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"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 +6080,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",
@@ -5530,7 +6090,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 10 and t1.b > 12"
}
@@ -5544,6 +6106,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",
@@ -5553,7 +6116,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and t1.b > 12"
}
@@ -5590,7 +6155,7 @@ explain select * from v_union,t2 where
(v_union.a=1) and (v_union.a=t2.a) and (v_union.c<200);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ALL NULL NULL NULL NULL 40 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY <derived2> ALL distinct_key NULL NULL NULL 40 Using where; Using join buffer (flat, BNL join)
2 DERIVED t1 ALL NULL NULL NULL NULL 20 Using where; Using temporary; Using filesort
3 UNION t1 ALL NULL NULL NULL NULL 20 Using where; Using temporary; Using filesort
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
@@ -5600,12 +6165,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a = 1"
}
@@ -5615,7 +6183,10 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "possible_keys": ["distinct_key"],
+ "loops": 9,
"rows": 40,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v_union.a = 1 and v_union.c < 200"
},
@@ -5631,6 +6202,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 109 and c < 200",
"filesort": {
"sort_key": "t1.b",
@@ -5640,7 +6212,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1"
}
@@ -5654,6 +6228,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"having_condition": "c < 300 and c < 200",
"filesort": {
"sort_key": "t1.b",
@@ -5663,7 +6238,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1 and t1.b > 10"
}
@@ -5700,7 +6277,7 @@ explain select * from v_char as v,t2_char as t where
(v.a=t.a) and (v.b='Vika') and (v.max_c>2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t ALL NULL NULL NULL NULL 12 Using where
-1 PRIMARY <derived2> ref key0 key0 2 test.t.a 2 Using where
+1 PRIMARY <derived2> ref key0 key0 2 test.t.a 1 Using where
2 DERIVED t1_char ALL NULL NULL NULL NULL 12 Using where; Using temporary; Using filesort
explain format=json select * from v_char as v,t2_char as t where
(v.a=t.a) and (v.b='Vika') and (v.max_c>2);
@@ -5708,12 +6285,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t.a is not null"
}
@@ -5727,12 +6307,15 @@ EXPLAIN
"key_length": "2",
"used_key_parts": ["a"],
"ref": ["test.t.a"],
- "rows": 2,
+ "loops": 12,
+ "rows": 1,
+ "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",
@@ -5742,7 +6325,9 @@ EXPLAIN
"table": {
"table_name": "t1_char",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1_char.b = 'Vika'"
}
@@ -5779,7 +6364,7 @@ and ((v_union.c>800) or (v1.max_c>200));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
1 PRIMARY <derived4> ALL NULL NULL NULL NULL 20 Using where; Using join buffer (flat, BNL join)
-1 PRIMARY <derived2> ALL NULL NULL NULL NULL 40 Using where; Using join buffer (incremental, BNL join)
+1 PRIMARY <derived2> ALL distinct_key NULL NULL NULL 40 Using where; Using join buffer (incremental, BNL join)
4 DERIVED t1 ALL NULL NULL NULL NULL 20 Using where; Using temporary; Using filesort
2 DERIVED t1 ALL NULL NULL NULL NULL 20 Using where; Using temporary; Using filesort
3 UNION t1 ALL NULL NULL NULL NULL 20 Using where; Using temporary; Using filesort
@@ -5791,12 +6376,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a = 1"
}
@@ -5806,7 +6394,9 @@ EXPLAIN
"table": {
"table_name": "<derived4>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a = 1"
},
@@ -5816,6 +6406,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 4,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.b",
@@ -5825,7 +6416,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1"
}
@@ -5842,7 +6435,10 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "possible_keys": ["distinct_key"],
+ "loops": 180,
"rows": 40,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v_union.a = 1"
},
@@ -5859,6 +6455,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 109",
"filesort": {
"sort_key": "t1.b",
@@ -5868,7 +6465,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1"
}
@@ -5882,6 +6481,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"having_condition": "c < 300",
"filesort": {
"sort_key": "t1.b",
@@ -5891,7 +6491,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1 and t1.b > 10"
}
@@ -5936,7 +6538,7 @@ explain select * from v2_union as v,t2 where
((v.a=6) or (v.a=8)) and (v.c>200) and (v.a=t2.a);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 6 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 6 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 20 Using where; Using temporary; Using filesort
3 UNION t1 ALL NULL NULL NULL NULL 20 Using where; Using temporary; Using filesort
4 UNION t1 ALL NULL NULL NULL NULL 20 Using where; Using temporary; Using filesort
@@ -5947,12 +6549,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t2.a = 6 or t2.a = 8) and t2.a is not null"
}
@@ -5961,12 +6566,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 9,
"rows": 6,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v.c > 200",
"materialized": {
@@ -5978,6 +6585,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 109 and c > 200",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -5987,7 +6595,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 10 and (t1.a = 6 or t1.a = 8)"
}
@@ -6001,6 +6611,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",
@@ -6010,7 +6621,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and (t1.a = 6 or t1.a = 8)"
}
@@ -6024,6 +6637,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",
@@ -6033,7 +6647,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.c > 300 and (t1.a = 6 or t1.a = 8)"
}
@@ -6125,7 +6741,7 @@ a b c a b c d
explain select * from v3_union as v,t2 where (v.a=t2.a) and (v.c>6);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 4 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 4 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 20 Using where
3 UNION t1 ALL NULL NULL NULL NULL 20 Using where
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
@@ -6134,12 +6750,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null"
}
@@ -6148,12 +6767,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 9,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v.c > 6",
"materialized": {
@@ -6165,12 +6786,15 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 10 and t1.a + 1 > 6"
}
@@ -6182,12 +6806,15 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and t1.c > 100 and t1.c > 6"
}
@@ -6257,7 +6884,7 @@ a b c a b c d
explain select * from v3_union as v,t2 where (v.a=t2.a) and ((t2.a>1) or (v.b<20));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 4 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 4 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 20 Using where
3 UNION t1 ALL NULL NULL NULL NULL 20 Using where
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
@@ -6266,12 +6893,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null"
}
@@ -6280,12 +6910,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 9,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a > 1 or v.b < 20",
"materialized": {
@@ -6297,12 +6929,15 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 10 and (t1.a > 1 or t1.b < 20)"
}
@@ -6314,12 +6949,15 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and t1.c > 100 and (t1.a > 1 or t1.b < 20)"
}
@@ -6356,7 +6994,7 @@ explain select * from v3_union as v,t2 where
(v.a=t2.a) and ((v.b=19) or (v.b=21)) and ((v.c<3) or (v.c>600));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 4 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 4 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 20 Using where
3 UNION t1 ALL NULL NULL NULL NULL 20 Using where
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
@@ -6366,12 +7004,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null"
}
@@ -6380,12 +7021,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 9,
"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 +7040,15 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"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 +7060,15 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"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)"
}
@@ -6454,7 +7103,7 @@ a b c a b c d
explain select * from v4_union as v,t2 where (v.a=t2.a) and (v.b<20);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 4 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 4 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 20 Using where; Using temporary; Using filesort
3 UNION t1 ALL NULL NULL NULL NULL 20 Using where
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
@@ -6463,12 +7112,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null"
}
@@ -6477,12 +7129,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 9,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v.b < 20",
"materialized": {
@@ -6494,6 +7148,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 109",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -6503,7 +7158,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 10 and t1.b < 20"
}
@@ -6517,12 +7174,15 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and t1.b < 20"
}
@@ -6575,7 +7235,7 @@ explain select * from v4_union as v,t2 where
(v.a=t2.a) and ((t2.a<3) or (v.b<40)) and (v.c>500);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 4 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 4 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 20 Using where; Using temporary; Using filesort
3 UNION t1 ALL NULL NULL NULL NULL 20 Using where
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
@@ -6585,12 +7245,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null"
}
@@ -6599,12 +7262,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 9,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t2.a < 3 or v.b < 40) and v.c > 500",
"materialized": {
@@ -6616,6 +7281,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 109 and c > 500",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -6625,7 +7291,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 10 and (t1.a < 3 or t1.b < 40)"
}
@@ -6639,12 +7307,15 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"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 +7380,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"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": {
@@ -6728,12 +7403,15 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"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",
@@ -6743,7 +7421,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 15 and t1.a < 13"
}
@@ -6767,7 +7447,9 @@ EXPLAIN
"table": {
"table_name": "<derived4>",
"access_type": "ALL",
+ "loops": 20,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a > 5 and v1.b > 12"
},
@@ -6777,6 +7459,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 4,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -6786,7 +7469,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5 and t1.b > 12"
}
@@ -6829,12 +7514,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null and t2.a is not null"
}
@@ -6848,11 +7536,14 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 9,
"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": {
@@ -6861,12 +7552,15 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"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",
@@ -6876,7 +7570,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 15"
}
@@ -6904,12 +7600,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 18,
"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",
@@ -6919,7 +7618,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 30"
}
@@ -6964,12 +7665,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a > 1 and t2.a is not null and t2.a is not null"
}
@@ -6983,12 +7687,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 9,
"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",
@@ -6998,12 +7705,15 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"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",
@@ -7013,7 +7723,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 15 and t1.a > 1"
}
@@ -7041,12 +7753,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 18,
"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",
@@ -7056,7 +7771,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 1 and t1.b < 30"
}
@@ -7186,12 +7903,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -7200,7 +7920,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v4.b > 10 and v4.a > 1 or v4.b < 20"
},
@@ -7211,6 +7933,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "v1.a, v1.b",
"temporary_table": {
@@ -7219,12 +7942,15 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"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",
@@ -7234,7 +7960,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 15 and (t1.b > 10 and t1.a > 1 or t1.b < 20)"
}
@@ -7262,12 +7990,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["v4.a"],
+ "loops": 180,
"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",
@@ -7277,7 +8008,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -7315,17 +8048,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"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",
@@ -7335,12 +8072,15 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"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",
@@ -7350,7 +8090,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 15 and (t1.a > 12 and t1.b > 13 or t1.a < 1)"
}
@@ -7374,7 +8116,9 @@ EXPLAIN
"table": {
"table_name": "<derived4>",
"access_type": "ALL",
+ "loops": 20,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -7383,6 +8127,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 4,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -7392,7 +8137,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5"
}
@@ -7432,17 +8179,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"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",
@@ -7452,12 +8203,15 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"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",
@@ -7467,7 +8221,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b = t1.a and t1.a < 15"
}
@@ -7495,11 +8251,14 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["v4.a"],
+ "loops": 20,
"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",
@@ -7509,7 +8268,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5"
}
@@ -7549,17 +8310,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"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": {
@@ -7568,12 +8333,15 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"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",
@@ -7583,7 +8351,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b = t1.a and t1.a < 15 and t1.a < 30"
}
@@ -7611,11 +8381,14 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["v4.a"],
+ "loops": 20,
"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",
@@ -7625,7 +8398,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5 and t1.b < 30"
}
@@ -7665,17 +8440,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"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": {
@@ -7684,12 +8463,15 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"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",
@@ -7699,7 +8481,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"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)"
}
@@ -7727,11 +8511,14 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["v4.a"],
+ "loops": 20,
"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",
@@ -7741,7 +8528,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5 and (t1.b < 30 or t1.b > 2)"
}
@@ -7789,17 +8578,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"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",
@@ -7809,12 +8602,15 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"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",
@@ -7824,7 +8620,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 15 and (t1.a < 12 and t1.b > 13 or t1.a > 10)"
}
@@ -7852,11 +8650,14 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["max_c"],
"ref": ["v4.min_c"],
+ "loops": 20,
"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",
@@ -7866,7 +8667,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5"
}
@@ -7913,12 +8716,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.c > 100 and t2.c is not null"
}
@@ -7932,12 +8738,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["min_c"],
"ref": ["test.t2.c"],
+ "loops": 9,
"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",
@@ -7947,12 +8756,15 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"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",
@@ -7962,7 +8774,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 15 and (t1.a < 12 or t1.a > 10)"
}
@@ -7986,7 +8800,9 @@ EXPLAIN
"table": {
"table_name": "<derived4>",
"access_type": "ALL",
+ "loops": 18,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -7995,6 +8811,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 4,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -8004,7 +8821,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5"
}
@@ -8159,6 +8978,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"const_condition": "0 or <in_optimizer>(2,<exists>(subquery#3))",
"nested_loop": [
{
@@ -8173,8 +8993,10 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
- "filtered": 100,
+ "cost": "COST_REPLACED",
+ "filtered": 50,
"attached_condition": "t2.b = 2",
"first_match": "t1"
}
@@ -8184,6 +9006,7 @@ EXPLAIN
{
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -8194,17 +9017,22 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["c"],
"ref": ["func"],
- "rows": 2,
+ "loops": 1,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 5,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t3.c = 2"
}
@@ -8246,7 +9074,7 @@ SELECT d FROM v4 WHERE s > a
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where; FirstMatch(t1)
-3 DEPENDENT SUBQUERY <derived5> index_subquery key0 key0 5 func 2 Using where
+3 DEPENDENT SUBQUERY <derived5> index_subquery key0 key0 5 func 1 Using where
5 DERIVED t4 ALL NULL NULL NULL NULL 5 Using temporary; Using filesort
explain format=json SELECT * FROM t1 WHERE a IN (
SELECT b FROM v2 WHERE b < a OR b IN (
@@ -8257,6 +9085,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"const_condition": "0 or <in_optimizer>(2,<exists>(subquery#3))",
"nested_loop": [
{
@@ -8271,8 +9100,10 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
- "filtered": 100,
+ "cost": "COST_REPLACED",
+ "filtered": 50,
"attached_condition": "t2.b = 2",
"first_match": "t1"
}
@@ -8282,6 +9113,7 @@ EXPLAIN
{
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -8292,11 +9124,14 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["d"],
"ref": ["func"],
- "rows": 2,
+ "loops": 1,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 5,
+ "cost": "COST_REPLACED",
"having_condition": "s > 2",
"filesort": {
"sort_key": "t4.d",
@@ -8306,7 +9141,9 @@ EXPLAIN
"table": {
"table_name": "t4",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -8361,23 +9198,29 @@ EXPLAIN
{
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived4>",
"access_type": "ALL",
+ "loops": 1,
"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",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.b = 1"
}
@@ -8416,12 +9259,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -8434,18 +9280,23 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["test.t1.a"],
- "rows": 2,
+ "loops": 2,
+ "rows": 1,
+ "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",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -8471,23 +9322,29 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"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",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "<nop>(t1.i <= 3)"
}
@@ -8532,12 +9389,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "<in_optimizer>(t1.b,<exists>(subquery#2)) or t1.b = 100"
}
@@ -8547,6 +9407,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -8557,17 +9418,22 @@ EXPLAIN
"key_length": "4",
"used_key_parts": ["pk2"],
"ref": ["func"],
- "rows": 2,
+ "loops": 1,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 4,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -8594,12 +9460,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "<in_optimizer>(t1.b,<exists>(subquery#3)) or t1.b = 100"
}
@@ -8609,6 +9478,7 @@ EXPLAIN
{
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -8619,17 +9489,22 @@ EXPLAIN
"key_length": "4",
"used_key_parts": ["pk2"],
"ref": ["func"],
- "rows": 2,
+ "loops": 1,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 4,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -8678,23 +9553,29 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"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",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 50"
}
@@ -8736,17 +9617,21 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"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",
@@ -8756,7 +9641,9 @@ EXPLAIN
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -8794,13 +9681,14 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<subquery2>",
"access_type": "system",
- "rows": 1,
- "filtered": 100,
+ "rows": 0,
+ "filtered": 0,
"materialized": {
"unique": 1,
"query_block": {
@@ -8819,18 +9707,23 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"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",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b = 2"
}
@@ -8864,13 +9757,14 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<subquery2>",
"access_type": "system",
- "rows": 1,
- "filtered": 100,
+ "rows": 0,
+ "filtered": 0,
"materialized": {
"unique": 1,
"query_block": {
@@ -8886,18 +9780,23 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"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",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t.f = 2"
}
@@ -8912,7 +9811,9 @@ EXPLAIN
"table": {
"table_name": "<derived4>",
"access_type": "ALL",
+ "loops": 2,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v2.pk > 2"
},
@@ -8922,6 +9823,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 4,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -8931,7 +9833,9 @@ EXPLAIN
"key": "PRIMARY",
"key_length": "4",
"used_key_parts": ["pk"],
+ "loops": 1,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t.pk > 2"
}
@@ -8964,13 +9868,14 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<subquery3>",
"access_type": "system",
- "rows": 1,
- "filtered": 100,
+ "rows": 0,
+ "filtered": 0,
"materialized": {
"unique": 1,
"query_block": {
@@ -8986,18 +9891,23 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"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",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.i = 3"
}
@@ -9031,13 +9941,14 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<subquery3>",
"access_type": "system",
- "rows": 1,
- "filtered": 100,
+ "rows": 0,
+ "filtered": 0,
"materialized": {
"unique": 1,
"query_block": {
@@ -9053,18 +9964,23 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"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",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.i = 2.7100000381469727"
}
@@ -9093,13 +10009,14 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<subquery3>",
"access_type": "system",
- "rows": 1,
- "filtered": 100,
+ "rows": 0,
+ "filtered": 0,
"materialized": {
"unique": 1,
"query_block": {
@@ -9115,18 +10032,23 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"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",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.i = 3.21"
}
@@ -9155,13 +10077,14 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<subquery3>",
"access_type": "system",
- "rows": 1,
- "filtered": 100,
+ "rows": 0,
+ "filtered": 0,
"materialized": {
"unique": 1,
"query_block": {
@@ -9177,18 +10100,23 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"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",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.i = 'aa'"
}
@@ -9219,13 +10147,14 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<subquery3>",
"access_type": "system",
- "rows": 1,
- "filtered": 100,
+ "rows": 0,
+ "filtered": 0,
"materialized": {
"unique": 1,
"query_block": {
@@ -9241,18 +10170,23 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"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",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.i = TIMESTAMP'2007-05-28 00:00:00'"
}
@@ -9281,13 +10215,14 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<subquery3>",
"access_type": "system",
- "rows": 1,
- "filtered": 100,
+ "rows": 0,
+ "filtered": 0,
"materialized": {
"unique": 1,
"query_block": {
@@ -9303,18 +10238,23 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"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",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.i = DATE'2007-05-28'"
}
@@ -9343,13 +10283,14 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<subquery3>",
"access_type": "system",
- "rows": 1,
- "filtered": 100,
+ "rows": 0,
+ "filtered": 0,
"materialized": {
"unique": 1,
"query_block": {
@@ -9365,18 +10306,23 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"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",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.i = TIME'10:00:02'"
}
@@ -9405,23 +10351,29 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"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",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "nullif(1,t1.i)"
}
@@ -9500,23 +10452,29 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"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",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.c = 'foo'"
}
@@ -9531,12 +10489,15 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "1 = t2.a"
}
@@ -9561,23 +10522,29 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"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",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -9591,12 +10558,15 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 128,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "1 = t2.a"
}
@@ -9737,12 +10707,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 7,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 2 and t1.a is not null"
}
@@ -9756,11 +10729,14 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["test.t1.a"],
- "rows": 2,
+ "loops": 7,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t2.b",
"temporary_table": {
@@ -9769,7 +10745,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.b > 2"
}
@@ -9797,12 +10775,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 7,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 2 and t1.a is not null"
}
@@ -9816,11 +10797,14 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["test.t1.a"],
- "rows": 2,
+ "loops": 7,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t2.b",
"temporary_table": {
@@ -9829,7 +10813,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.b > 2"
}
@@ -9860,12 +10846,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 7,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 2 and t1.a is not null"
}
@@ -9879,18 +10868,23 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["test.t1.a"],
- "rows": 2,
+ "loops": 7,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.b > 2"
}
@@ -9917,12 +10911,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 7,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 2 and t1.a is not null"
}
@@ -9936,11 +10933,14 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["m"],
"ref": ["test.t1.a"],
- "rows": 2,
+ "loops": 7,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "m > 2",
"filesort": {
"sort_key": "t2.b",
@@ -9950,7 +10950,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -9980,24 +10982,30 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"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": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -10028,6 +11036,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -10038,7 +11047,9 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["i1"],
"ref": ["const"],
+ "loops": 1,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"using_index": true
}
@@ -10048,7 +11059,9 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v2.i2 = 1"
},
@@ -10058,12 +11071,15 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.i2 = 1"
}
@@ -10096,24 +11112,30 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"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": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -10151,12 +11173,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.id2 is not null"
}
@@ -10170,12 +11195,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["id2"],
"ref": ["test.t1.id2"],
- "rows": 2,
+ "loops": 4,
+ "rows": 1,
+ "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",
@@ -10185,7 +11213,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -10250,12 +11280,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.x = 1"
}
@@ -10265,7 +11298,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 2,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a = 1 and v1.b = 1 and v1.max_c > 30"
},
@@ -10275,13 +11310,16 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c > 37 and max_c > 30",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1 and t1.b = 1"
}
@@ -10335,12 +11373,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.x = 1"
}
@@ -10350,7 +11391,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 2,
"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,13 +11403,16 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c > 37 and max_c > 30",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1 and t1.b = 1 and t1.d = 1"
}
@@ -10433,7 +11479,7 @@ WHERE d_tab.e>1
;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 5 Using where
-1 PRIMARY <derived3> ref key0 key0 10 test.t1.a,test.t1.b 2 FirstMatch(t1)
+1 PRIMARY <derived3> eq_ref distinct_key distinct_key 10 test.t1.a,test.t1.b 1
3 DERIVED t2 ALL NULL NULL NULL NULL 5 Using where; Using temporary; Using filesort
EXPLAIN FORMAT=JSON SELECT * FROM t1
WHERE (t1.a,t1.b) IN
@@ -10452,12 +11498,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 1 and t1.a is not null and t1.b is not null"
}
@@ -10465,18 +11514,20 @@ EXPLAIN
{
"table": {
"table_name": "<derived3>",
- "access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "access_type": "eq_ref",
+ "possible_keys": ["distinct_key"],
+ "key": "distinct_key",
"key_length": "10",
"used_key_parts": ["e", "max_f"],
"ref": ["test.t1.a", "test.t1.b"],
- "rows": 2,
+ "loops": 5,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
- "first_match": "t1",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "max_f > 18",
"filesort": {
"sort_key": "t2.e",
@@ -10486,7 +11537,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.e > 1"
}
@@ -10532,7 +11585,7 @@ WHERE d_tab.max_f<25
;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 5 Using where
-1 PRIMARY <derived3> ref key0 key0 10 test.t1.a,test.t1.b 2 FirstMatch(t1)
+1 PRIMARY <derived3> eq_ref distinct_key distinct_key 10 test.t1.a,test.t1.b 1
3 DERIVED t2 ALL NULL NULL NULL NULL 5 Using temporary; Using filesort
EXPLAIN FORMAT=JSON SELECT * FROM t1
WHERE (t1.a,t1.b) IN
@@ -10551,12 +11604,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b < 25 and t1.a is not null and t1.b is not null"
}
@@ -10564,18 +11620,20 @@ EXPLAIN
{
"table": {
"table_name": "<derived3>",
- "access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "access_type": "eq_ref",
+ "possible_keys": ["distinct_key"],
+ "key": "distinct_key",
"key_length": "10",
"used_key_parts": ["e", "max_f"],
"ref": ["test.t1.a", "test.t1.b"],
- "rows": 2,
+ "loops": 5,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
- "first_match": "t1",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "max_f > 18 and max_f < 25",
"filesort": {
"sort_key": "t2.e",
@@ -10585,7 +11643,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -10649,12 +11709,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a is not null and t1.b is not null"
}
@@ -10668,24 +11731,30 @@ EXPLAIN
"key_length": "8",
"used_key_parts": ["e", "max_f"],
"ref": ["test.t1.a", "test.t1.b"],
+ "loops": 5,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"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": {
@@ -10694,7 +11763,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.e > 1"
}
@@ -10765,12 +11836,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a is not null and t1.b is not null"
}
@@ -10784,24 +11858,30 @@ EXPLAIN
"key_length": "8",
"used_key_parts": ["e", "max_f"],
"ref": ["test.t1.a", "test.t1.b"],
+ "loops": 5,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"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",
@@ -10811,7 +11891,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -10873,17 +11955,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"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",
@@ -10893,7 +11979,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -10930,17 +12018,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"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",
@@ -10950,7 +12042,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 3"
}
@@ -10987,17 +12081,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"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": {
@@ -11006,7 +12104,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -11042,17 +12142,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"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": {
@@ -11061,7 +12165,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -11117,12 +12223,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "1 in (0,t1.a) and t1.a is not null"
}
@@ -11136,11 +12245,14 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t1.a"],
- "rows": 2,
+ "loops": 2,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
@@ -11149,7 +12261,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "1 in (0,t1.a) and 1 in (0,t1.a)"
}
@@ -11185,12 +12299,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a in (1,t1.a) and t1.a is not null"
}
@@ -11204,11 +12321,14 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t1.a"],
- "rows": 2,
+ "loops": 2,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
@@ -11217,7 +12337,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a in (1,t1.a)"
}
@@ -11316,17 +12438,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"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": {
@@ -11335,7 +12461,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 7,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a <= 2"
}
@@ -11362,12 +12490,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null"
}
@@ -11381,12 +12512,15 @@ EXPLAIN
"key_length": "8",
"used_key_parts": ["c"],
"ref": ["test.t2.a"],
- "rows": 2,
+ "loops": 5,
+ "rows": 1,
+ "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": {
@@ -11395,7 +12529,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 7,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a >= 3"
}
@@ -11425,12 +12561,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -11438,18 +12577,23 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 5,
"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",
+ "loops": 1,
"rows": 7,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 2"
}
@@ -11499,17 +12643,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"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",
@@ -11519,7 +12667,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -11556,17 +12706,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"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",
@@ -11576,7 +12730,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -11613,17 +12769,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"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",
@@ -11633,7 +12793,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -11670,17 +12832,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"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": {
@@ -11689,7 +12855,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "case when t1.b = 2 or t1.b = 4 then 1 else 0 end = 1"
}
@@ -11747,33 +12915,42 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"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",
+ "loops": 1,
"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",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -11787,7 +12964,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 12,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.f is not null"
},
@@ -11830,23 +13009,29 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
- "rows": 16,
+ "loops": 1,
+ "rows": 8,
+ "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",
+ "loops": 1,
"rows": 8,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.f is not null"
}
@@ -11860,17 +13045,22 @@ EXPLAIN
"key_length": "4",
"used_key_parts": ["f"],
"ref": ["test.t1.f"],
- "rows": 2,
+ "loops": 8,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 4,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 8,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.f is not null"
}
@@ -11908,19 +13098,22 @@ DROP TABLE t1;
#
CREATE TABLE t1 (f1 text, f2 int);
INSERT INTO t1 VALUES ('x',1), ('y',2);
-CREATE VIEW v1 AS SELECT f2 FROM ( SELECT f2 FROM t1 ) AS t;
+CREATE VIEW v1 AS SELECT f2 FROM ( SELECT f2 FROM t1 GROUP BY f2) AS t;
UPDATE v1, t1 SET t1.f1 = 'z' WHERE v1.f2 < 2 AND t1.f2 = v1.f2;
EXPLAIN FORMAT=JSON UPDATE v1, t1 SET t1.f1 = 'z' WHERE v1.f2 < 2 AND t1.f2 = v1.f2;
EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.f2 < 2 and t1.f2 is not null"
}
@@ -11934,22 +13127,32 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["f2"],
"ref": ["test.t1.f2"],
- "rows": 2,
+ "loops": 2,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 3,
- "nested_loop": [
- {
- "table": {
- "table_name": "t1",
- "access_type": "ALL",
- "rows": 2,
- "filtered": 100,
- "attached_condition": "t1.f2 < 2"
- }
+ "cost": "COST_REPLACED",
+ "filesort": {
+ "sort_key": "t1.f2",
+ "temporary_table": {
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "loops": 1,
+ "rows": 2,
+ "cost": "COST_REPLACED",
+ "filtered": 100,
+ "attached_condition": "t1.f2 < 2"
+ }
+ }
+ ]
}
- ]
+ }
}
}
}
@@ -11970,12 +13173,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.f2 < 2 and t1.f2 is not null"
}
@@ -11989,18 +13195,23 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["f2"],
"ref": ["test.t1.f2"],
+ "loops": 2,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.f2 < 2"
}
@@ -12050,12 +13261,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
@@ -12256,12 +13470,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v3.col1 = 123 and v3.col2 = 321",
"materialized": {
@@ -12271,6 +13488,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -12281,7 +13499,9 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["const"],
+ "loops": 1,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -12292,6 +13512,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -12302,7 +13523,9 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["const"],
+ "loops": 1,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -12340,17 +13563,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"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)",
@@ -12360,7 +13587,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 1"
}
@@ -12393,12 +13622,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t4",
"access_type": "ALL",
+ "loops": 1,
"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"
}
@@ -12412,13 +13644,16 @@ EXPLAIN
"key_length": "23",
"used_key_parts": ["a", "f1(a)", "sum(b)"],
"ref": ["test.t4.a", "test.t4.b", "test.t4.c"],
+ "loops": 3,
"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": [
@@ -12426,7 +13661,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a + 1 > 10"
}
@@ -12481,7 +13718,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (v1.a<5);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 2
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 1
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
NULL INTERSECT RESULT <intersect2,3> ALL NULL NULL NULL NULL NULL
@@ -12490,12 +13727,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a < 5 and t2.a is not null"
}
@@ -12504,12 +13744,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
@@ -12520,6 +13762,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c < 300",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -12529,7 +13772,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and t1.a < 5"
}
@@ -12543,6 +13788,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "INTERSECT",
+ "cost": "COST_REPLACED",
"having_condition": "c > 100",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -12552,7 +13798,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and t1.a < 5"
}
@@ -12583,7 +13831,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (v1.a=8);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY <derived2> ALL distinct_key NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
NULL INTERSECT RESULT <intersect2,3> ALL NULL NULL NULL NULL NULL
@@ -12592,12 +13840,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a = 8"
}
@@ -12607,7 +13858,10 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "possible_keys": ["distinct_key"],
+ "loops": 9,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a = 8"
},
@@ -12623,6 +13877,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c < 300",
"filesort": {
"sort_key": "t1.b",
@@ -12632,7 +13887,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 8"
}
@@ -12646,6 +13903,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "INTERSECT",
+ "cost": "COST_REPLACED",
"having_condition": "c > 100",
"filesort": {
"sort_key": "t1.b",
@@ -12655,7 +13913,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 8 and t1.b > 10"
}
@@ -12685,7 +13945,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (t2.a=8);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY <derived2> ALL distinct_key NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
NULL INTERSECT RESULT <intersect2,3> ALL NULL NULL NULL NULL NULL
@@ -12694,12 +13954,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a = 8"
}
@@ -12709,7 +13972,10 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "possible_keys": ["distinct_key"],
+ "loops": 9,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a = 8"
},
@@ -12725,6 +13991,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c < 300",
"filesort": {
"sort_key": "t1.b",
@@ -12734,7 +14001,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 8"
}
@@ -12748,6 +14017,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "INTERSECT",
+ "cost": "COST_REPLACED",
"having_condition": "c > 100",
"filesort": {
"sort_key": "t1.b",
@@ -12757,7 +14027,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 8 and t1.b > 10"
}
@@ -12789,7 +14061,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (v1.c>200);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 2 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 1 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
NULL INTERSECT RESULT <intersect2,3> ALL NULL NULL NULL NULL NULL
@@ -12798,12 +14070,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null"
}
@@ -12812,12 +14087,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.c > 200",
"materialized": {
@@ -12829,6 +14106,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c < 300 and c > 200",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -12838,7 +14116,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9"
}
@@ -12852,6 +14132,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",
@@ -12861,7 +14142,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10"
}
@@ -12894,7 +14177,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (v1.a<5) and (v1.c>110);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 2 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 1 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
NULL INTERSECT RESULT <intersect2,3> ALL NULL NULL NULL NULL NULL
@@ -12903,12 +14186,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a < 5 and t2.a is not null"
}
@@ -12917,12 +14203,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.c > 110",
"materialized": {
@@ -12934,6 +14222,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c < 300 and c > 110",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -12943,7 +14232,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and t1.a < 5"
}
@@ -12957,6 +14248,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",
@@ -12966,7 +14258,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and t1.a < 5"
}
@@ -13000,7 +14294,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and ((v1.b>27) or (v1.b<19));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 2 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 1 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
NULL INTERSECT RESULT <intersect2,3> ALL NULL NULL NULL NULL NULL
@@ -13009,12 +14303,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null"
}
@@ -13023,12 +14320,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.b > 27 or v1.b < 19",
"materialized": {
@@ -13040,6 +14339,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c < 300",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -13049,7 +14349,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and (t1.b > 27 or t1.b < 19)"
}
@@ -13063,6 +14365,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "INTERSECT",
+ "cost": "COST_REPLACED",
"having_condition": "c > 100",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -13072,7 +14375,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and (t1.b > 27 or t1.b < 19)"
}
@@ -13111,7 +14416,7 @@ explain select * from v1,t2 where
(v1.a=t2.a) and ((v1.c>200) or (v1.c<105));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 2 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 1 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
NULL INTERSECT RESULT <intersect2,3> ALL NULL NULL NULL NULL NULL
@@ -13121,12 +14426,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null"
}
@@ -13135,12 +14443,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.c > 200 or v1.c < 105",
"materialized": {
@@ -13152,6 +14462,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",
@@ -13161,7 +14472,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9"
}
@@ -13175,6 +14488,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",
@@ -13184,7 +14498,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10"
}
@@ -13255,12 +14571,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -13269,7 +14588,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a > 3 or v1.a = 1 and v1.c < 110"
},
@@ -13286,6 +14607,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",
@@ -13295,7 +14617,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and (t1.a > 3 or t1.a = 1)"
}
@@ -13309,6 +14633,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",
@@ -13318,7 +14643,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and (t1.a > 3 or t1.a = 1)"
}
@@ -13399,7 +14726,7 @@ where
((d1.a<4) and (d1.c<200)));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.b 2 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.b 1 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
NULL INTERSECT RESULT <intersect2,3> ALL NULL NULL NULL NULL NULL
@@ -13418,12 +14745,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.b is not null"
}
@@ -13432,12 +14762,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["test.t2.b"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.c = 909 and t2.b > 13 or d1.a < 4 and d1.c < 200",
"materialized": {
@@ -13449,6 +14781,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",
@@ -13458,7 +14791,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and (t1.b > 13 or t1.a < 4)"
}
@@ -13472,6 +14807,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",
@@ -13481,7 +14817,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and (t1.b > 13 or t1.a < 4)"
}
@@ -13524,7 +14862,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (v1.a<5);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 2
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 1
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
NULL EXCEPT RESULT <except2,3> ALL NULL NULL NULL NULL NULL
@@ -13533,12 +14871,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a < 5 and t2.a is not null"
}
@@ -13547,12 +14888,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
@@ -13563,6 +14906,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 200",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -13572,7 +14916,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and t1.a < 5"
}
@@ -13586,6 +14932,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "EXCEPT",
+ "cost": "COST_REPLACED",
"having_condition": "c < 300",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -13595,7 +14942,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and t1.a < 5"
}
@@ -13628,7 +14977,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (v1.a=6);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY <derived2> ALL distinct_key NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
NULL EXCEPT RESULT <except2,3> ALL NULL NULL NULL NULL NULL
@@ -13637,12 +14986,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a = 6"
}
@@ -13652,7 +15004,10 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "possible_keys": ["distinct_key"],
+ "loops": 9,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a = 6"
},
@@ -13668,6 +15023,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 200",
"filesort": {
"sort_key": "t1.b",
@@ -13677,7 +15033,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 6"
}
@@ -13691,6 +15049,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "EXCEPT",
+ "cost": "COST_REPLACED",
"having_condition": "c < 300",
"filesort": {
"sort_key": "t1.b",
@@ -13700,7 +15059,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 6 and t1.b > 10"
}
@@ -13732,7 +15093,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (t2.a=6);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY <derived2> ALL distinct_key NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
NULL EXCEPT RESULT <except2,3> ALL NULL NULL NULL NULL NULL
@@ -13741,12 +15102,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a = 6"
}
@@ -13756,7 +15120,10 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "possible_keys": ["distinct_key"],
+ "loops": 9,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a = 6"
},
@@ -13772,6 +15139,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 200",
"filesort": {
"sort_key": "t1.b",
@@ -13781,7 +15149,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 6"
}
@@ -13795,6 +15165,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "EXCEPT",
+ "cost": "COST_REPLACED",
"having_condition": "c < 300",
"filesort": {
"sort_key": "t1.b",
@@ -13804,7 +15175,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 6 and t1.b > 10"
}
@@ -13840,7 +15213,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (v1.c>500);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 2 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 1 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
NULL EXCEPT RESULT <except2,3> ALL NULL NULL NULL NULL NULL
@@ -13849,12 +15222,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null"
}
@@ -13863,12 +15239,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.c > 500",
"materialized": {
@@ -13880,6 +15258,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 200 and c > 500",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -13889,7 +15268,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9"
}
@@ -13903,6 +15284,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",
@@ -13912,7 +15294,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10"
}
@@ -13945,7 +15329,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (v1.a<5) and (v1.c>500);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 2 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 1 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
NULL EXCEPT RESULT <except2,3> ALL NULL NULL NULL NULL NULL
@@ -13954,12 +15338,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a < 5 and t2.a is not null"
}
@@ -13968,12 +15355,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.c > 500",
"materialized": {
@@ -13985,6 +15374,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 200 and c > 500",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -13994,7 +15384,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and t1.a < 5"
}
@@ -14008,6 +15400,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",
@@ -14017,7 +15410,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and t1.a < 5"
}
@@ -14053,7 +15448,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and ((v1.b>27) or (v1.b<19));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 2 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 1 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
NULL EXCEPT RESULT <except2,3> ALL NULL NULL NULL NULL NULL
@@ -14062,12 +15457,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null"
}
@@ -14076,12 +15474,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.b > 27 or v1.b < 19",
"materialized": {
@@ -14093,6 +15493,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 200",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -14102,7 +15503,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and (t1.b > 27 or t1.b < 19)"
}
@@ -14116,6 +15519,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "EXCEPT",
+ "cost": "COST_REPLACED",
"having_condition": "c < 300",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -14125,7 +15529,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and (t1.b > 27 or t1.b < 19)"
}
@@ -14164,7 +15570,7 @@ explain select * from v1,t2 where
(v1.a=t2.a) and ((v1.c<400) or (v1.c>800));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 2 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 1 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
NULL EXCEPT RESULT <except2,3> ALL NULL NULL NULL NULL NULL
@@ -14174,12 +15580,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null"
}
@@ -14188,12 +15597,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.c < 400 or v1.c > 800",
"materialized": {
@@ -14205,6 +15616,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",
@@ -14214,7 +15626,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9"
}
@@ -14228,6 +15642,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",
@@ -14237,7 +15652,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10"
}
@@ -14306,12 +15723,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -14320,7 +15740,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a > 1 or v1.a = 1 and v1.c > 500"
},
@@ -14337,6 +15759,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",
@@ -14346,7 +15769,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and (t1.a > 1 or t1.a = 1)"
}
@@ -14360,6 +15785,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",
@@ -14369,7 +15795,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and (t1.a > 1 or t1.a = 1)"
}
@@ -14446,7 +15874,7 @@ where
((d1.a>4) and (d1.c>500)));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.b 2 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.b 1 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
NULL EXCEPT RESULT <except2,3> ALL NULL NULL NULL NULL NULL
@@ -14465,12 +15893,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.b is not null"
}
@@ -14479,12 +15910,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["test.t2.b"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.c = 988 and t2.b > 13 or d1.a > 4 and d1.c > 500",
"materialized": {
@@ -14496,6 +15929,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",
@@ -14505,7 +15939,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and (t1.b > 13 or t1.a > 4)"
}
@@ -14519,6 +15955,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",
@@ -14528,7 +15965,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and (t1.b > 13 or t1.a > 4)"
}
@@ -14570,7 +16009,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (v1.a>5) and (v1.c>200);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 3 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 3 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 UNION <derived4> ALL NULL NULL NULL NULL 18 Using where
4 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
@@ -14582,12 +16021,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a > 5 and t2.a is not null"
}
@@ -14596,12 +16038,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 9,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.c > 200",
"materialized": {
@@ -14613,6 +16057,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 200 and c > 200",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -14622,7 +16067,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and t1.a > 5"
}
@@ -14636,12 +16083,15 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived4>",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "__5.a > 5 and __5.c > 200",
"materialized": {
@@ -14653,6 +16103,7 @@ EXPLAIN
{
"query_block": {
"select_id": 4,
+ "cost": "COST_REPLACED",
"having_condition": "c < 300 and c > 200",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -14662,7 +16113,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and t1.a > 5"
}
@@ -14676,6 +16129,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",
@@ -14685,7 +16139,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 3 and t1.a > 5"
}
@@ -14738,7 +16194,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (v1.a>4) and (v1.c<200);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 3 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 3 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
4 UNION t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
@@ -14748,12 +16204,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a > 4 and t2.a is not null"
}
@@ -14762,12 +16221,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 9,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.c < 200",
"materialized": {
@@ -14779,6 +16240,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 200 and c < 200",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -14788,7 +16250,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and t1.a > 4"
}
@@ -14802,6 +16266,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",
@@ -14811,7 +16276,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 3 and t1.a > 4"
}
@@ -14825,6 +16292,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",
@@ -14834,7 +16302,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and t1.a > 4"
}
@@ -14876,7 +16346,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (v1.a>5) and (v1.c>200);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 3 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 3 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 UNION t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
4 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
@@ -14886,12 +16356,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a > 5 and t2.a is not null"
}
@@ -14900,12 +16373,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 9,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.c > 200",
"materialized": {
@@ -14917,6 +16392,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 200 and c > 200",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -14926,7 +16402,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and t1.a > 5"
}
@@ -14940,6 +16418,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",
@@ -14949,7 +16428,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and t1.a > 5"
}
@@ -14963,6 +16444,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",
@@ -14972,7 +16454,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 3 and t1.a > 5"
}
@@ -15016,7 +16500,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (v1.a>4) and (v1.c<200);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 3 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 3 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
4 UNION t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
@@ -15026,12 +16510,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a > 4 and t2.a is not null"
}
@@ -15040,12 +16527,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 9,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.c < 200",
"materialized": {
@@ -15057,6 +16546,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 200 and c < 200",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -15066,7 +16556,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and t1.a > 4"
}
@@ -15080,6 +16572,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",
@@ -15089,7 +16582,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 3 and t1.a > 4"
}
@@ -15103,6 +16598,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",
@@ -15112,7 +16608,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and t1.a > 4"
}
@@ -15154,7 +16652,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (v1.a>4) and (v1.c<150);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 2 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 1 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
4 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
@@ -15164,12 +16662,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a > 4 and t2.a is not null"
}
@@ -15178,12 +16679,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.c < 150",
"materialized": {
@@ -15195,6 +16698,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c < 300 and c < 150",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -15204,7 +16708,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and t1.a > 4"
}
@@ -15218,6 +16724,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",
@@ -15227,7 +16734,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 7 and t1.a > 4"
}
@@ -15241,6 +16750,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",
@@ -15250,7 +16760,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and t1.a > 4"
}
@@ -15290,7 +16802,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (v1.a>4) and (v1.c<130);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 2 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 1 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 EXCEPT <derived4> ALL NULL NULL NULL NULL 18 Using where
4 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
@@ -15302,12 +16814,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a > 4 and t2.a is not null"
}
@@ -15316,12 +16831,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.c < 130",
"materialized": {
@@ -15333,6 +16850,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c < 300 and c < 130",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -15342,7 +16860,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and t1.a > 4"
}
@@ -15356,12 +16876,15 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "EXCEPT",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived4>",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "__5.a > 4 and __5.c < 130",
"materialized": {
@@ -15373,6 +16896,7 @@ EXPLAIN
{
"query_block": {
"select_id": 4,
+ "cost": "COST_REPLACED",
"having_condition": "c > 150 and c < 130",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -15382,7 +16906,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and t1.a > 4"
}
@@ -15396,6 +16922,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",
@@ -15405,7 +16932,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 7 and t1.a > 4"
}
@@ -15457,7 +16986,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (v1.a>4) and (v1.c<130);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 3 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 3 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 EXCEPT <derived4> ALL NULL NULL NULL NULL 18 Using where
4 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
@@ -15470,12 +16999,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a > 4 and t2.a is not null"
}
@@ -15484,12 +17016,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 9,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.c < 130",
"materialized": {
@@ -15501,6 +17035,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c < 300 and c < 130",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -15510,7 +17045,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and t1.a > 4"
}
@@ -15524,12 +17061,15 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "EXCEPT",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived4>",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "__6.a > 4 and __6.c < 130",
"materialized": {
@@ -15541,6 +17081,7 @@ EXPLAIN
{
"query_block": {
"select_id": 4,
+ "cost": "COST_REPLACED",
"having_condition": "c > 150 and c < 130",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -15550,7 +17091,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and t1.a > 4"
}
@@ -15564,6 +17107,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",
@@ -15573,7 +17117,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 7 and t1.a > 4"
}
@@ -15596,6 +17142,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",
@@ -15605,7 +17152,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 7 and t1.a > 4"
}
@@ -15648,7 +17197,7 @@ a b c a b c
explain select * from v2,t2 where (v2.a=t2.a) and (v2.a>4) and (v2.c<150);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 2 Using where
+1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 1 Using where
2 DERIVED <derived3> ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
4 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
@@ -15658,12 +17207,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a > 4 and t2.a is not null"
}
@@ -15677,12 +17229,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "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",
@@ -15692,7 +17247,9 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a < 7 and v1.a > 4",
"materialized": {
@@ -15704,6 +17261,7 @@ EXPLAIN
{
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "c < 300",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -15713,7 +17271,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and t1.a < 7 and t1.a > 4"
}
@@ -15727,6 +17287,7 @@ EXPLAIN
"query_block": {
"select_id": 4,
"operation": "INTERSECT",
+ "cost": "COST_REPLACED",
"having_condition": "c > 120",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -15736,7 +17297,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and t1.a < 7 and t1.a > 4"
}
@@ -15786,7 +17349,7 @@ a b c a b c
explain select * from v2,t2 where (v2.a=t2.a) and (v2.a>4) and (v2.c<150);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 2 Using where
+1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 1 Using where
2 DERIVED <derived3> ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
4 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
@@ -15796,12 +17359,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a > 4 and t2.a is not null"
}
@@ -15815,12 +17381,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "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",
@@ -15830,7 +17399,9 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a < 7 and v1.a > 4",
"materialized": {
@@ -15842,6 +17413,7 @@ EXPLAIN
{
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "c < 300",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -15851,7 +17423,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and t1.a < 7 and t1.a > 4"
}
@@ -15865,6 +17439,7 @@ EXPLAIN
"query_block": {
"select_id": 4,
"operation": "EXCEPT",
+ "cost": "COST_REPLACED",
"having_condition": "c > 150",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -15874,7 +17449,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and t1.a < 7 and t1.a > 4"
}
@@ -15921,7 +17498,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (v1.a>4) and (v1.b>12) and (v1.c<450);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 2 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 1 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
NULL INTERSECT RESULT <intersect2,3> ALL NULL NULL NULL NULL NULL
@@ -15930,12 +17507,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a > 4 and t2.a is not null"
}
@@ -15944,12 +17524,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.b > 12 and v1.c < 450",
"materialized": {
@@ -15961,6 +17543,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",
@@ -15970,7 +17553,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and t1.a > 4"
}
@@ -15984,6 +17569,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",
@@ -15993,7 +17579,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b < 21 and t1.b > 12"
}
@@ -16033,7 +17621,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (v1.a<2) and (v1.b<30) and (v1.c>450);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 2 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 1 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
NULL EXCEPT RESULT <except2,3> ALL NULL NULL NULL NULL NULL
@@ -16042,12 +17630,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a < 2 and t2.a is not null"
}
@@ -16056,12 +17647,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.b < 30 and v1.c > 450",
"materialized": {
@@ -16073,6 +17666,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",
@@ -16082,7 +17676,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 20 and t1.a < 2"
}
@@ -16096,6 +17692,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",
@@ -16105,7 +17702,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 7 and t1.b < 30"
}
@@ -16147,7 +17746,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and ((v1.a<2) or (v1.a<5)) and (v1.c>450);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 2 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 1 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
NULL EXCEPT RESULT <except2,3> ALL NULL NULL NULL NULL NULL
@@ -16156,12 +17755,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t2.a < 2 or t2.a < 5) and t2.a is not null"
}
@@ -16170,12 +17772,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.c > 450",
"materialized": {
@@ -16187,6 +17791,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 300 and c > 450",
"filesort": {
"sort_key": "t1.a",
@@ -16196,7 +17801,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 20 and (t1.a < 2 or t1.a < 5)"
}
@@ -16210,6 +17817,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",
@@ -16219,7 +17827,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 7"
}
@@ -16262,7 +17872,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (v1.a>1) and (v1.b > 12) and (v1.c>400);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 3 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 3 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
4 UNION t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
@@ -16272,12 +17882,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a > 1 and t2.a is not null"
}
@@ -16286,12 +17899,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 9,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.b > 12 and v1.c > 400",
"materialized": {
@@ -16303,6 +17918,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",
@@ -16312,7 +17928,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and t1.a > 1"
}
@@ -16326,6 +17944,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",
@@ -16335,7 +17954,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 3 and t1.b > 12"
}
@@ -16349,6 +17970,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",
@@ -16358,7 +17980,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and t1.a > 1 and t1.b > 12"
}
@@ -16409,19 +18033,22 @@ a b max_c a b c
explain select * from v1,t2 where (v1.b=t2.b) and (v1.a<5);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.b 2 Using where
+1 PRIMARY <derived2> ref key0 key0 5 test.t2.b 1 Using where
2 DERIVED t3 range i1 i1 5 NULL 5 Using index condition
explain format=json select * from v1,t2 where (v1.b=t2.b) and (v1.a<5);
EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.b is not null"
}
@@ -16435,12 +18062,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["test.t2.b"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a < 5",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -16450,7 +18080,9 @@ EXPLAIN
"key": "i1",
"key_length": "5",
"used_key_parts": ["a"],
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t3.a > 0 and t3.a < 5"
}
@@ -16486,7 +18118,7 @@ a b c a b c
explain select * from v1,t2 where (v1.b=t2.b) and (v1.a<4);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.b 2 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.b 1 Using where
2 DERIVED t3 range i1 i1 5 NULL 2 Using index condition
3 UNION t3 range i1 i1 5 NULL 1 Using index condition
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
@@ -16495,12 +18127,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.b is not null"
}
@@ -16509,12 +18144,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["test.t2.b"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a < 4",
"materialized": {
@@ -16526,6 +18163,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -16535,7 +18173,9 @@ EXPLAIN
"key": "i1",
"key_length": "5",
"used_key_parts": ["a"],
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t3.a > 1 and t3.a < 4"
}
@@ -16547,6 +18187,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -16556,7 +18197,9 @@ EXPLAIN
"key": "i1",
"key_length": "5",
"used_key_parts": ["a"],
+ "loops": 1,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t3.a > 2 and t3.a < 4"
}
@@ -16596,7 +18239,7 @@ a b c a b c
explain select * from v1,t2 where (v1.b=t2.b) and (v1.a<3);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.b 2 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.b 2 Using where
2 DERIVED t3 range i1 i1 5 NULL 1 Using index condition
3 UNION t3 ALL NULL NULL NULL NULL 20 Using where; Using temporary; Using filesort
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
@@ -16605,12 +18248,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.b is not null"
}
@@ -16619,12 +18265,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["test.t2.b"],
+ "loops": 9,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a < 3",
"materialized": {
@@ -16636,6 +18284,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -16645,7 +18294,9 @@ EXPLAIN
"key": "i1",
"key_length": "5",
"used_key_parts": ["a"],
+ "loops": 1,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t3.a > 1 and t3.a < 3"
}
@@ -16657,6 +18308,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"having_condition": "t3.a < 3",
"filesort": {
"sort_key": "t3.b",
@@ -16666,7 +18318,9 @@ EXPLAIN
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t3.b < 21"
}
@@ -16738,17 +18392,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"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": [
{
@@ -16764,7 +18422,9 @@ EXPLAIN
"table_name": "t2",
"access_type": "ALL",
"possible_keys": ["idx"],
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 80,
"attached_condition": "t2.a > 2 and t2.c in ('aa','bb','cc')"
}
@@ -16853,12 +18513,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 32,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t.a > 2 and t.c in ('aa','bb','cc')",
"materialized": {
@@ -16868,6 +18531,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"window_functions_computation": {
"sorts": [
{
@@ -16883,7 +18547,9 @@ EXPLAIN
"table_name": "t2",
"access_type": "ALL",
"possible_keys": ["idx"],
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 80,
"attached_condition": "t2.a > 2 and t2.c in ('aa','bb','cc')"
}
@@ -16897,6 +18563,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"window_functions_computation": {
"sorts": [
{
@@ -16912,7 +18579,9 @@ EXPLAIN
"table_name": "t2",
"access_type": "ALL",
"possible_keys": ["idx"],
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 80,
"attached_condition": "t2.a > 2"
}
@@ -16961,12 +18630,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"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"
}
@@ -16980,11 +18652,14 @@ EXPLAIN
"key_length": "24",
"used_key_parts": ["a", "c"],
"ref": ["test.t1.a", "test.t1.c"],
+ "loops": 8,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"window_functions_computation": {
"sorts": [
{
@@ -16999,7 +18674,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.c in ('aa','bb','cc')"
}
@@ -17101,12 +18778,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 48,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t.a > 2 and t.c in ('aa','bb','cc')",
"materialized": {
@@ -17116,6 +18796,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"window_functions_computation": {
"sorts": [
{
@@ -17131,7 +18812,9 @@ EXPLAIN
"table_name": "t2",
"access_type": "ALL",
"possible_keys": ["idx"],
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 80,
"attached_condition": "t2.a > 2 and t2.c in ('aa','bb','cc')"
}
@@ -17145,6 +18828,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"window_functions_computation": {
"sorts": [
{
@@ -17160,7 +18844,9 @@ EXPLAIN
"table_name": "t2",
"access_type": "ALL",
"possible_keys": ["idx"],
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 80,
"attached_condition": "t2.a > 2"
}
@@ -17174,6 +18860,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",
@@ -17184,7 +18871,9 @@ EXPLAIN
"table_name": "t2",
"access_type": "ALL",
"possible_keys": ["idx"],
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 80,
"attached_condition": "t2.a > 2"
}
@@ -17250,17 +18939,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"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": [
{
@@ -17276,7 +18969,9 @@ EXPLAIN
"table_name": "t2",
"access_type": "ALL",
"possible_keys": ["idx"],
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 80,
"attached_condition": "t2.a > 2 and t2.c in ('aa','bb','cc')"
}
@@ -17338,17 +19033,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"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": [
{
@@ -17364,7 +19063,9 @@ EXPLAIN
"table_name": "t2",
"access_type": "ALL",
"possible_keys": ["idx"],
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 80,
"attached_condition": "t2.a > 2"
}
@@ -17426,17 +19127,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"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": [
{
@@ -17456,7 +19161,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.c in ('aa','bb','cc')"
}
@@ -17528,7 +19235,7 @@ on t1.a=t.a
where t1.b < 3;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 range idx_b idx_b 5 NULL 4 100.00 Using index condition; Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t1.a 2 100.00
+1 PRIMARY <derived2> ref key0 key0 5 test.t1.a 1 100.00
2 LATERAL DERIVED t2 ref idx_a idx_a 5 test.t1.a 1 100.00
Warnings:
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`t`.`s` AS `s`,`t`.`m` AS `m` from `test`.`t1` join (/* select#2 */ select `test`.`t2`.`a` AS `a`,sum(`test`.`t2`.`b`) AS `s`,min(`test`.`t2`.`c`) AS `m` from `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`a` group by `test`.`t2`.`a`) `t` where `t`.`a` = `test`.`t1`.`a` and `test`.`t1`.`b` < 3
@@ -17541,6 +19248,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -17550,7 +19258,9 @@ EXPLAIN
"key": "idx_b",
"key_length": "5",
"used_key_parts": ["b"],
+ "loops": 1,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t1.b < 3",
"attached_condition": "t1.a is not null"
@@ -17565,12 +19275,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t1.a"],
- "rows": 2,
+ "loops": 4,
+ "rows": 1,
+ "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": [
{
@@ -17582,7 +19295,9 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t1.a"],
+ "loops": 1,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -17649,7 +19364,7 @@ on t1.a=t.a
where t1.b <= 5;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL idx_b NULL NULL NULL 12 83.33 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t1.a 2 100.00
+1 PRIMARY <derived2> ref key0 key0 5 test.t1.a 1 100.00
2 LATERAL DERIVED t2 ref idx_a idx_a 5 test.t1.a 1 100.00
Warnings:
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`t`.`s` AS `s`,`t`.`m` AS `m` from `test`.`t1` join (/* select#2 */ select `test`.`t2`.`a` AS `a`,sum(`test`.`t2`.`b`) AS `s`,min(`test`.`t2`.`b`) AS `m` from `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`a` group by `test`.`t2`.`a`) `t` where `t`.`a` = `test`.`t1`.`a` and `test`.`t1`.`b` <= 5
@@ -17662,13 +19377,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"possible_keys": ["idx_b"],
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 83.33333588,
"attached_condition": "t1.b <= 5 and t1.a is not null"
}
@@ -17682,12 +19400,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t1.a"],
- "rows": 2,
+ "loops": 10,
+ "rows": 1,
+ "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": [
{
@@ -17699,7 +19420,9 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t1.a"],
+ "loops": 1,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -17764,10 +19487,10 @@ from t1 left join
on t1.a=t.a;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 12 100.00
-1 PRIMARY <derived2> ref key0 key0 5 test.t1.a 9 100.00 Using where
-2 DERIVED t2 ALL idx_a NULL NULL NULL 90 100.00 Using temporary; Using filesort
+1 PRIMARY <derived2> ref key0 key0 5 test.t1.a 1 100.00 Using where
+2 LATERAL DERIVED t2 ref idx_a idx_a 5 test.t1.a 1 100.00
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`t`.`max` AS `max`,`t`.`min` AS `min` from `test`.`t1` left join (/* select#2 */ select `test`.`t2`.`a` AS `a`,max(`test`.`t2`.`b`) AS `max`,min(`test`.`t2`.`b`) AS `min` from `test`.`t2` group by `test`.`t2`.`a`) `t` on(`t`.`a` = `test`.`t1`.`a` and `test`.`t1`.`a` is not null) where 1
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`t`.`max` AS `max`,`t`.`min` AS `min` from `test`.`t1` left join (/* select#2 */ select `test`.`t2`.`a` AS `a`,max(`test`.`t2`.`b`) AS `max`,min(`test`.`t2`.`b`) AS `min` from `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`a` group by `test`.`t2`.`a`) `t` on(`t`.`a` = `test`.`t1`.`a` and `test`.`t1`.`a` is not null) where 1
explain format=json select t1.a,t.max,t.min
from t1 left join
(select a, max(t2.b) max, min(t2.b) min from t2 group by t2.a) t
@@ -17776,13 +19499,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"const_condition": "1",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -17795,28 +19521,34 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t1.a"],
- "rows": 9,
+ "loops": 12,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "trigcond(trigcond(t1.a is not null))",
"materialized": {
+ "lateral": 1,
"query_block": {
"select_id": 2,
- "filesort": {
- "sort_key": "t2.a",
- "temporary_table": {
- "nested_loop": [
- {
- "table": {
- "table_name": "t2",
- "access_type": "ALL",
- "possible_keys": ["idx_a"],
- "rows": 90,
- "filtered": 100
- }
- }
- ]
+ "cost": "COST_REPLACED",
+ "outer_ref_condition": "t1.a is not null",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "ref",
+ "possible_keys": ["idx_a"],
+ "key": "idx_a",
+ "key_length": "5",
+ "used_key_parts": ["a"],
+ "ref": ["test.t1.a"],
+ "loops": 1,
+ "rows": 1,
+ "cost": "COST_REPLACED",
+ "filtered": 100
+ }
}
- }
+ ]
}
}
}
@@ -17865,7 +19597,7 @@ on t3.a=t.a and t3.c=t.c
where t3.b > 15;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3 range idx_b idx_b 5 NULL 2 100.00 Using index condition; Using where
-1 PRIMARY <derived2> ref key0 key0 133 test.t3.a,test.t3.c 2 100.00
+1 PRIMARY <derived2> ref key0 key0 133 test.t3.a,test.t3.c 1 100.00
2 LATERAL DERIVED t4 ref idx idx 133 test.t3.a,test.t3.c 1 100.00
Warnings:
Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a`,`test`.`t3`.`c` AS `c`,`t`.`max` AS `max`,`t`.`min` AS `min` from `test`.`t3` join (/* select#2 */ select `test`.`t4`.`a` AS `a`,`test`.`t4`.`c` AS `c`,max(`test`.`t4`.`b`) AS `max`,min(`test`.`t4`.`b`) AS `min` from `test`.`t4` where `test`.`t4`.`a` = `test`.`t3`.`a` and `test`.`t4`.`c` = `test`.`t3`.`c` group by `test`.`t4`.`a`,`test`.`t4`.`c`) `t` where `t`.`a` = `test`.`t3`.`a` and `t`.`c` = `test`.`t3`.`c` and `test`.`t3`.`b` > 15
@@ -17878,6 +19610,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -17887,7 +19620,9 @@ EXPLAIN
"key": "idx_b",
"key_length": "5",
"used_key_parts": ["b"],
+ "loops": 1,
"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,12 +19637,15 @@ EXPLAIN
"key_length": "133",
"used_key_parts": ["a", "c"],
"ref": ["test.t3.a", "test.t3.c"],
- "rows": 2,
+ "loops": 2,
+ "rows": 1,
+ "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,7 +19657,9 @@ EXPLAIN
"key_length": "133",
"used_key_parts": ["a", "c"],
"ref": ["test.t3.a", "test.t3.c"],
+ "loops": 1,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -17954,10 +19694,10 @@ on t3.a=t.a and t3.c=t.c
where t3.b <= 15;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3 ALL idx_b NULL NULL NULL 12 83.33 Using where
-1 PRIMARY <derived2> ref key0 key0 133 test.t3.a,test.t3.c 4 100.00
-2 DERIVED t4 ALL idx NULL NULL NULL 40 100.00 Using temporary; Using filesort
+1 PRIMARY <derived2> ref key0 key0 133 test.t3.a,test.t3.c 1 100.00
+2 LATERAL DERIVED t4 ref idx idx 133 test.t3.a,test.t3.c 1 100.00
Warnings:
-Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a`,`test`.`t3`.`c` AS `c`,`t`.`max` AS `max`,`t`.`min` AS `min` from `test`.`t3` join (/* select#2 */ select `test`.`t4`.`a` AS `a`,`test`.`t4`.`c` AS `c`,max(`test`.`t4`.`b`) AS `max`,min(`test`.`t4`.`b`) AS `min` from `test`.`t4` group by `test`.`t4`.`a`,`test`.`t4`.`c`) `t` where `t`.`a` = `test`.`t3`.`a` and `t`.`c` = `test`.`t3`.`c` and `test`.`t3`.`b` <= 15
+Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a`,`test`.`t3`.`c` AS `c`,`t`.`max` AS `max`,`t`.`min` AS `min` from `test`.`t3` join (/* select#2 */ select `test`.`t4`.`a` AS `a`,`test`.`t4`.`c` AS `c`,max(`test`.`t4`.`b`) AS `max`,min(`test`.`t4`.`b`) AS `min` from `test`.`t4` where `test`.`t4`.`a` = `test`.`t3`.`a` and `test`.`t4`.`c` = `test`.`t3`.`c` group by `test`.`t4`.`a`,`test`.`t4`.`c`) `t` where `t`.`a` = `test`.`t3`.`a` and `t`.`c` = `test`.`t3`.`c` and `test`.`t3`.`b` <= 15
explain format=json select t3.a,t3.c,t.max,t.min
from t3 join
(select a, c, max(b) max, min(b) min from t4 group by a,c) t
@@ -17967,13 +19707,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
"possible_keys": ["idx_b"],
+ "loops": 1,
"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,27 +19730,33 @@ EXPLAIN
"key_length": "133",
"used_key_parts": ["a", "c"],
"ref": ["test.t3.a", "test.t3.c"],
- "rows": 4,
+ "loops": 10,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
+ "lateral": 1,
"query_block": {
"select_id": 2,
- "filesort": {
- "sort_key": "t4.a, t4.c",
- "temporary_table": {
- "nested_loop": [
- {
- "table": {
- "table_name": "t4",
- "access_type": "ALL",
- "possible_keys": ["idx"],
- "rows": 40,
- "filtered": 100
- }
- }
- ]
+ "cost": "COST_REPLACED",
+ "outer_ref_condition": "t3.a is not null and t3.c is not null",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t4",
+ "access_type": "ref",
+ "possible_keys": ["idx"],
+ "key": "idx",
+ "key_length": "133",
+ "used_key_parts": ["a", "c"],
+ "ref": ["test.t3.a", "test.t3.c"],
+ "loops": 1,
+ "rows": 1,
+ "cost": "COST_REPLACED",
+ "filtered": 100
+ }
}
- }
+ ]
}
}
}
@@ -18038,7 +19787,7 @@ on t3.a=t.a and t3.c=t.c
where t3.b > 15;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3 range idx_b idx_b 5 NULL 2 100.00 Using index condition; Using where
-1 PRIMARY <derived2> ref key0 key0 133 test.t3.a,test.t3.c 2 100.00
+1 PRIMARY <derived2> ref key0 key0 133 test.t3.a,test.t3.c 1 100.00
2 LATERAL DERIVED t4 ref idx idx 133 test.t3.a,test.t3.c 1 100.00
Warnings:
Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a`,`test`.`t3`.`c` AS `c`,`t`.`max` AS `max`,`t`.`min` AS `min` from `test`.`t3` join (/* select#2 */ select `test`.`t4`.`a` AS `a`,`test`.`t4`.`c` AS `c`,max(`test`.`t4`.`b`) AS `max`,min(`test`.`t4`.`b`) AS `min` from `test`.`t4` where `test`.`t4`.`a` = `test`.`t3`.`a` and `test`.`t4`.`c` = `test`.`t3`.`c` group by `test`.`t4`.`c`,`test`.`t4`.`a`) `t` where `t`.`a` = `test`.`t3`.`a` and `t`.`c` = `test`.`t3`.`c` and `test`.`t3`.`b` > 15
@@ -18051,6 +19800,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -18060,7 +19810,9 @@ EXPLAIN
"key": "idx_b",
"key_length": "5",
"used_key_parts": ["b"],
+ "loops": 1,
"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"
@@ -18075,12 +19827,15 @@ EXPLAIN
"key_length": "133",
"used_key_parts": ["a", "c"],
"ref": ["test.t3.a", "test.t3.c"],
- "rows": 2,
+ "loops": 2,
+ "rows": 1,
+ "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": [
{
@@ -18092,7 +19847,9 @@ EXPLAIN
"key_length": "133",
"used_key_parts": ["a", "c"],
"ref": ["test.t3.a", "test.t3.c"],
+ "loops": 1,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -18127,10 +19884,10 @@ on t3.a=t.a and t3.c=t.c
where t3.b <= 15;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3 ALL idx_b NULL NULL NULL 12 83.33 Using where
-1 PRIMARY <derived2> ref key0 key0 133 test.t3.a,test.t3.c 4 100.00
-2 DERIVED t4 ALL idx NULL NULL NULL 40 100.00 Using temporary; Using filesort
+1 PRIMARY <derived2> ref key0 key0 133 test.t3.a,test.t3.c 1 100.00
+2 LATERAL DERIVED t4 ref idx idx 133 test.t3.a,test.t3.c 1 100.00
Warnings:
-Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a`,`test`.`t3`.`c` AS `c`,`t`.`max` AS `max`,`t`.`min` AS `min` from `test`.`t3` join (/* select#2 */ select `test`.`t4`.`a` AS `a`,`test`.`t4`.`c` AS `c`,max(`test`.`t4`.`b`) AS `max`,min(`test`.`t4`.`b`) AS `min` from `test`.`t4` group by `test`.`t4`.`c`,`test`.`t4`.`a`) `t` where `t`.`a` = `test`.`t3`.`a` and `t`.`c` = `test`.`t3`.`c` and `test`.`t3`.`b` <= 15
+Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a`,`test`.`t3`.`c` AS `c`,`t`.`max` AS `max`,`t`.`min` AS `min` from `test`.`t3` join (/* select#2 */ select `test`.`t4`.`a` AS `a`,`test`.`t4`.`c` AS `c`,max(`test`.`t4`.`b`) AS `max`,min(`test`.`t4`.`b`) AS `min` from `test`.`t4` where `test`.`t4`.`a` = `test`.`t3`.`a` and `test`.`t4`.`c` = `test`.`t3`.`c` group by `test`.`t4`.`c`,`test`.`t4`.`a`) `t` where `t`.`a` = `test`.`t3`.`a` and `t`.`c` = `test`.`t3`.`c` and `test`.`t3`.`b` <= 15
explain format=json select t3.a,t3.c,t.max,t.min
from t3 join
(select a, c, max(b) max, min(b) min from t4 group by c,a) t
@@ -18140,13 +19897,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
"possible_keys": ["idx_b"],
+ "loops": 1,
"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"
}
@@ -18160,27 +19920,33 @@ EXPLAIN
"key_length": "133",
"used_key_parts": ["a", "c"],
"ref": ["test.t3.a", "test.t3.c"],
- "rows": 4,
+ "loops": 10,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
+ "lateral": 1,
"query_block": {
"select_id": 2,
- "filesort": {
- "sort_key": "t4.c, t4.a",
- "temporary_table": {
- "nested_loop": [
- {
- "table": {
- "table_name": "t4",
- "access_type": "ALL",
- "possible_keys": ["idx"],
- "rows": 40,
- "filtered": 100
- }
- }
- ]
+ "cost": "COST_REPLACED",
+ "outer_ref_condition": "t3.a is not null and t3.c is not null",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t4",
+ "access_type": "ref",
+ "possible_keys": ["idx"],
+ "key": "idx",
+ "key_length": "133",
+ "used_key_parts": ["a", "c"],
+ "ref": ["test.t3.a", "test.t3.c"],
+ "loops": 1,
+ "rows": 1,
+ "cost": "COST_REPLACED",
+ "filtered": 100
+ }
}
- }
+ ]
}
}
}
@@ -18224,7 +19990,7 @@ where t2.b between 80 and 85 and t2.c in ('y','z') and t2.a=t3.a and t3.c=t.c;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 range idx idx 133 NULL 2 100.00 Using index condition; Using where
1 PRIMARY t3 ref idx_a idx_a 5 test.t2.a 1 100.00 Using where
-1 PRIMARY <derived2> ref key0 key0 128 test.t3.c 2 100.00
+1 PRIMARY <derived2> ref key0 key0 128 test.t3.c 1 100.00
2 LATERAL DERIVED t4 ref idx_c idx_c 128 test.t3.c 2 100.00
Warnings:
Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`t`.`c` AS `t_c`,`t`.`max` AS `max`,`t`.`min` AS `min` from `test`.`t2` join `test`.`t3` join (/* select#2 */ select `test`.`t4`.`c` AS `c`,max(`test`.`t4`.`b`) AS `max`,min(`test`.`t4`.`b`) AS `min` from `test`.`t4` where `test`.`t4`.`c` = `test`.`t3`.`c` group by `test`.`t4`.`c`) `t` where `test`.`t3`.`a` = `test`.`t2`.`a` and `t`.`c` = `test`.`t3`.`c` and `test`.`t2`.`b` between 80 and 85 and `test`.`t2`.`c` in ('y','z')
@@ -18235,6 +20001,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -18244,7 +20011,9 @@ EXPLAIN
"key": "idx",
"key_length": "133",
"used_key_parts": ["c", "b"],
+ "loops": 1,
"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"
@@ -18259,7 +20028,9 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 2,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t3.c is not null"
}
@@ -18273,12 +20044,15 @@ EXPLAIN
"key_length": "128",
"used_key_parts": ["c"],
"ref": ["test.t3.c"],
- "rows": 2,
+ "loops": 3,
+ "rows": 1,
+ "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": [
{
@@ -18290,7 +20064,9 @@ EXPLAIN
"key_length": "128",
"used_key_parts": ["c"],
"ref": ["test.t3.c"],
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -18395,12 +20171,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 90,
+ "cost": "COST_REPLACED",
"filtered": 60,
"attached_condition": "t2.b < 40 and t2.a is not null"
}
@@ -18414,7 +20193,9 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 53.99999991,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t3.c is not null"
}
@@ -18428,11 +20209,14 @@ EXPLAIN
"key_length": "128",
"used_key_parts": ["c"],
"ref": ["test.t3.c"],
+ "loops": 80.99999987,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t4.c",
"temporary_table": {
@@ -18442,7 +20226,9 @@ EXPLAIN
"table_name": "t4",
"access_type": "ALL",
"possible_keys": ["idx_c"],
+ "loops": 1,
"rows": 160,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -18496,7 +20282,7 @@ where t2.b between 80 and 85 and t2.c in ('y','z') and t2.a=t3.a and t3.c=t.c;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 range idx idx 133 NULL 2 100.00 Using index condition; Using where
1 PRIMARY t3 ref idx_a idx_a 5 test.t2.a 1 100.00 Using where
-1 PRIMARY <derived2> ref key0 key0 128 test.t3.c 2 100.00
+1 PRIMARY <derived2> ref key0 key0 128 test.t3.c 1 100.00
2 LATERAL DERIVED t4 ref idx_c idx_c 128 test.t3.c 2 100.00 Using temporary
Warnings:
Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`t`.`c` AS `c`,`t`.`b` AS `b`,`t`.`sum(b) over (partition by c)` AS `sum(b) over (partition by c)` from `test`.`t2` join `test`.`t3` join (/* select#2 */ select `test`.`t4`.`c` AS `c`,`test`.`t4`.`b` AS `b`,sum(`test`.`t4`.`b`) over ( partition by `test`.`t4`.`c`) AS `sum(b) over (partition by c)` from `test`.`t4` where `test`.`t4`.`c` = `test`.`t3`.`c`) `t` where `test`.`t3`.`a` = `test`.`t2`.`a` and `t`.`c` = `test`.`t3`.`c` and `test`.`t2`.`b` between 80 and 85 and `test`.`t2`.`c` in ('y','z')
@@ -18507,6 +20293,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -18516,7 +20303,9 @@ EXPLAIN
"key": "idx",
"key_length": "133",
"used_key_parts": ["c", "b"],
+ "loops": 1,
"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"
@@ -18531,7 +20320,9 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 2,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t3.c is not null"
}
@@ -18545,12 +20336,15 @@ EXPLAIN
"key_length": "128",
"used_key_parts": ["c"],
"ref": ["test.t3.c"],
- "rows": 2,
+ "loops": 3,
+ "rows": 1,
+ "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": [
@@ -18571,7 +20365,9 @@ EXPLAIN
"key_length": "128",
"used_key_parts": ["c"],
"ref": ["test.t3.c"],
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -18918,12 +20714,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 90,
+ "cost": "COST_REPLACED",
"filtered": 60,
"attached_condition": "t2.b < 40 and t2.a is not null"
}
@@ -18937,7 +20736,9 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 53.99999991,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t3.c is not null"
}
@@ -18951,11 +20752,14 @@ EXPLAIN
"key_length": "128",
"used_key_parts": ["c"],
"ref": ["test.t3.c"],
+ "loops": 80.99999987,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"window_functions_computation": {
"sorts": [
{
@@ -18971,7 +20775,9 @@ EXPLAIN
"table_name": "t4",
"access_type": "ALL",
"possible_keys": ["idx_c"],
+ "loops": 1,
"rows": 160,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -19023,7 +20829,7 @@ a c
explain extended SELECT * FROM t4 WHERE c IN ( SELECT c FROM v1 ) and a < 2;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t4 range a a 5 NULL 1 100.00 Using index condition; Using where
-1 PRIMARY <derived3> ref key0 key0 128 test.t4.c 2 100.00 FirstMatch(t4)
+1 PRIMARY <derived3> ref key0 key0 128 test.t4.c 1 100.00 FirstMatch(t4)
3 LATERAL DERIVED t3 ref c c 128 test.t4.c 2 100.00
3 LATERAL DERIVED <subquery4> eq_ref distinct_key distinct_key 4 func 1 100.00
4 MATERIALIZED t1 ALL NULL NULL NULL NULL 3 100.00
@@ -19035,6 +20841,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -19044,7 +20851,9 @@ EXPLAIN
"key": "a",
"key_length": "5",
"used_key_parts": ["a"],
+ "loops": 1,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t4.a < 2",
"attached_condition": "t4.c is not null"
@@ -19059,13 +20868,16 @@ EXPLAIN
"key_length": "128",
"used_key_parts": ["c"],
"ref": ["test.t4.c"],
- "rows": 2,
+ "loops": 1,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"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": [
@@ -19078,7 +20890,9 @@ EXPLAIN
"key_length": "128",
"used_key_parts": ["c"],
"ref": ["test.t4.c"],
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -19102,7 +20916,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -19111,7 +20927,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 3,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -19187,7 +21005,7 @@ DROP TABLE t1;
CREATE TABLE t1 (pk1 INT PRIMARY KEY, f INT) ENGINE=Aria;
INSERT INTO t1 VALUES (1,0),(2,0);
CREATE TABLE t2 (pk2 INT PRIMARY KEY) ENGINE=Aria;
-INSERT INTO t2 VALUES (1),(2),(3);
+INSERT INTO t2 VALUES (1),(2),(3),(11),(12),(13);
CREATE VIEW v2 AS SELECT pk2, COUNT(*) AS cnt FROM t2 GROUP BY pk2;
SELECT * FROM t1 INNER JOIN v2 ON pk1 = pk2 WHERE f <> 5;
pk1 f pk2 cnt
@@ -19196,7 +21014,7 @@ pk1 f pk2 cnt
EXPLAIN EXTENDED SELECT * FROM t1 INNER JOIN v2 ON pk1 = pk2 WHERE f <> 5;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 2 100.00 Using where
-1 PRIMARY <derived2> ref key0 key0 4 test.t1.pk1 2 100.00
+1 PRIMARY <derived2> ref key0 key0 4 test.t1.pk1 1 100.00
2 LATERAL DERIVED t2 eq_ref PRIMARY PRIMARY 4 test.t1.pk1 1 100.00 Using index
Warnings:
Note 1003 /* select#1 */ select `test`.`t1`.`pk1` AS `pk1`,`test`.`t1`.`f` AS `f`,`v2`.`pk2` AS `pk2`,`v2`.`cnt` AS `cnt` from `test`.`t1` join `test`.`v2` where `v2`.`pk2` = `test`.`t1`.`pk1` and `test`.`t1`.`f` <> 5
@@ -19205,13 +21023,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"possible_keys": ["PRIMARY"],
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.f <> 5"
}
@@ -19225,12 +21046,15 @@ EXPLAIN
"key_length": "4",
"used_key_parts": ["pk2"],
"ref": ["test.t1.pk1"],
- "rows": 2,
+ "loops": 2,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"lateral": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -19241,7 +21065,9 @@ EXPLAIN
"key_length": "4",
"used_key_parts": ["pk2"],
"ref": ["test.t1.pk1"],
+ "loops": 1,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"using_index": true
}
@@ -19414,7 +21240,7 @@ GROUP BY t1.b,t2.c) dt
WHERE t3.d = dt.b;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t3.d 2 100.00
+1 PRIMARY <derived2> ref key0 key0 5 test.t3.d 1 100.00
2 LATERAL DERIVED t1 ref idx_b idx_b 5 test.t3.d 1 100.00 Using index; Using temporary; Using filesort
2 LATERAL DERIVED t2 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (flat, BNL join)
Warnings:
@@ -19449,7 +21275,7 @@ left join
on u.id=auditlastlogin.userid;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY u ALL NULL NULL NULL NULL 2
-1 PRIMARY <derived2> ref key0 key0 5 test.u.id 2
+1 PRIMARY <derived2> ref key0 key0 5 test.u.id 1
2 DERIVED au ALL NULL NULL NULL NULL 4 Using temporary; Using filesort
select * from t1 as u
left join
@@ -19504,9 +21330,9 @@ id a
explain extended select id, a from t1 where id in (select id from v1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 20 100.00
-1 PRIMARY <derived3> ref key0 key0 4 test.t1.id 2 100.00 FirstMatch(t1)
-3 LATERAL DERIVED t1 eq_ref PRIMARY PRIMARY 4 test.t1.id 1 100.00
-3 LATERAL DERIVED t2 ref ro_id ro_id 4 test.t1.id 1 100.00 Using where
+1 PRIMARY <derived3> ref key0 key0 4 test.t1.id 2 50.00 FirstMatch(t1)
+3 DERIVED t1 ALL PRIMARY NULL NULL NULL 20 100.00 Using temporary; Using filesort
+3 DERIVED t2 ref ro_id ro_id 4 test.t1.id 1 100.00 Using where
Warnings:
Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`v1`) where `v1`.`id` = `test`.`t1`.`id`
select id, a from t1
@@ -19542,11 +21368,11 @@ on (t1.id = t2.ro_id AND t2.flag = 1)
group by t1.id) dt);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 20 100.00
-1 PRIMARY <derived3> ref key0 key0 4 test.t1.id 2 100.00 FirstMatch(t1)
-3 LATERAL DERIVED t1 eq_ref PRIMARY PRIMARY 4 test.t1.id 1 100.00
-3 LATERAL DERIVED t2 ref ro_id ro_id 4 test.t1.id 1 100.00 Using where
+1 PRIMARY <derived3> ref key1,distinct_key key1 4 test.t1.id 2 50.00 FirstMatch(t1)
+3 DERIVED t1 ALL PRIMARY NULL NULL NULL 20 100.00 Using temporary; Using filesort
+3 DERIVED t2 ref ro_id ro_id 4 test.t1.id 1 100.00 Using where
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` semi join ((/* select#3 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` left join `test`.`t2` on(`test`.`t2`.`ro_id` = `test`.`t1`.`id` and `test`.`t2`.`flag` = 1) where `test`.`t1`.`id` = `test`.`t1`.`id` group by `test`.`t1`.`id`) `dt`) where `dt`.`id` = `test`.`t1`.`id`
+Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` semi join ((/* select#3 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` left join `test`.`t2` on(`test`.`t2`.`ro_id` = `test`.`t1`.`id` and `test`.`t2`.`flag` = 1) where 1 group by `test`.`t1`.`id`) `dt`) where `dt`.`id` = `test`.`t1`.`id`
drop view v1;
drop table t1,t2;
#
@@ -19648,21 +21474,28 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
- "access_type": "ALL",
+ "access_type": "const",
+ "possible_keys": ["distinct_key"],
+ "key": "distinct_key",
+ "key_length": "5",
+ "used_key_parts": ["a"],
+ "ref": ["const"],
+ "loops": 1,
"r_loops": 1,
- "rows": 4,
- "r_rows": 2,
+ "rows": 1,
+ "r_rows": 1,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
- "r_filtered": 50,
- "attached_condition": "v1.a = 3",
+ "r_filtered": 100,
"materialized": {
"query_block": {
"union_result": {
@@ -19674,6 +21507,7 @@ ANALYZE
{
"query_block": {
"select_id": 2,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -19681,9 +21515,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 2,
"r_rows": 2,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -19725,7 +21561,8 @@ create table t1 (id int, a int, index (a), index (id, a)) engine=myisam;
insert into t1 values
(17,1),(17,3010),(17,3013),(17,3053),(21,2446),(21,2467),(21,2);
create table t2 (a int) engine=myisam;
-insert into t2 values (1),(2),(3);
+insert into t2 values (1),(2),(3),(1000),(2000),(3000);
+insert into t2 select 5000 from seq_5000_to_6000;
create table t3 (id int) engine=myisam;
insert into t3 values (1),(2);
analyze table t1,t2,t3;
@@ -19747,22 +21584,25 @@ where dt.a = t1.a and t1.a = t3.id and t1.a in (select a from t2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where
1 PRIMARY t1 ref a a 5 test.t3.id 1
+1 PRIMARY <derived2> ref key0 key0 5 test.t3.id 1
1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1
-1 PRIMARY <derived2> ref key0 key0 5 test.t3.id 2
-3 MATERIALIZED t2 ALL NULL NULL NULL NULL 3
-2 DERIVED cp2 range NULL a 5 NULL 8 Using index for group-by
+3 MATERIALIZED t2 ALL NULL NULL NULL NULL 1007
+2 DERIVED cp2 range NULL a 5 NULL 7 Using index for group-by
explain format=json select * from t1, (select a from t1 cp2 group by a) dt, t3
where dt.a = t1.a and t1.a = t3.id and t1.a in (select a from t2);
EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t3.`id` is not null and t3.`id` is not null"
}
@@ -19776,32 +21616,42 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t3.id"],
+ "loops": 2,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
{
"table": {
- "table_name": "<subquery3>",
- "access_type": "eq_ref",
- "possible_keys": ["distinct_key"],
- "key": "distinct_key",
- "key_length": "4",
+ "table_name": "<derived2>",
+ "access_type": "ref",
+ "possible_keys": ["key0"],
+ "key": "key0",
+ "key_length": "5",
"used_key_parts": ["a"],
- "ref": ["func"],
+ "ref": ["test.t3.id"],
+ "loops": 2,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
- "unique": 1,
"query_block": {
- "select_id": 3,
+ "select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
- "table_name": "t2",
- "access_type": "ALL",
- "rows": 3,
- "filtered": 100
+ "table_name": "cp2",
+ "access_type": "range",
+ "key": "a",
+ "key_length": "5",
+ "used_key_parts": ["a"],
+ "loops": 1,
+ "rows": 7,
+ "cost": "COST_REPLACED",
+ "filtered": 100,
+ "using_index_for_group_by": true
}
}
]
@@ -19811,29 +21661,28 @@ EXPLAIN
},
{
"table": {
- "table_name": "<derived2>",
- "access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
- "key_length": "5",
+ "table_name": "<subquery3>",
+ "access_type": "eq_ref",
+ "possible_keys": ["distinct_key"],
+ "key": "distinct_key",
+ "key_length": "4",
"used_key_parts": ["a"],
- "ref": ["test.t3.id"],
- "rows": 2,
+ "ref": ["func"],
+ "rows": 1,
"filtered": 100,
"materialized": {
+ "unique": 1,
"query_block": {
- "select_id": 2,
+ "select_id": 3,
"nested_loop": [
{
"table": {
- "table_name": "cp2",
- "access_type": "range",
- "key": "a",
- "key_length": "5",
- "used_key_parts": ["a"],
- "rows": 8,
- "filtered": 100,
- "using_index_for_group_by": true
+ "table_name": "t2",
+ "access_type": "ALL",
+ "loops": 1,
+ "rows": 1007,
+ "cost": "COST_REPLACED",
+ "filtered": 100
}
}
]
@@ -19855,9 +21704,9 @@ where dt.a = t1.a and t1.a = t3.id and t1.a in (select a from t2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where
1 PRIMARY t1 ref a a 5 test.t3.id 1
+1 PRIMARY <derived2> ref key0 key0 5 test.t3.id 1
1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1
-1 PRIMARY <derived2> ref key0 key0 5 test.t3.id 2
-3 MATERIALIZED t2 ALL NULL NULL NULL NULL 3
+3 MATERIALIZED t2 ALL NULL NULL NULL NULL 1007
2 LATERAL DERIVED cp2 ref a a 5 test.t1.a 1 Using where; Using index
explain format=json select * from t1, (select a from t1 cp2 group by a) dt, t3
where dt.a = t1.a and t1.a = t3.id and t1.a in (select a from t2);
@@ -19865,12 +21714,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t3.`id` is not null and t3.`id` is not null"
}
@@ -19884,41 +21736,14 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t3.id"],
+ "loops": 2,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
{
"table": {
- "table_name": "<subquery3>",
- "access_type": "eq_ref",
- "possible_keys": ["distinct_key"],
- "key": "distinct_key",
- "key_length": "4",
- "used_key_parts": ["a"],
- "ref": ["func"],
- "rows": 1,
- "filtered": 100,
- "materialized": {
- "unique": 1,
- "query_block": {
- "select_id": 3,
- "nested_loop": [
- {
- "table": {
- "table_name": "t2",
- "access_type": "ALL",
- "rows": 3,
- "filtered": 100
- }
- }
- ]
- }
- }
- }
- },
- {
- "table": {
"table_name": "<derived2>",
"access_type": "ref",
"possible_keys": ["key0"],
@@ -19926,12 +21751,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t3.id"],
- "rows": 2,
+ "loops": 2,
+ "rows": 1,
+ "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": [
{
@@ -19943,7 +21771,9 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t1.a"],
+ "loops": 1,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "cp2.a = t3.`id`",
"using_index": true
@@ -19953,6 +21783,37 @@ EXPLAIN
}
}
}
+ },
+ {
+ "table": {
+ "table_name": "<subquery3>",
+ "access_type": "eq_ref",
+ "possible_keys": ["distinct_key"],
+ "key": "distinct_key",
+ "key_length": "4",
+ "used_key_parts": ["a"],
+ "ref": ["func"],
+ "rows": 1,
+ "filtered": 100,
+ "materialized": {
+ "unique": 1,
+ "query_block": {
+ "select_id": 3,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "loops": 1,
+ "rows": 1007,
+ "cost": "COST_REPLACED",
+ "filtered": 100
+ }
+ }
+ ]
+ }
+ }
+ }
}
]
}
@@ -19970,7 +21831,7 @@ id a a id
deallocate prepare stmt;
drop table t1,t2,t3;
#
-# MDEV-MDEV-27132: Splittable derived with equality in WHERE
+# MDEV-27132: Splittable derived with equality in WHERE
#
CREATE TABLE t1 (
id int PRIMARY KEY
@@ -20011,6 +21872,7 @@ INSERT INTO t2(deleted, t1_id, email, reporting_person)
SELECT deleted, t1_id+80000, email, reporting_person FROM t2;
INSERT INTO t2(deleted, t1_id, email, reporting_person)
SELECT deleted, t1_id+160000, email, reporting_person FROM t2;
+insert into t2 (id,t1_id) select -seq,-seq from seq_1_to_1000;
CREATE TABLE t3 (
id int PRIMARY KEY,
deleted int,
@@ -20063,8 +21925,8 @@ WHERE t1.id BETWEEN 200 AND 100000;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 range t1_id t1_id 5 NULL 47 Using where; Using index
1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t3.t1_id 1 Using index
-1 PRIMARY <derived2> ref key0 key0 5 test.t3.t1_id 2
-2 LATERAL DERIVED t2 ref t1_id t1_id 5 test.t1.id 3 Using index condition; Using where
+1 PRIMARY <derived2> ref key0 key0 5 test.t3.t1_id 1
+2 LATERAL DERIVED t2 ref t1_id t1_id 5 test.t1.id 1 Using index condition; Using where
EXPLAIN FORMAT=JSON SELECT t1.id
FROM t1
JOIN t3
@@ -20076,6 +21938,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -20085,7 +21948,9 @@ EXPLAIN
"key": "t1_id",
"key_length": "5",
"used_key_parts": ["t1_id"],
+ "loops": 1,
"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
@@ -20100,7 +21965,9 @@ EXPLAIN
"key_length": "4",
"used_key_parts": ["id"],
"ref": ["test.t3.t1_id"],
+ "loops": 47,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"using_index": true
}
@@ -20114,12 +21981,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["t1_id"],
"ref": ["test.t3.t1_id"],
- "rows": 2,
+ "loops": 47,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"lateral": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -20130,8 +22000,10 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["t1_id"],
"ref": ["test.t1.id"],
- "rows": 3,
- "filtered": 59.09090805,
+ "loops": 1,
+ "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"
}
@@ -20153,6 +22025,18 @@ JOIN (SELECT t1_id FROM t2 WHERE reporting_person = 1 GROUP BY t1_id) tx
ON tx.t1_id = t1.id
WHERE t1.id BETWEEN 200 AND 100000;
id
+EXPLAIN SELECT t1.id
+FROM t1
+JOIN t3
+ON t3.t1_id = t1.id
+JOIN (SELECT t1_id FROM t2 WHERE reporting_person = 1 GROUP BY t1_id) tx
+ON tx.t1_id = t1.id
+WHERE t1.id BETWEEN 200 AND 100000;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t3 range t1_id t1_id 5 NULL 47 Using where; Using index
+1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t3.t1_id 1 Using index
+1 PRIMARY <derived2> ref key0 key0 5 test.t3.t1_id 10
+2 DERIVED t2 ALL t1_id NULL NULL NULL 2408 Using where; Using temporary; Using filesort
set optimizer_switch='split_materialized=default';
DROP TABLE t1,t2,t3;
#
@@ -20275,8 +22159,8 @@ ON from_agg_items.charge_id = charges.id AND
from_agg_items.ledger_id = charges.from_ledger_id
WHERE charges.to_ledger_id = 2;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY charges ALL PRIMARY,fk_charge_from_ledger,fk_charge_to_ledger NULL NULL NULL 20 Using where
-1 PRIMARY <derived2> ref key0 key0 17 test.charges.from_ledger_id,test.charges.id 2
+1 PRIMARY charges ref PRIMARY,fk_charge_from_ledger,fk_charge_to_ledger fk_charge_to_ledger 8 const 8
+1 PRIMARY <derived2> ref key0 key0 17 test.charges.from_ledger_id,test.charges.id 1
2 LATERAL DERIVED transaction_items ref fk_items_transaction,fk_items_charge fk_items_charge 9 test.charges.id 2
2 LATERAL DERIVED transactions eq_ref PRIMARY,fk_transactions_ledger PRIMARY 8 test.transaction_items.transaction_id 1 Using where
EXPLAIN FORMAT=JSON SELECT
@@ -20301,19 +22185,25 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "charges",
- "access_type": "ALL",
+ "access_type": "ref",
"possible_keys": [
"PRIMARY",
"fk_charge_from_ledger",
"fk_charge_to_ledger"
],
- "rows": 20,
- "filtered": 40,
- "attached_condition": "charges.to_ledger_id = 2"
+ "key": "fk_charge_to_ledger",
+ "key_length": "8",
+ "used_key_parts": ["to_ledger_id"],
+ "ref": ["const"],
+ "loops": 1,
+ "rows": 8,
+ "cost": "COST_REPLACED",
+ "filtered": 100
}
},
{
@@ -20325,12 +22215,15 @@ EXPLAIN
"key_length": "17",
"used_key_parts": ["ledger_id", "charge_id"],
"ref": ["test.charges.from_ledger_id", "test.charges.id"],
- "rows": 2,
+ "loops": 8,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"lateral": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -20341,7 +22234,9 @@ EXPLAIN
"key_length": "9",
"used_key_parts": ["charge_id"],
"ref": ["test.charges.id"],
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -20354,7 +22249,9 @@ EXPLAIN
"key_length": "8",
"used_key_parts": ["id"],
"ref": ["test.transaction_items.transaction_id"],
+ "loops": 2,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "transactions.ledger_id = charges.from_ledger_id"
}
@@ -20414,7 +22311,7 @@ ON from_agg_items.charge_id = charges.id AND
from_agg_items.ledger_id = charges.from_ledger_id
WHERE charges.to_ledger_id = 2;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY charges ALL PRIMARY,fk_charge_from_ledger,fk_charge_to_ledger NULL NULL NULL 20 Using where
+1 PRIMARY charges ref PRIMARY,fk_charge_from_ledger,fk_charge_to_ledger fk_charge_to_ledger 8 const 8
1 PRIMARY <derived2> ref key0 key0 17 test.charges.from_ledger_id,test.charges.id 4
2 DERIVED transaction_items ALL fk_items_transaction NULL NULL NULL 40 Using temporary; Using filesort
2 DERIVED transactions eq_ref PRIMARY PRIMARY 8 test.transaction_items.transaction_id 1
@@ -20469,8 +22366,8 @@ ON from_agg_items.charge_id = charges.id AND
from_agg_items.ledger_id = charges.from_ledger_id
WHERE charges.to_ledger_id = 2;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY charges ALL fk_charge_to_ledger NULL NULL NULL 20 Using where
-1 PRIMARY <derived2> ref key0 key0 18 test.charges.from_ledger_id,test.charges.id 2
+1 PRIMARY charges ref fk_charge_to_ledger fk_charge_to_ledger 8 const 10
+1 PRIMARY <derived2> ref key0 key0 18 test.charges.from_ledger_id,test.charges.id 1
2 LATERAL DERIVED transaction_items ref fk_items_transaction,fk_items_charge fk_items_charge 9 test.charges.id 2
2 LATERAL DERIVED transactions eq_ref PRIMARY,fk_transactions_ledger PRIMARY 8 test.transaction_items.transaction_id 1 Using where
EXPLAIN FORMAT=JSON SELECT
@@ -20495,15 +22392,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "charges",
- "access_type": "ALL",
+ "access_type": "ref",
"possible_keys": ["fk_charge_to_ledger"],
- "rows": 20,
- "filtered": 50,
- "attached_condition": "charges.to_ledger_id = 2"
+ "key": "fk_charge_to_ledger",
+ "key_length": "8",
+ "used_key_parts": ["to_ledger_id"],
+ "ref": ["const"],
+ "loops": 1,
+ "rows": 10,
+ "cost": "COST_REPLACED",
+ "filtered": 100
}
},
{
@@ -20515,12 +22418,15 @@ EXPLAIN
"key_length": "18",
"used_key_parts": ["ledger_id", "charge_id"],
"ref": ["test.charges.from_ledger_id", "test.charges.id"],
- "rows": 2,
+ "loops": 10,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"lateral": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -20531,7 +22437,9 @@ EXPLAIN
"key_length": "9",
"used_key_parts": ["charge_id"],
"ref": ["test.charges.id"],
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -20544,7 +22452,9 @@ EXPLAIN
"key_length": "8",
"used_key_parts": ["id"],
"ref": ["test.transaction_items.transaction_id"],
+ "loops": 2,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "transactions.ledger_id = charges.from_ledger_id"
}
@@ -20606,7 +22516,7 @@ ON from_agg_items.charge_id = charges.id AND
from_agg_items.ledger_id = charges.from_ledger_id
WHERE charges.to_ledger_id = 2;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY charges ALL fk_charge_to_ledger NULL NULL NULL 20 Using where
+1 PRIMARY charges ref fk_charge_to_ledger fk_charge_to_ledger 8 const 10
1 PRIMARY <derived2> ref key0 key0 18 test.charges.from_ledger_id,test.charges.id 4
2 DERIVED transaction_items ALL fk_items_transaction NULL NULL NULL 40 Using temporary; Using filesort
2 DERIVED transactions eq_ref PRIMARY PRIMARY 8 test.transaction_items.transaction_id 1
@@ -20673,7 +22583,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 const PRIMARY,oid PRIMARY 4 const 1
1 PRIMARY t1 const PRIMARY PRIMARY 4 const 1 Using index
1 PRIMARY t2 const PRIMARY PRIMARY 4 const 1 Using index
-1 PRIMARY t4 const PRIMARY,a NULL NULL NULL 1 Impossible ON condition
+1 PRIMARY t4 const PRIMARY,a NULL NULL NULL 0 Impossible ON condition
1 PRIMARY <derived3> ref key0 key0 5 const 0 Using where
3 LATERAL DERIVED t5 ref id1 id1 5 const 0 Using index
DROP VIEW v1;
@@ -20731,12 +22641,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": 0.012461052,
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": 0.012461052,
"filtered": 100,
"attached_condition": "v1.r < 'x'",
"materialized": {
@@ -20748,12 +22661,15 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": 0.010504815,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": 0.010504815,
"filtered": 100,
"attached_condition": "case when t1.n = 1 then convert(t1.lv using utf8mb3) when t1.n = 2 then t1.mv else NULL end < 'x'"
}
@@ -20821,8 +22737,8 @@ where dt.a=t1.a and t3.a < 3
from t1 limit 5;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 1000
-2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 2 Using where
-2 DEPENDENT SUBQUERY <derived3> ref key0 key0 5 test.t1.a 2
+2 DEPENDENT SUBQUERY <derived3> ref key0 key0 5 test.t1.a 1
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
3 LATERAL DERIVED t2 ref a a 5 test.t1.a 10
select
a,
@@ -20958,11 +22874,10 @@ WHERE t1.valint1 = dt.valint1 AND
t1.valdate = dt.maxdate AND
t1.valint1 IN (SELECT * FROM t2);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY <subquery3> ALL distinct_key NULL NULL NULL 21
-1 PRIMARY t1 ref valint1,valint1_2 valint1 5 test.t2.a 2 Using index condition; Using where
-1 PRIMARY <derived2> ref key0 key0 11 test.t1.valdate,test.t1.valint1 5
-3 MATERIALIZED t2 ALL NULL NULL NULL NULL 21 Using where
-2 DERIVED t range valint1,valint1_2 valint1_2 5 NULL 51 Using index for group-by; Using temporary; Using filesort
+1 PRIMARY t2 ALL NULL NULL NULL NULL 21 Using where; Start temporary
+1 PRIMARY t1 ref valint1,valint1_2 valint1 5 test.t2.a 2 Using index condition; Using where; End temporary
+1 PRIMARY <derived2> ref key0 key0 11 test.t1.valdate,test.t1.valint1 1
+2 LATERAL DERIVED t ref valint1,valint1_2 valint1 5 test.t2.a 2 Using index condition
SELECT t1.valdouble, t1.valint1
FROM t1,
(SELECT max(t.valdate) AS maxdate, t.valint1 FROM t1 t GROUP BY t.valint1)