mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
Remove rows and cost from optimizer trace for not usable key parts
This commit is contained in:
@@ -9417,8 +9417,6 @@ S
|
|||||||
{
|
{
|
||||||
"access_type": "ref",
|
"access_type": "ref",
|
||||||
"index": "PRIMARY",
|
"index": "PRIMARY",
|
||||||
"rows": 1.79769e308,
|
|
||||||
"cost": 1.79769e308,
|
|
||||||
"chosen": false,
|
"chosen": false,
|
||||||
"cause": "no predicate for first keypart"
|
"cause": "no predicate for first keypart"
|
||||||
}
|
}
|
||||||
|
@@ -8085,7 +8085,6 @@ best_access_path(JOIN *join,
|
|||||||
SplM_plan_info *spl_plan= 0;
|
SplM_plan_info *spl_plan= 0;
|
||||||
table_map spl_pd_boundary= 0;
|
table_map spl_pd_boundary= 0;
|
||||||
Range_rowid_filter_cost_info *filter= 0;
|
Range_rowid_filter_cost_info *filter= 0;
|
||||||
const char* cause= NULL;
|
|
||||||
enum join_type best_type= JT_UNKNOWN, type= JT_UNKNOWN;
|
enum join_type best_type= JT_UNKNOWN, type= JT_UNKNOWN;
|
||||||
|
|
||||||
disable_jbuf= disable_jbuf || idx == join->const_tables;
|
disable_jbuf= disable_jbuf || idx == join->const_tables;
|
||||||
@@ -8113,6 +8112,7 @@ best_access_path(JOIN *join,
|
|||||||
TABLE *table= s->table;
|
TABLE *table= s->table;
|
||||||
double best_records= DBL_MAX;
|
double best_records= DBL_MAX;
|
||||||
uint max_key_part=0;
|
uint max_key_part=0;
|
||||||
|
const char *cause= NULL;
|
||||||
|
|
||||||
/* Test how we can use keys */
|
/* Test how we can use keys */
|
||||||
rec= s->records/MATCHING_ROWS_IN_OTHER_TABLE; // Assumed records/key
|
rec= s->records/MATCHING_ROWS_IN_OTHER_TABLE; // Assumed records/key
|
||||||
@@ -8661,7 +8661,9 @@ best_access_path(JOIN *join,
|
|||||||
table->key_info[filter->key_no].name);
|
table->key_info[filter->key_no].name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
trace_access_idx.add("rows", records).add("cost", tmp);
|
|
||||||
|
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/TIME_FOR_COMPARE)
|
||||||
{
|
{
|
||||||
@@ -8680,7 +8682,6 @@ best_access_path(JOIN *join,
|
|||||||
trace_access_idx.add("chosen", false)
|
trace_access_idx.add("chosen", false)
|
||||||
.add("cause", cause ? cause : "cost");
|
.add("cause", cause ? cause : "cost");
|
||||||
}
|
}
|
||||||
cause= NULL;
|
|
||||||
} /* for each key */
|
} /* for each key */
|
||||||
records= best_records;
|
records= best_records;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user