深入MySQL--谈谈MySQL 8.0新特性
本帖最后由 lee 于 2020-9-9 23:54 编辑今天翻看MySQL8.0的官方文档的时候,看到了MySQL8.0的几个新特性,简单测了下,跟MySQL5.7做了下对比,测试的结果如下:
1、数据字典使用事务性质的表来代替之前非事务性质的表,以MySQL8.0.19和MySQL5.7.16为例,我们可以看下这两个版本的数据字典mysql库里面的相关表的存储引擎。
MySQL5.7.16
+--------------------+---------------------------------------+--------+
| mysql | columns_priv | MyISAM |
| mysql | db | MyISAM |
| mysql | engine_cost | InnoDB |
| mysql | event | MyISAM |
| mysql | func | MyISAM |
| mysql | general_log | CSV |
| mysql | gtid_executed | InnoDB |
| mysql | help_category | InnoDB |
| mysql | help_keyword | InnoDB |
| mysql | help_relation | InnoDB |
| mysql | help_topic | InnoDB |
| mysql | innodb_index_stats | InnoDB |
| mysql | innodb_table_stats | InnoDB |
| mysql | ndb_binlog_index | MyISAM |
| mysql | plugin | InnoDB |
| mysql | proc | MyISAM |
| mysql | procs_priv | MyISAM |
| mysql | proxies_priv | MyISAM |
| mysql | server_cost | InnoDB |
| mysql | servers | InnoDB |
| mysql | slave_master_info | InnoDB |
| mysql | slave_relay_log_info | InnoDB |
| mysql | slave_worker_info | InnoDB |
| mysql | slow_log | CSV |
| mysql | tables_priv | MyISAM |
| mysql | time_zone | InnoDB |
| mysql | time_zone_leap_second | InnoDB |
| mysql | time_zone_name | InnoDB |
| mysql | time_zone_transition | InnoDB |
| mysql | time_zone_transition_type | InnoDB |
| mysql | user | MyISAM |
+--------------------+---------------------------------------+--------+
MySQL8.0.19版本:
| mysql | columns_priv | InnoDB |
| mysql | component | InnoDB |
| mysql | db | InnoDB |
| mysql | default_roles | InnoDB |
| mysql | engine_cost | InnoDB |
| mysql | func | InnoDB |
| mysql | general_log | CSV |
| mysql | global_grants | InnoDB |
| mysql | gtid_executed | InnoDB |
| mysql | help_category | InnoDB |
| mysql | help_keyword | InnoDB |
| mysql | help_relation | InnoDB |
| mysql | help_topic | InnoDB |
| mysql | innodb_index_stats | InnoDB |
| mysql | innodb_table_stats | InnoDB |
| mysql | password_history | InnoDB |
| mysql | plugin | InnoDB |
| mysql | procs_priv | InnoDB |
| mysql | proxies_priv | InnoDB |
| mysql | role_edges | InnoDB |
| mysql | server_cost | InnoDB |
| mysql | servers | InnoDB |
| mysql | slave_master_info | InnoDB |
| mysql | slave_relay_log_info | InnoDB |
| mysql | slave_worker_info | InnoDB |
| mysql | slow_log | CSV |
| mysql | tables_priv | InnoDB |
| mysql | time_zone | InnoDB |
| mysql | time_zone_leap_second | InnoDB |
| mysql | time_zone_name | InnoDB |
| mysql | time_zone_transition | InnoDB |
| mysql | time_zone_transition_type | InnoDB |
| mysql | user | InnoDB |
+--------------------+---------------------------------------+--------+
可以看到,MySQL8.0.19版本中,除了slow_log和general_log表使用了CVS的存储引擎,其他表都采用Innodb的存储引擎,而MySQL5.7.16版本中的字典表还有很多都采用了MyISAM存储引擎,因为innodb表是事务安全的,支持crash_safe故障自愈,而MyISAM表不支持事务,所以从元数据的安全性来讲,MySQL8.0.19版本的元数据安全性要更好。
**** Hidden Message ***** 谢谢分享
页:
[1]