mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Split cost calculations into fetch and total
This patch causes no changes in costs or result files. Changes: - Store row compare cost separately in Cost_estimate::comp_cost - Store cost of fetching rows separately in OPT_RANGE - Use range->fetch_cost instead of adjust_quick_cost(total_cost) This was done to simplify cost calculation in sql_select.cc: - We can use range->fetch_cost directly without having to call adjust_quick_cost(). adjust_quick_cost() is now removed. Other things: - Removed some not used functions in Cost_estimate
This commit is contained in:
@@ -11764,7 +11764,9 @@ ha_rows check_quick_select(PARAM *param, uint idx, bool index_only,
|
||||
param->table->opt_range_condition_rows=
|
||||
MY_MIN(param->table->opt_range_condition_rows, rows);
|
||||
range->rows= rows;
|
||||
range->cost= cost->total_cost();
|
||||
range->fetch_cost= cost->fetch_cost();
|
||||
/* Same as total cost */
|
||||
range->cost= range->fetch_cost + cost->compare_cost();
|
||||
if (param->table->file->is_clustering_key(keynr))
|
||||
range->index_only_cost= 0;
|
||||
else
|
||||
|
Reference in New Issue
Block a user