Commit 7b988e5c authored by Varun Gupta's avatar Varun Gupta

MDEV-20444: More information regarding access of a table to be printed inside the optimizer_trace

Added:
      1) estimated_join_cardinality
      2) best_chosen_access_method for a table
      3) best_join_order
parent e980cf91
......@@ -135,13 +135,24 @@ select * from v1 {
"cost": 2.2044,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 1,
"cost": 2.2044,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 1,
"cost_for_plan": 2.4044
"cost_for_plan": 2.4044,
"estimated_join_cardinality": 1
}
]
},
{
"best_join_order": ["t1"]
},
{
"attaching_conditions_to_tables": {
"original_condition": "t1.a = 1",
......@@ -270,13 +281,24 @@ select * from (select * from t1 where t1.a=1)q {
"cost": 2.2044,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 1,
"cost": 2.2044,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 1,
"cost_for_plan": 2.4044
"cost_for_plan": 2.4044,
"estimated_join_cardinality": 1
}
]
},
{
"best_join_order": ["t1"]
},
{
"attaching_conditions_to_tables": {
"original_condition": "t1.a = 1",
......@@ -411,13 +433,24 @@ select * from v2 {
"chosen": true,
"use_tmp_table": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 1,
"cost": 2.2044,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 1,
"cost_for_plan": 2.4044
"cost_for_plan": 2.4044,
"estimated_join_cardinality": 1
}
]
},
{
"best_join_order": ["t1"]
},
{
"attaching_conditions_to_tables": {
"original_condition": "t1.a = 1",
......@@ -467,13 +500,24 @@ select * from v2 {
"cost": 2,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 2,
"cost": 2,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 2,
"cost_for_plan": 2.4
"cost_for_plan": 2.4,
"estimated_join_cardinality": 2
}
]
},
{
"best_join_order": ["<derived2>"]
},
{
"attaching_conditions_to_tables": {
"original_condition": null,
......@@ -596,13 +640,24 @@ explain select * from v2 {
"cost": 2.022,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 10,
"cost": 2.022,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 10,
"cost_for_plan": 4.022
"cost_for_plan": 4.022,
"estimated_join_cardinality": 10
}
]
},
{
"best_join_order": ["t2"]
},
{
"attaching_conditions_to_tables": {
"original_condition": null,
......@@ -705,13 +760,24 @@ explain select * from v1 {
"chosen": true,
"use_tmp_table": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 10,
"cost": 2.022,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 10,
"cost_for_plan": 4.022
"cost_for_plan": 4.022,
"estimated_join_cardinality": 10
}
]
},
{
"best_join_order": ["t1"]
},
{
"attaching_conditions_to_tables": {
"original_condition": null,
......@@ -761,13 +827,24 @@ explain select * from v1 {
"cost": 10,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 10,
"cost": 10,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 10,
"cost_for_plan": 12
"cost_for_plan": 12,
"estimated_join_cardinality": 10
}
]
},
{
"best_join_order": ["<derived2>"]
},
{
"attaching_conditions_to_tables": {
"original_condition": null,
......@@ -922,7 +999,14 @@ explain select * from t1,t2 where t1.a=t2.b+2 and t2.a= t1.b {
"cost": 2.3174,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 100,
"cost": 2.3174,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 100,
"cost_for_plan": 22.317,
......@@ -947,10 +1031,18 @@ explain select * from t1,t2 where t1.a=t2.b+2 and t2.a= t1.b {
"cost": 2.3174,
"chosen": false
}
]
],
"chosen_access_method": {
"type": "ref",
"records": 1,
"cost": 200,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 100,
"cost_for_plan": 242.32
"cost_for_plan": 242.32,
"estimated_join_cardinality": 100
}
]
},
......@@ -965,7 +1057,14 @@ explain select * from t1,t2 where t1.a=t2.b+2 and t2.a= t1.b {
"cost": 2.3174,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 100,
"cost": 2.3174,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 100,
"cost_for_plan": 22.317,
......@@ -990,7 +1089,14 @@ explain select * from t1,t2 where t1.a=t2.b+2 and t2.a= t1.b {
"cost": 2.3174,
"chosen": false
}
]
],
"chosen_access_method": {
"type": "ref",
"records": 1,
"cost": 200,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 100,
"cost_for_plan": 242.32,
......@@ -1000,6 +1106,9 @@ explain select * from t1,t2 where t1.a=t2.b+2 and t2.a= t1.b {
}
]
},
{
"best_join_order": ["t1", "t2"]
},
{
"attaching_conditions_to_tables": {
"original_condition": "t2.a = t1.b and t1.a = t2.b + 2",
......@@ -1146,18 +1255,29 @@ EXPLAIN SELECT DISTINCT a FROM t1 {
"best_access_path": {
"considered_access_paths": [
{
"access_type": "range",
"access_type": "index_merge",
"resulting_rows": 5,
"cost": 6.75,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "index_merge",
"records": 5,
"cost": 6.75,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 5,
"cost_for_plan": 7.75
"cost_for_plan": 7.75,
"estimated_join_cardinality": 5
}
]
},
{
"best_join_order": ["t1"]
},
{
"attaching_conditions_to_tables": {
"original_condition": null,
......@@ -1331,13 +1451,24 @@ EXPLAIN SELECT MIN(d) FROM t1 where b=2 and c=3 group by a {
"chosen": true,
"use_tmp_table": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 0.5849,
"cost": 3.3121,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 0.5849,
"cost_for_plan": 3.4291
"cost_for_plan": 3.4291,
"estimated_join_cardinality": 0.5849
}
]
},
{
"best_join_order": ["t1"]
},
{
"attaching_conditions_to_tables": {
"original_condition": "t1.b = 2 and t1.c = 3",
......@@ -1522,13 +1653,24 @@ EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>=20010104e0 GROUP BY id {
"chosen": true,
"use_tmp_table": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 16,
"cost": 2.0312,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 16,
"cost_for_plan": 5.2313
"cost_for_plan": 5.2313,
"estimated_join_cardinality": 16
}
]
},
{
"best_join_order": ["t1"]
},
{
"attaching_conditions_to_tables": {
"original_condition": "t1.a >= 20010104e0",
......@@ -1702,13 +1844,24 @@ EXPLAIN SELECT * FROM t1 WHERE a = 20010104e0 GROUP BY id {
"chosen": true,
"use_tmp_table": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 16,
"cost": 2.0312,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 16,
"cost_for_plan": 5.2313
"cost_for_plan": 5.2313,
"estimated_join_cardinality": 16
}
]
},
{
"best_join_order": ["t1"]
},
{
"attaching_conditions_to_tables": {
"original_condition": "t1.a = 20010104e0",
......@@ -1972,13 +2125,24 @@ explain select * from t1 where a=1 and b=2 order by c limit 1 {
"chosen": false,
"cause": "cost"
}
]
],
"chosen_access_method": {
"type": "ref",
"records": 21,
"cost": 22,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 21,
"cost_for_plan": 26.2
"cost_for_plan": 26.2,
"estimated_join_cardinality": 21
}
]
},
{
"best_join_order": ["t1"]
},
{
"attaching_conditions_to_tables": {
"original_condition": "t1.a = 1 and t1.b = 2",
......@@ -2202,13 +2366,24 @@ select t1.a from t1 left join t2 on t1.a=t2.a {
"cost": 2.0068,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 4,
"cost": 2.0068,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 4,
"cost_for_plan": 2.8068
"cost_for_plan": 2.8068,
"estimated_join_cardinality": 4
}
]
},
{
"best_join_order": ["t2", "t1"]
},
{
"condition_on_constant_tables": "1"
},
......@@ -2318,7 +2493,14 @@ explain select * from t1 left join t2 on t2.a=t1.a {
"cost": 2.0068,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 4,
"cost": 2.0068,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 4,
"cost_for_plan": 2.8068,
......@@ -2341,15 +2523,26 @@ explain select * from t1 left join t2 on t2.a=t1.a {
"cost": 8.0176,
"chosen": false
}
]
],
"chosen_access_method": {
"type": "eq_ref",
"records": 1,
"cost": 4,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 4,
"cost_for_plan": 7.6068
"cost_for_plan": 7.6068,
"estimated_join_cardinality": 4
}
]
}
]
},
{
"best_join_order": ["t1", "t2"]
},
{
"condition_on_constant_tables": "1"
},
......@@ -2491,13 +2684,24 @@ explain select t1.a from t1 left join (t2 join t3 on t2.b=t3.b) on t2.a=t1.a and
"cost": 2.0068,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 4,
"cost": 2.0068,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 4,
"cost_for_plan": 2.8068
"cost_for_plan": 2.8068,
"estimated_join_cardinality": 4
}
]
},
{
"best_join_order": ["t3", "t2", "t1"]
},
{
"condition_on_constant_tables": "1"
},
......@@ -2683,10 +2887,18 @@ explain extended select * from t1 where a in (select pk from t10) {
"cost": 2.022,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 10,
"cost": 2.022,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 10,
"cost_for_plan": 4.022
"cost_for_plan": 4.022,
"estimated_join_cardinality": 10
}
]
}
......@@ -2706,7 +2918,14 @@ explain extended select * from t1 where a in (select pk from t10) {
"cost": 2.0066,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 3,
"cost": 2.0066,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 3,
"cost_for_plan": 2.6066,
......@@ -2723,7 +2942,14 @@ explain extended select * from t1 where a in (select pk from t10) {
"cost": 2.022,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 10,
"cost": 2.022,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 30,
"cost_for_plan": 10.629,
......@@ -2746,7 +2972,8 @@ explain extended select * from t1 where a in (select pk from t10) {
{
"chosen_strategy": "SJ-Materialize"
}
]
],
"estimated_join_cardinality": 3
}
]
},
......@@ -2761,7 +2988,14 @@ explain extended select * from t1 where a in (select pk from t10) {
"cost": 2.022,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 10,
"cost": 2.022,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 10,
"cost_for_plan": 4.022,
......@@ -2782,6 +3016,9 @@ explain extended select * from t1 where a in (select pk from t10) {
}
]
},
{
"best_join_order": ["t1", "<subquery2>"]
},
{
"condition_on_constant_tables": "1"
},
......@@ -3105,13 +3342,24 @@ explain select * from t1 where pk = 2 and a=5 and b=1 {
"chosen": false,
"cause": "cost"
}
]
],
"chosen_access_method": {
"type": "ref",
"records": 1,
"cost": 1.0043,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 1,
"cost_for_plan": 1.2043
"cost_for_plan": 1.2043,
"estimated_join_cardinality": 1
}
]
},
{
"best_join_order": ["t1"]
},
{
"attaching_conditions_to_tables": {
"original_condition": "t1.pk = 2 and t1.a = 5 and t1.b = 1",
......@@ -3219,13 +3467,24 @@ select f1(a) from t1 {
"cost": 2.0068,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 4,
"cost": 2.0068,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 4,
"cost_for_plan": 2.8068
"cost_for_plan": 2.8068,
"estimated_join_cardinality": 4
}
]
},
{
"best_join_order": ["t1"]
},
{
"attaching_conditions_to_tables": {
"original_condition": null,
......@@ -3307,13 +3566,24 @@ select f2(a) from t1 {
"cost": 2.0068,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 4,
"cost": 2.0068,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 4,
"cost_for_plan": 2.8068
"cost_for_plan": 2.8068,
"estimated_join_cardinality": 4
}
]
},
{
"best_join_order": ["t1"]
},
{
"attaching_conditions_to_tables": {
"original_condition": null,
......@@ -3354,7 +3624,7 @@ a
2
select length(trace) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
length(trace)
1831
2205
set optimizer_trace_max_mem_size=100;
select * from t1;
a
......@@ -3368,7 +3638,7 @@ select * from t1 {
"join_preparation": {
"select_id": 1,
"steps": [
1731 0
2105 0
set optimizer_trace_max_mem_size=0;
select * from t1;
a
......@@ -3376,7 +3646,7 @@ a
2
select * from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES
select * from t1 1831 0
select * from t1 2205 0
drop table t1;
set optimizer_trace='enabled=off';
set @@optimizer_trace_max_mem_size= @save_optimizer_trace_max_mem_size;
......@@ -3679,7 +3949,14 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 {
"cost": 1.407,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "range",
"records": 3,
"cost": 1.407,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 3,
"cost_for_plan": 2.007,
......@@ -3703,10 +3980,18 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 {
"chosen": false,
"cause": "cost"
}
]
],
"chosen_access_method": {
"type": "ref",
"records": 1,
"cost": 3.007,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 3,
"cost_for_plan": 5.614
"cost_for_plan": 5.614,
"estimated_join_cardinality": 3
}
]
},
......@@ -3721,7 +4006,14 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 {
"cost": 1.407,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "range",
"records": 3,
"cost": 1.407,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 3,
"cost_for_plan": 2.007,
......@@ -3745,7 +4037,14 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 {
"chosen": false,
"cause": "cost"
}
]
],
"chosen_access_method": {
"type": "ref",
"records": 2,
"cost": 3.014,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 6,
"cost_for_plan": 6.2211,
......@@ -3755,6 +4054,9 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 {
}
]
},
{
"best_join_order": ["t0", "t1"]
},
{
"attaching_conditions_to_tables": {
"original_condition": "t1.a = t0.a and t0.a < 3",
......@@ -3875,13 +4177,24 @@ explain select * from (select rand() from t1)q {
"cost": 2.0051,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 3,
"cost": 2.0051,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 3,
"cost_for_plan": 2.6051
"cost_for_plan": 2.6051,
"estimated_join_cardinality": 3
}
]
},
{
"best_join_order": ["t1"]
},
{
"attaching_conditions_to_tables": {
"original_condition": null,
......@@ -3931,13 +4244,24 @@ explain select * from (select rand() from t1)q {
"cost": 3,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 3,
"cost": 3,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 3,
"cost_for_plan": 3.6
"cost_for_plan": 3.6,
"estimated_join_cardinality": 3
}
]
},
{
"best_join_order": ["<derived2>"]
},
{
"attaching_conditions_to_tables": {
"original_condition": null,
......@@ -4129,7 +4453,14 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_
"cost": 2.0051,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 3,
"cost": 2.0051,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 3,
"cost_for_plan": 2.6051,
......@@ -4145,10 +4476,18 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_
"cost": 2.0051,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 3,
"cost": 2.0051,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 9,
"cost_for_plan": 6.4103
"cost_for_plan": 6.4103,
"estimated_join_cardinality": 9
}
]
},
......@@ -4163,7 +4502,14 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_
"cost": 2.0051,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 3,
"cost": 2.0051,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 3,
"cost_for_plan": 2.6051,
......@@ -4187,7 +4533,14 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_
"cost": 2.0051,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 3,
"cost": 2.0051,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 3,
"cost_for_plan": 2.6051,
......@@ -4204,7 +4557,14 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_
"cost": 2.0051,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 3,
"cost": 2.0051,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 9,
"cost_for_plan": 6.4103,
......@@ -4221,7 +4581,14 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_
"cost": 2.0051,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 3,
"cost": 2.0051,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 27,
"cost_for_plan": 13.815,
......@@ -4244,7 +4611,8 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_
{
"chosen_strategy": "SJ-Materialize"
}
]
],
"estimated_join_cardinality": 3
}
]
},
......@@ -4259,7 +4627,14 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_
"cost": 2.0051,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 3,
"cost": 2.0051,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 9,
"cost_for_plan": 6.4103,
......@@ -4279,7 +4654,14 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_
"cost": 2.0051,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 3,
"cost": 2.0051,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 3,
"cost_for_plan": 2.6051,
......@@ -4297,7 +4679,14 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_
"cost": 2.0051,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 3,
"cost": 2.0051,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 3,
"cost_for_plan": 2.6051,
......@@ -4321,6 +4710,9 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_
}
]
},
{
"best_join_order": ["t1", "<subquery2>"]
},
{
"condition_on_constant_tables": "1"
},
......@@ -4596,7 +4988,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0051,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 3,
"cost": 2.0051,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 3,
"cost_for_plan": 2.6051,
......@@ -4613,7 +5012,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0051,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 3,
"cost": 2.0051,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 9,
"cost_for_plan": 6.4103,
......@@ -4630,7 +5036,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 81,
"cost_for_plan": 24.626,
......@@ -4661,7 +5074,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 27,
"cost_for_plan": 44.641,
......@@ -4683,7 +5103,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0051,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 3,
"cost": 2.0051,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 81,
"cost_for_plan": 62.846,
......@@ -4706,7 +5133,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 729,
"cost_for_plan": 210.66,
......@@ -4724,7 +5158,8 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"chosen_strategy": "DuplicateWeedout"
}
]
],
"estimated_join_cardinality": 27
}
]
},
......@@ -4744,7 +5179,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 243,
"cost_for_plan": 95.256,
......@@ -4764,7 +5206,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0051,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 3,
"cost": 2.0051,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 9,
"cost_for_plan": 41.031,
......@@ -4786,7 +5235,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 81,
"cost_for_plan": 59.246,
......@@ -4809,7 +5265,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 729,
"cost_for_plan": 207.06,
......@@ -4822,7 +5285,8 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"chosen_strategy": "DuplicateWeedout"
}
]
],
"estimated_join_cardinality": 27
}
]
},
......@@ -4842,7 +5306,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 81,
"cost_for_plan": 59.246,
......@@ -4862,7 +5333,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 27,
"cost_for_plan": 44.641,
......@@ -4882,7 +5360,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 81,
"cost_for_plan": 24.626,
......@@ -4899,7 +5384,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 729,
"cost_for_plan": 172.44,
......@@ -4930,7 +5422,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0051,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 3,
"cost": 2.0051,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 81,
"cost_for_plan": 304.05,
......@@ -4953,7 +5452,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 729,
"cost_for_plan": 451.86,
......@@ -4987,7 +5493,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 243,
"cost_for_plan": 336.46,
......@@ -5007,7 +5520,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0051,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 3,
"cost": 2.0051,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 243,
"cost_for_plan": 75.231,
......@@ -5029,7 +5549,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 2187,
"cost_for_plan": 514.65,
......@@ -5052,7 +5579,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 2187,
"cost_for_plan": 514.65,
......@@ -5072,7 +5606,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 729,
"cost_for_plan": 172.44,
......@@ -5094,7 +5635,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0051,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 3,
"cost": 2.0051,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 2187,
"cost_for_plan": 611.85,
......@@ -5126,7 +5674,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 6561,
"cost_for_plan": 1486.7,
......@@ -5148,7 +5703,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0051,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 3,
"cost": 2.0051,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 27,
"cost_for_plan": 13.815,
......@@ -5165,7 +5727,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 243,
"cost_for_plan": 64.431,
......@@ -5187,7 +5756,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 2187,
"cost_for_plan": 503.85,
......@@ -5210,7 +5786,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 2187,
"cost_for_plan": 503.85,
......@@ -5230,7 +5813,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 243,
"cost_for_plan": 64.431,
......@@ -5248,7 +5838,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 243,
"cost_for_plan": 64.431,
......@@ -5268,7 +5865,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 81,
"cost_for_plan": 24.626,
......@@ -5285,7 +5889,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 729,
"cost_for_plan": 172.44,
......@@ -5307,7 +5918,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0051,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 3,
"cost": 2.0051,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 2187,
"cost_for_plan": 611.85,
......@@ -5330,7 +5948,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 6561,
"cost_for_plan": 1486.7,
......@@ -5350,7 +5975,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0051,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 3,
"cost": 2.0051,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 243,
"cost_for_plan": 75.231,
......@@ -5372,7 +6004,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 2187,
"cost_for_plan": 514.65,
......@@ -5395,7 +6034,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 2187,
"cost_for_plan": 514.65,
......@@ -5415,7 +6061,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 729,
"cost_for_plan": 172.44,
......@@ -5437,7 +6090,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 27,
"cost_for_plan": 10.021,
......@@ -5455,7 +6115,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 27,
"cost_for_plan": 10.021,
......@@ -5473,7 +6140,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0051,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 3,
"cost": 2.0051,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 9,
"cost_for_plan": 6.4103,
......@@ -5491,7 +6165,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 27,
"cost_for_plan": 10.021,
......@@ -5511,7 +6192,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0051,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 3,
"cost": 2.0051,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 3,
"cost_for_plan": 2.6051,
......@@ -5529,7 +6217,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 9,
"cost_for_plan": 3.8154,
......@@ -5547,7 +6242,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 9,
"cost_for_plan": 3.8154,
......@@ -5565,7 +6267,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0051,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 3,
"cost": 2.0051,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 3,
"cost_for_plan": 2.6051,
......@@ -5583,7 +6292,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 9,
"cost_for_plan": 3.8154,
......@@ -5595,6 +6311,16 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"fix_semijoin_strategies_for_picked_join_order": []
},
{
"best_join_order": [
"t_outer_1",
"t_inner_1",
"t_inner_2",
"t_inner_4",
"t_outer_2",
"t_inner_3"
]
},
{
"attaching_conditions_to_tables": {
"original_condition": "t_inner_1.a = t_outer_1.a and t_inner_3.a = t_outer_2.a",
......@@ -5874,7 +6600,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0051,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 3,
"cost": 2.0051,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 3,
"cost_for_plan": 2.6051,
......@@ -5890,10 +6623,18 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 27,
"cost_for_plan": 10.021
"cost_for_plan": 10.021,
"estimated_join_cardinality": 27
}
]
},
......@@ -5908,7 +6649,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 9,
"cost_for_plan": 3.8154,
......@@ -5929,7 +6677,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0051,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 3,
"cost": 2.0051,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 3,
"cost_for_plan": 2.6051,
......@@ -5945,10 +6700,18 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 27,
"cost_for_plan": 10.021
"cost_for_plan": 10.021,
"estimated_join_cardinality": 27
}
]
},
......@@ -5963,7 +6726,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 9,
"cost_for_plan": 3.8154,
......@@ -5987,7 +6757,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0051,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 3,
"cost": 2.0051,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 3,
"cost_for_plan": 2.6051,
......@@ -6004,7 +6781,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0051,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 3,
"cost": 2.0051,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 9,
"cost_for_plan": 6.4103,
......@@ -6021,7 +6805,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 81,
"cost_for_plan": 24.626,
......@@ -6057,7 +6848,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 27,
"cost_for_plan": 15.541,
......@@ -6079,7 +6877,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0051,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 3,
"cost": 2.0051,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 81,
"cost_for_plan": 33.746,
......@@ -6102,7 +6907,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 729,
"cost_for_plan": 181.56,
......@@ -6125,7 +6937,8 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"chosen_strategy": "SJ-Materialize"
}
]
],
"estimated_join_cardinality": 27
}
]
},
......@@ -6145,7 +6958,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 243,
"cost_for_plan": 66.156,
......@@ -6165,7 +6985,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0051,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 3,
"cost": 2.0051,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 9,
"cost_for_plan": 11.931,
......@@ -6187,7 +7014,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 81,
"cost_for_plan": 30.146,
......@@ -6210,7 +7044,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 81,
"cost_for_plan": 30.146,
......@@ -6230,7 +7071,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 27,
"cost_for_plan": 15.541,
......@@ -6250,7 +7098,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 81,
"cost_for_plan": 24.626,
......@@ -6268,7 +7123,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0051,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 3,
"cost": 2.0051,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 27,
"cost_for_plan": 13.815,
......@@ -6286,7 +7148,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 81,
"cost_for_plan": 24.626,
......@@ -6306,7 +7175,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 27,
"cost_for_plan": 10.021,
......@@ -6324,7 +7200,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 27,
"cost_for_plan": 10.021,
......@@ -6342,7 +7225,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0051,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 3,
"cost": 2.0051,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 9,
"cost_for_plan": 6.4103,
......@@ -6360,7 +7250,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": true,
"filter_used": false
}
},
"rows_for_plan": 27,
"cost_for_plan": 10.021,
......@@ -6380,7 +7277,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0051,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 3,
"cost": 2.0051,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 3,
"cost_for_plan": 2.6051,
......@@ -6398,7 +7302,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 9,
"cost_for_plan": 3.8154,
......@@ -6416,7 +7327,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 9,
"cost_for_plan": 3.8154,
......@@ -6434,7 +7352,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0051,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 3,
"cost": 2.0051,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 3,
"cost_for_plan": 2.6051,
......@@ -6452,7 +7377,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"cost": 2.0154,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 9,
"cost": 2.0154,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 9,
"cost_for_plan": 3.8154,
......@@ -6487,6 +7419,14 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
}
]
},
{
"best_join_order": [
"t_outer_1",
"<subquery2>",
"t_outer_2",
"<subquery3>"
]
},
{
"condition_on_constant_tables": "1"
},
......@@ -7130,7 +8070,15 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans'))
"cost": 2.8296,
"chosen": true
}
]
],
"chosen_access_method":
{
"type": "scan",
"records": 5.9375,
"cost": 2.8296,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 5.9375,
"cost_for_plan": 4.0171,
......@@ -7154,10 +8102,19 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans'))
"cost": 256.85,
"chosen": true
}
]
],
"chosen_access_method":
{
"type": "scan",
"records": 804.69,
"cost": 256.85,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 4777.8,
"cost_for_plan": 1216.4
"cost_for_plan": 1216.4,
"estimated_join_cardinality": 4777.8
}
]
},
......@@ -7178,7 +8135,15 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans'))
"cost": 43.26,
"chosen": true
}
]
],
"chosen_access_method":
{
"type": "scan",
"records": 804.69,
"cost": 43.26,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 804.69,
"cost_for_plan": 204.2,
......@@ -7214,7 +8179,15 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans'))
"cost": 2.0171,
"chosen": true
}
]
],
"chosen_access_method":
{
"type": "scan",
"records": 10,
"cost": 2.0171,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 10,
"cost_for_plan": 4.0171,
......@@ -7248,11 +8221,20 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans'))
"cost": 43.26,
"chosen": false
}
]
],
"chosen_access_method":
{
"type": "ref",
"records": 1,
"cost": 20,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 10,
"cost_for_plan": 26.017,
"selectivity": 0.8047
"selectivity": 0.8047,
"estimated_join_cardinality": 8.0469
}
]
},
......@@ -7273,7 +8255,15 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans'))
"cost": 43.26,
"chosen": true
}
]
],
"chosen_access_method":
{
"type": "scan",
"records": 804.69,
"cost": 43.26,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 804.69,
"cost_for_plan": 204.2,
......
......@@ -207,18 +207,29 @@ explain select * from t1 where a=1 or b=1 {
"best_access_path": {
"considered_access_paths": [
{
"access_type": "range",
"access_type": "index_merge",
"resulting_rows": 2,
"cost": 4.1484,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "index_merge",
"records": 2,
"cost": 4.1484,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 2,
"cost_for_plan": 4.5484
"cost_for_plan": 4.5484,
"estimated_join_cardinality": 2
}
]
},
{
"best_join_order": ["t1"]
},
{
"attaching_conditions_to_tables": {
"original_condition": "t1.a = 1 or t1.b = 1",
......
......@@ -208,13 +208,24 @@ explain select * from t1 where pk1 != 0 and key1 = 1 {
"chosen": false,
"cause": "cost"
}
]
],
"chosen_access_method": {
"type": "ref",
"records": 1,
"cost": 2,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 1,
"cost_for_plan": 2.2
"cost_for_plan": 2.2,
"estimated_join_cardinality": 1
}
]
},
{
"best_join_order": ["t1"]
},
{
"attaching_conditions_to_tables": {
"original_condition": "t1.key1 = 1 and t1.pk1 <> 0",
......
......@@ -98,13 +98,24 @@ select * from db1.t1 {
"cost": 2.0051,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 3,
"cost": 2.0051,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 3,
"cost_for_plan": 2.6051
"cost_for_plan": 2.6051,
"estimated_join_cardinality": 3
}
]
},
{
"best_join_order": ["t1"]
},
{
"attaching_conditions_to_tables": {
"original_condition": null,
......@@ -211,13 +222,24 @@ select * from db1.v1 {
"cost": 2.0051,
"chosen": true
}
]
],
"chosen_access_method": {
"type": "scan",
"records": 3,
"cost": 2.0051,
"uses_join_buffering": false,
"filter_used": false
}
},
"rows_for_plan": 3,
"cost_for_plan": 2.6051
"cost_for_plan": 2.6051,
"estimated_join_cardinality": 3
}
]
},
{
"best_join_order": ["t1"]
},
{
"attaching_conditions_to_tables": {
"original_condition": null,
......
......@@ -630,6 +630,45 @@ void add_table_scan_values_to_trace(THD *thd, JOIN_TAB *tab)
table_rec.add("rows", tab->found_records)
.add("cost", tab->read_time);
}
/*
Print the join order of all the tables for top level select.
For example:
select * from ot1
where ot1.a IN (select it1.a from it1, it2 where it1.b=it2.a);
So this function would print
ot1, <subquery2> ----> For select #1
*/
void print_final_join_order(JOIN *join)
{
Json_writer_object join_order(join->thd);
Json_writer_array best_order(join->thd, "best_join_order");
JOIN_TAB *j;
uint i;
for (j= join->join_tab,i=0 ; i < join->top_join_tab_count;
i++, j++)
best_order.add_table_name(j);
}
void print_best_access_for_table(THD *thd, POSITION *pos,
enum join_type type)
{
Json_writer_object trace_best_access(thd, "chosen_access_method");
trace_best_access.add("type", type == JT_ALL ? "scan" :
join_type_str[type]);
trace_best_access.add("records", pos->records_read);
trace_best_access.add("cost", pos->read_time);
trace_best_access.add("uses_join_buffering", pos->use_join_buffer);
trace_best_access.add("filter_used",
pos->range_rowid_filter_info != NULL);
}
/*
Introduce enum_query_type flags parameter, maybe also allow
EXPLAIN also use this function.
......
......@@ -105,6 +105,9 @@ void opt_trace_print_expanded_query(THD *thd, SELECT_LEX *select_lex,
Json_writer_object *trace_object);
void add_table_scan_values_to_trace(THD *thd, JOIN_TAB *tab);
void print_final_join_order(JOIN *join);
void print_best_access_for_table(THD *thd, POSITION *pos,
enum join_type type);
/*
Security related (need to add a proper comment here)
......
......@@ -7203,6 +7203,7 @@ best_access_path(JOIN *join,
SplM_plan_info *spl_plan= 0;
Range_rowid_filter_cost_info *filter= 0;
const char* cause= NULL;
enum join_type best_type= JT_UNKNOWN, type= JT_UNKNOWN;
disable_jbuf= disable_jbuf || idx == join->const_tables;
......@@ -7342,7 +7343,8 @@ best_access_path(JOIN *join,
*/
tmp= prev_record_reads(join->positions, idx, found_ref);
records= 1.0;
trace_access_idx.add("access_type", "fulltext")
type= JT_FT;
trace_access_idx.add("access_type", join_type_str[type])
.add("index", keyinfo->name);
}
else
......@@ -7365,14 +7367,16 @@ best_access_path(JOIN *join,
(!(key_flags & HA_NULL_PART_KEY) || // (2)
all_key_parts == notnull_part)) // (3)
{
trace_access_idx.add("access_type", "eq_ref")
type= JT_EQ_REF;
trace_access_idx.add("access_type", join_type_str[type])
.add("index", keyinfo->name);
tmp = prev_record_reads(join->positions, idx, found_ref);
records=1.0;
}
else
{
trace_access_idx.add("access_type", "ref")
type= JT_REF;
trace_access_idx.add("access_type", join_type_str[type])
.add("index", keyinfo->name);
if (!found_ref)
{ /* We found a const key */
......@@ -7467,8 +7471,8 @@ best_access_path(JOIN *join,
}
else
{
trace_access_idx.add("access_type",
ref_or_null_part ? "ref_or_null" : "ref")
type = ref_or_null_part ? JT_REF_OR_NULL : JT_REF;
trace_access_idx.add("access_type", join_type_str[type])
.add("index", keyinfo->name);
/*
Use as much key-parts as possible and a uniq key is better
......@@ -7683,6 +7687,7 @@ best_access_path(JOIN *join,
best_max_key_part= max_key_part;
best_ref_depends_map= found_ref;
best_filter= filter;
best_type= type;
}
else
{
......@@ -7736,6 +7741,7 @@ best_access_path(JOIN *join,
best_ref_depends_map= 0;
best_uses_jbuf= TRUE;
best_filter= 0;
best_type= JT_HASH;
trace_access_hash.add("type", "hash");
trace_access_hash.add("index", "hj-key");
trace_access_hash.add("cost", rnd_records);
......@@ -7799,10 +7805,6 @@ best_access_path(JOIN *join,
filter= 0;
if (s->quick)
{
trace_access_scan.add("access_type", "range");
/*
should have some info about all the different QUICK_SELECT
*/
/*
For each record we:
- read record range through 'quick'
......@@ -7828,23 +7830,29 @@ best_access_path(JOIN *join,
{
tmp-= filter->get_adjusted_gain(rows);
DBUG_ASSERT(tmp >= 0);
}
}
type= JT_RANGE;
}
else
{
type= JT_INDEX_MERGE;
best_filter= 0;
}
loose_scan_opt.check_range_access(join, idx, s->quick);
}
else
{
trace_access_scan.add("access_type", "scan");
/* Estimate cost of reading table. */
if (s->table->force_index && !best_key) // index scan
{
type= JT_NEXT;
tmp= s->table->file->read_time(s->ref.key, 1, s->records);
}
else // table scan
{
tmp= s->scan_time();
type= JT_ALL;
}
if ((s->table->map & join->outer_join) || disable_jbuf) // Can't use join cache
{
......@@ -7874,6 +7882,9 @@ best_access_path(JOIN *join,
}
}
trace_access_scan.add("access_type", type == JT_ALL ?
"scan" :
join_type_str[type]);
/* Splitting technique cannot be used with join cache */
if (s->table->is_splittable())
tmp+= s->table->get_materialization_cost();
......@@ -7913,6 +7924,7 @@ best_access_path(JOIN *join,
best_uses_jbuf= MY_TEST(!disable_jbuf && !((s->table->map &
join->outer_join)));
spl_plan= 0;
best_type= type;
}
trace_access_scan.add("chosen", best_key == NULL);
}
......@@ -7944,6 +7956,11 @@ best_access_path(JOIN *join,
trace_access_scan.add("use_tmp_table", true);
join->sort_by_table= (TABLE*) 1; // Must use temporary table
}
trace_access_scan.end();
trace_paths.end();
if (unlikely(thd->trace_started()))
print_best_access_for_table(thd, pos, best_type);
DBUG_VOID_RETURN;
}
......@@ -9484,6 +9501,8 @@ best_extension_by_limited_search(JOIN *join,
Hence it may be wrong.
*/
current_read_time= COST_ADD(current_read_time, current_record_count);
trace_one_table.add("estimated_join_cardinality",
partial_join_cardinality);
if (current_read_time < join->best_read)
{
memcpy((uchar*) join->best_positions, (uchar*) join->positions,
......@@ -10305,6 +10324,9 @@ bool JOIN::get_best_combination()
top_join_tab_count= (uint)(join_tab_ranges.head()->end -
join_tab_ranges.head()->start);
if (unlikely(thd->trace_started()))
print_final_join_order(this);
update_depend_map(this);
DBUG_RETURN(0);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment