Details
-
Task
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
Description
For joins, best_access_path object can have printouts like this:
{
|
"access_type": "ref",
|
"index": "PRIMARY",
|
"rows": 1.79769e308,
|
"cost": 1.79769e308,
|
"chosen": false,
|
"cause": "no predicate for first keypart"
|
},
|
I think these should be removed as they don't have any value.
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index a6aee4db3416..011dd26d42d7 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -7761,11 +7761,7 @@ best_access_path(JOIN *join,
tmp= COST_MULT(tmp, record_count);
}
else
- {
- if (!(found_part & 1))
- cause= "no predicate for first keypart";
tmp= best_time; // Do nothing
- }
}
Well, this will just change
"cause": "no predicate for first keypart"
to
"cause": "cost"
but will still print the index being considered (actually not).
I've tried to make the code to avoid printing the whole object, i.e.
{
"access_type": "ref",
"index": "PRIMARY",
"rows": 1.79769e308,
"cost": 1.79769e308,
"chosen": false,
"cause": "no predicate for first keypart"
},
but this is hard to do as ref access code has some side effects (changes in found_constraint and Loose_scan_opt). Considering this, it's better not to make this change now.