Skip to content

Commit 87507bb

Browse files
spetruniamontywi
authored andcommitted
Optimizer Trace: make plan_prefix not show const/eliminated tables
1 parent 2010cfa commit 87507bb

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

mysql-test/main/opt_trace.result

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2701,7 +2701,7 @@ select t1.a from t1 left join t2 on t1.a=t2.a {
27012701
{
27022702
"considered_execution_plans": [
27032703
{
2704-
"plan_prefix": "t2",
2704+
"plan_prefix": "",
27052705
"get_costs_for_tables": [
27062706
{
27072707
"best_access_path": {
@@ -2732,7 +2732,7 @@ select t1.a from t1 left join t2 on t1.a=t2.a {
27322732
]
27332733
},
27342734
{
2735-
"plan_prefix": "t2",
2735+
"plan_prefix": "",
27362736
"table": "t1",
27372737
"rows_for_plan": 4,
27382738
"cost_for_plan": 0.01066122
@@ -3108,7 +3108,7 @@ explain select t1.a from t1 left join (t2 join t3 on t2.b=t3.b) on t2.a=t1.a and
31083108
{
31093109
"considered_execution_plans": [
31103110
{
3111-
"plan_prefix": "t3,t2",
3111+
"plan_prefix": "",
31123112
"get_costs_for_tables": [
31133113
{
31143114
"best_access_path": {
@@ -3139,7 +3139,7 @@ explain select t1.a from t1 left join (t2 join t3 on t2.b=t3.b) on t2.a=t1.a and
31393139
]
31403140
},
31413141
{
3142-
"plan_prefix": "t3,t2",
3142+
"plan_prefix": "",
31433143
"table": "t1",
31443144
"rows_for_plan": 4,
31453145
"cost_for_plan": 0.01066122

sql/opt_trace.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ void trace_plan_prefix(Json_writer_object *jsobj, JOIN *join, uint idx,
658658

659659
String prefix_str;
660660
prefix_str.length(0);
661-
for (uint i= 0; i < idx; i++)
661+
for (uint i= join->const_tables; i < idx; i++)
662662
{
663663
TABLE_LIST *const tr= join->positions[i].table->tab_list;
664664
if (!(tr->map & join_tables))

0 commit comments

Comments
 (0)