summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2022-11-24 14:08:31 +0200
committerSergei Golubchik <serg@mariadb.org>2022-12-25 17:59:04 +0100
commit803745098ab0b94764956ade2fc2dd565dea1e11 (patch)
tree5f9d36ed6b701098e30564c6d20a724d4b2c0f15
parent8d241abbff910730183876e10170260f05e72011 (diff)
downloadmariadb-git-803745098ab0b94764956ade2fc2dd565dea1e11.tar.gz
Added range_index to 'range' optimizer_trace output
Other things: - Renamed "rowid_filter_key" to "rowid_filter_index" to keep things consistent
-rw-r--r--sql/opt_trace.cc2
-rw-r--r--sql/sql_select.cc8
2 files changed, 7 insertions, 3 deletions
diff --git a/sql/opt_trace.cc b/sql/opt_trace.cc
index d7b3d83bb18..406e867c2e9 100644
--- a/sql/opt_trace.cc
+++ b/sql/opt_trace.cc
@@ -703,7 +703,7 @@ void print_best_access_for_table(THD *thd, POSITION *pos)
if (pos->range_rowid_filter_info)
{
uint key_no= pos->range_rowid_filter_info->get_key_no();
- obj.add("rowid_filter_key",
+ obj.add("rowid_filter_index",
pos->table->table->key_info[key_no].name);
}
}
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 9abda96c1f5..c0991e66cf3 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -7992,7 +7992,7 @@ apply_filter(THD *thd, TABLE *table, ALL_READ_COST *cost,
if (unlikely(thd->trace_started()))
{
Json_writer_object trace_filter(thd, "filter");
- trace_filter.add("rowid_filter_key",
+ trace_filter.add("rowid_filter_index",
table->key_info[get_key_no()].name).
add("index_only_cost", file->cost(cost->index_cost)).
add("filter_startup_cost", filter_startup_cost).
@@ -9108,7 +9108,11 @@ best_access_path(JOIN *join,
{
trace_access_scan.
add("access_type",
- type == JT_ALL ? scan_type : join_type_str[type]).
+ type == JT_ALL ? scan_type : join_type_str[type]);
+ if (type == JT_RANGE)
+ trace_access_scan.
+ add("range_index", table->key_info[s->quick->index].name);
+ trace_access_scan.
add("rows", org_records).
add("rows_after_filter", records_after_filter).
add("rows_out", best.records_out).