Skip to content

Commit 996e7fd

Browse files
committed
Avoid printing "rowid_filter_skipped" in optimizer trace if no rowid filter
There is no point in saying something is skipped when it does not exists.
1 parent 504cfa4 commit 996e7fd

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

mysql-test/main/opt_trace.result

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4134,7 +4134,6 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 {
41344134
"rec_per_key_stats_missing": true,
41354135
"used_range_estimates": false,
41364136
"cause": "not better than ref estimates",
4137-
"rowid_filter_skipped": "worst/max seeks clipping",
41384137
"rows": 2,
41394138
"cost": 3.003514767,
41404139
"chosen": true

sql/sql_select.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8704,8 +8704,11 @@ best_access_path(JOIN *join,
87048704
if (!(records < s->worst_seeks &&
87058705
records <= thd->variables.max_seeks_for_key))
87068706
{
8707-
// Don't use rowid filter
8708-
trace_access_idx.add("rowid_filter_skipped", "worst/max seeks clipping");
8707+
if (table->range_rowid_filter_cost_info_elems)
8708+
{
8709+
// Don't use rowid filter
8710+
trace_access_idx.add("rowid_filter_skipped", "worst/max seeks clipping");
8711+
}
87098712
filter= NULL;
87108713
}
87118714
else

0 commit comments

Comments
 (0)