Commit 38ed782f authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-30812 fixup: GCC 12.2.0 -Wmaybe-uninitialized

best_access_path(): Simplify the logic for computing fanout.
This fixes up commit 4329ec5d
parent 522a5249
......@@ -8531,9 +8531,10 @@ best_access_path(JOIN *join,
fanout= hash_join_fanout(join, s, remaining_tables, rnd_records,
hj_start_key, &stats_found);
join_sel= 1.0; // Don't do the "10% heuristic"
if (stats_found)
goto fanout_computed;
}
if (!stats_found)
{
/*
No OPTIMIZER_SWITCH_HASH_JOIN_CARDINALITY or no field statistics
found.
......@@ -8548,8 +8549,8 @@ best_access_path(JOIN *join,
rnd_records= use_found_constraint(rnd_records);
fanout= rnd_records;
join_sel= 0.1;
}
fanout_computed:
tmp= s->quick ? s->quick->read_time : s->scan_time();
double cmp_time= (s->records - rnd_records)/TIME_FOR_COMPARE;
tmp= COST_ADD(tmp, cmp_time);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment