1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Fixed LP bug #754521.

The function test_quick_select by mistake did not update the value
of table->quick_condition_rows for index intersection scans though
the specification explicitly required to do so from any table access
plan once the plan provided a better upper bound for the number of
rows selected from the table. It resulted in a bogus, usually very
big number saved as the cost of the table access. This, in its turn,
in many cases forced the optimizer to make a bad choice of the
execution plan for join queries.
This commit is contained in:
Igor Babaev
2011-04-27 15:29:46 -07:00
parent 24edac2211
commit 1556a136ac
4 changed files with 28 additions and 1 deletions

View File

@ -3116,7 +3116,9 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
best_read_time)))
{
best_trp= intersect_trp;
best_read_time= best_trp->read_cost;
best_read_time= best_trp->read_cost;
set_if_smaller(param.table->quick_condition_rows,
intersect_trp->records);
}
}