diff options
author | Monty <monty@mariadb.org> | 2022-04-05 20:12:29 +0300 |
---|---|---|
committer | Sergei Petrunia <sergey@mariadb.com> | 2023-02-02 21:44:00 +0300 |
commit | 5e651c9aea1234c7ee83c38761af251872960335 (patch) | |
tree | 029f20adfa664e0d6a749f71dd4d5e048456a0f6 /sql/ha_partition.cc | |
parent | b6215b9b20b55911ca06c4cee1fa6ebdd4e8e1eb (diff) | |
download | mariadb-git-5e651c9aea1234c7ee83c38761af251872960335.tar.gz |
Make the most important optimizer constants user variables
Variables added:
- optimizer_index_block_copy_cost
- optimizer_key_copy_cost
- optimizer_key_next_find_cost
- optimizer_key_compare_cost
- optimizer_row_copy_cost
- optimizer_where_compare_cost
Some rename of defines was done to make the internal defines similar to
the visible ones:
TIME_FOR_COMPARE -> WHERE_COST; WHERE_COST was also "inverted" to be
a number between 0 and 1 that is multiply with accepted records
(similar to other optimizer variables).
TIME_FOR_COMPARE_IDX -> KEY_COMPARE_COST. This is also inverted,
similar to TIME_FOR_COMPARE.
TIME_FOR_COMPARE_ROWID -> ROWID_COMPARE_COST. This is also inverted,
similar to TIME_FOR_COMPARE.
All default costs are identical to what they where before this patch.
Other things:
- Compare factor in get_merge_buffers_cost() was inverted.
- Changed namespace to static in filesort_utils.cc
Diffstat (limited to 'sql/ha_partition.cc')
-rw-r--r-- | sql/ha_partition.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index a984dea8836..35fb6be53b7 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -12145,6 +12145,15 @@ ha_partition::can_convert_nocopy(const Field &field, return true; } +void ha_partition::set_optimizer_costs(THD *thd) +{ + handler::set_optimizer_costs(thd); + for (uint i= bitmap_get_first_set(&m_part_info->read_partitions); + i < m_tot_parts; + i= bitmap_get_next_set(&m_part_info->read_partitions, i)) + m_file[i]->set_optimizer_costs(thd); +} + struct st_mysql_storage_engine partition_storage_engine= { MYSQL_HANDLERTON_INTERFACE_VERSION }; |