Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.6, 11.2(EOL)
Description
As pointed out by monty :
best_access_path doesn't multiply correctly:
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
|
index 86f51917f50..dcf0281f60d 100644
|
--- a/sql/sql_select.cc
|
+++ b/sql/sql_select.cc
|
@@ -8723,10 +8723,10 @@ best_access_path(JOIN *join,
|
if (!cause)
|
trace_access_idx.add("rows", records).add("cost", tmp);
|
|
- if (tmp + 0.0001 < best_time - records/TIME_FOR_COMPARE)
|
+ if (tmp + 0.0001 < best_time - (records*record_count)/TIME_FOR_COMPARE)
|
{
|
trace_access_idx.add("chosen", true);
|
- best_time= COST_ADD(tmp, records/TIME_FOR_COMPARE);
|
+ best_time= COST_ADD(tmp, (records*record_count)/TIME_FOR_COMPARE);
|
best= tmp;
|
best_records= records;
|
best_key= start_key; |
(running mtr with this in 10.6 produces one changed explain in subselect_sj2_mat. It is not clear what that shows).