1. 程式人生 > 實用技巧 >mysql 8.0.20優化器成本記錄表

mysql 8.0.20優化器成本記錄表

mysql> select * from engine_cost;
+-------------+-------------+------------------------+------------+---------------------+---------+---------------+
| engine_name | device_type | cost_name              | cost_value | last_update         | comment | default_value |
+-------------+-------------+------------------------+------------+---------------------+---------+---------------+
| default     |           0
| io_block_read_cost | NULL | 2020-12-08 21:53:01 | NULL | 1 | | default | 0 | memory_block_read_cost | NULL | 2020-12-08 21:53:01 | NULL | 0.25 | +-------------+-------------+------------------------+------------+---------------------+---------+---------------+ 2
rows in set (0.00 sec) mysql> show create table engine_cost\G *************************** 1. row *************************** Table: engine_cost Create Table: CREATE TABLE `engine_cost` ( `engine_name` varchar(64) NOT NULL, `device_type` int NOT NULL, `cost_name` varchar(64) NOT NULL, `cost_value`
float DEFAULT NULL, `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `comment` varchar(1024) DEFAULT NULL, `default_value` float GENERATED ALWAYS AS ((case `cost_name` when _utf8mb3'io_block_read_cost' then 1.0 when _utf8mb3'memory_block_read_cost' then 0.25 else NULL end)) VIRTUAL, PRIMARY KEY (`cost_name`,`engine_name`,`device_type`) ) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 ROW_FORMAT=DYNAMIC 1 row in set (0.00 sec) mysql> select * from server_cost; +------------------------------+------------+---------------------+---------+---------------+ | cost_name | cost_value | last_update | comment | default_value | +------------------------------+------------+---------------------+---------+---------------+ | disk_temptable_create_cost | NULL | 2020-12-08 21:53:01 | NULL | 20 | | disk_temptable_row_cost | NULL | 2020-12-08 21:53:01 | NULL | 0.5 | | key_compare_cost | NULL | 2020-12-08 21:53:01 | NULL | 0.05 | | memory_temptable_create_cost | NULL | 2020-12-08 21:53:01 | NULL | 1 | | memory_temptable_row_cost | NULL | 2020-12-08 21:53:01 | NULL | 0.1 | | row_evaluate_cost | NULL | 2020-12-08 21:53:01 | NULL | 0.1 | +------------------------------+------------+---------------------+---------+---------------+ 6 rows in set (0.00 sec) mysql> show create table server_cost\G *************************** 1. row *************************** Table: server_cost Create Table: CREATE TABLE `server_cost` ( `cost_name` varchar(64) NOT NULL, `cost_value` float DEFAULT NULL, `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `comment` varchar(1024) DEFAULT NULL, `default_value` float GENERATED ALWAYS AS ((case `cost_name` when _utf8mb3'disk_temptable_create_cost' then 20.0 when _utf8mb3'disk_temptable_row_cost' then 0.5 when _utf8mb3'key_compare_cost' then 0.05 when _utf8mb3'memory_temptable_create_cost' then 1.0 when _utf8mb3'memory_temptable_row_cost' then 0.1 when _utf8mb3'row_evaluate_cost' then 0.1 else NULL end)) VIRTUAL, PRIMARY KEY (`cost_name`) ) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 ROW_FORMAT=DYNAMIC 1 row in set (0.01 sec)