diff options
author | Monty <monty@mariadb.org> | 2022-08-11 13:05:23 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2022-08-12 00:47:48 +0300 |
commit | 07ffb3abc1004a102c2c605c7c280913741d5d87 (patch) | |
tree | 17dc111061e19f94c8378962f3e2952197366f03 /sql/sql_class.h | |
parent | 0352e855f1be0e440eb9b7dbd8c6b42151252b88 (diff) | |
download | mariadb-git-10.7-selectivity-old.tar.gz |
TEMPORARY PUSH: Changing all cost calculation to be given in ms10.7-selectivity-old
- Added tests/check_costs.pl, a tool to verify optimizer cost calculations.
- Most costs has been found with this program. All steps to calculate
the new costs are documented in Docs/optimizer.costs
- User optimizer_cost variables are given in usec (as individual
costs can be very small). Internally they are stored in ms.
- Changed DISK_READ_COST (was DISK_SEEK_BASE_COST) from a hard disk cost
(9 ms) to common SSD cost (400MB/sec).
- Changed the following handler functions to return IO_AND_CPU_COST.
This makes it easy to apply different cost modifiers in ha_..time()
functions for io and cpu costs.
- scan_time()
- rndpos_time()
- keyread_time()
- Enhanched keyread_time() to calculate the full cost of reading of a set
of keys with a given number of ranges and optionall number of blocks that
need to be accessed.
- Removed read_time() as keyread_time() + rndpos_time() is the same thing.
- Added the following new optimizer_variables:
- optimizer_scan_lookup_cost
- optimizer_row_lookup_cost
- optimizer_index_lookup_cost
- optimizer_disk_read_cost
- Added include/my_tracker.h ; Useful include file to quickly test costs
of a function.
- Tuned sequence and heap engine costs (rest will be done in an updated
commit)
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r-- | sql/sql_class.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h index 03c7fb6a847..b0bbf1c7230 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -683,9 +683,13 @@ typedef struct system_variables ulonglong slave_skip_counter; ulonglong max_relay_log_size; - double optimizer_index_block_copy_cost, optimizer_index_next_find_cost; + double optimizer_cache_hit_ratio; // Stored in handler::optimizer_cache_cost + double optimizer_index_block_copy_cost; + double optimizer_row_next_find_cost, optimizer_index_next_find_cost; double optimizer_row_copy_cost, optimizer_key_copy_cost; - double optimizer_where_cmp_cost, optimizer_key_cmp_cost; + double optimizer_where_cost, optimizer_key_cmp_cost; + double optimizer_row_lookup_cost, optimizer_index_lookup_cost; + double optimizer_scan_lookup_cost,optimizer_disk_read_cost; double long_query_time_double, max_statement_time_double; double sample_percentage; @@ -783,7 +787,6 @@ typedef struct system_variables uint group_concat_max_len; uint eq_range_index_dive_limit; - uint optimizer_cache_hit_ratio; // Stored in handler::optimizer_cache_cost uint idle_transaction_timeout; uint idle_readonly_transaction_timeout; uint idle_write_transaction_timeout; @@ -857,6 +860,7 @@ typedef struct system_variables uint wsrep_sync_wait; vers_asof_timestamp_t vers_asof_timestamp; + uint64 optimizer_cost_version; } SV; /** |