Skip to content

Commit

Permalink
MDEV-18479: Avoid COST_MULT(records, 1)
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Jun 11, 2019
1 parent 96ee9ea commit 7a7d990
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions sql/sql_select.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3856,11 +3856,8 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list,
table/view.
*/
for (i= 0; i < join->table_count ; i++)
{
records= COST_MULT(records,
join->best_positions[i].records_read ?
join->best_positions[i].records_read : 1);
}
if (double rr= join->best_positions[i].records_read)
records= COST_MULT(records, rr);
ha_rows rows= records > HA_ROWS_MAX ? HA_ROWS_MAX : (ha_rows) records;
set_if_smaller(rows, unit->select_limit_cnt);
join->select_lex->increase_derived_records(rows);
Expand Down

0 comments on commit 7a7d990

Please sign in to comment.