summaryrefslogtreecommitdiff
path: root/storage/myisam
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2022-08-11 13:05:23 +0300
committerMonty <monty@mariadb.org>2022-08-12 00:47:48 +0300
commit07ffb3abc1004a102c2c605c7c280913741d5d87 (patch)
tree17dc111061e19f94c8378962f3e2952197366f03 /storage/myisam
parent0352e855f1be0e440eb9b7dbd8c6b42151252b88 (diff)
downloadmariadb-git-07ffb3abc1004a102c2c605c7c280913741d5d87.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 'storage/myisam')
-rw-r--r--storage/myisam/ha_myisam.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/storage/myisam/ha_myisam.h b/storage/myisam/ha_myisam.h
index 3843004cc6e..6ceabd8d9c5 100644
--- a/storage/myisam/ha_myisam.h
+++ b/storage/myisam/ha_myisam.h
@@ -102,6 +102,17 @@ class ha_myisam final : public handler
int remember_rnd_pos();
int restart_rnd_next(uchar *buf);
void position(const uchar *record);
+ void optimizer_costs_updated()
+ {
+#ifdef QQQQ
+ /*
+ MyISAM row lookup costs are slow as the row data is on a not cached file.
+ The following number was found by check_costs.pl when using 1M rows
+ and all rows are cached
+ */
+ optimizer_row_lookup_cost*= 3.0;
+#endif
+ }
int info(uint);
int extra(enum ha_extra_function operation);
int extra_opt(enum ha_extra_function operation, ulong cache_size);