mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Fixed a cost estimation bug introduced into in the function best_access_path
of the 5.3 code line after a merge with 5.2 on 2010-10-28 in order not to allow the cost to access a joined table to be equal to 0 ever. Expanded data sets for many test cases to get the same execution plans as before.
This commit is contained in:
@ -5177,7 +5177,7 @@ best_access_path(JOIN *join,
|
||||
tmp= table->file->keyread_time(key, 1, (ha_rows) tmp);
|
||||
else
|
||||
tmp= table->file->read_time(key, 1,
|
||||
(ha_rows) min(tmp,s->worst_seeks)-1);
|
||||
(ha_rows) min(tmp,s->worst_seeks));
|
||||
tmp*= record_count;
|
||||
}
|
||||
}
|
||||
@ -5341,13 +5341,14 @@ best_access_path(JOIN *join,
|
||||
tmp= table->file->keyread_time(key, 1, (ha_rows) tmp);
|
||||
else
|
||||
tmp= table->file->read_time(key, 1,
|
||||
(ha_rows) min(tmp,s->worst_seeks)-1);
|
||||
(ha_rows) min(tmp,s->worst_seeks));
|
||||
tmp*= record_count;
|
||||
}
|
||||
else
|
||||
tmp= best_time; // Do nothing
|
||||
}
|
||||
|
||||
DBUG_ASSERT(tmp > 0 || record_count == 0);
|
||||
tmp += s->startup_cost;
|
||||
loose_scan_opt.check_ref_access_part2(key, start_key, records, tmp);
|
||||
} /* not ft_key */
|
||||
|
Reference in New Issue
Block a user