MySQL 5.6, new features in 5.7, 8.0 version of the summary Daquan

MySQL 5.6

1) Support GTID copy

2) Support lossless copy

3) Support delayed replication

4) Support level of replication-based parallel libraries

5) .mysqlbinlog command supports remote backup binlog

6). For TIME, DATETIME and TIMESTAMP been restructured to support fractional seconds. DATETIME space requirement is reduced from 8 bytes prior to

5 bytes

7) Support Online DDL. ALTER operation is no longer blocking DML.

8) Support transportable tablespaces (transportable tablespaces)

9) Support statistics persistence. After avoiding between master and slave, or restart the database, there is a difference with the SQL execution plan

10) Support support full-text index

11) Support InnoDB Memcached plugin

12) .EXPLAIN can be used to view the execution plan DELETE, INSERT, REPLACE, UPDATE DML operations, etc., before this, only supports SELECT operation

13). Reinforcement partition table, including increasing the number of the maximum available partition 8192 to support the exchange of data between partitions and non-partitioned tables, the operator explicitly specified partition

14) .Redo Log total size limit is expanded from the previous 4G to 512G

15) .Undo Log table can be stored in a separate space, because the IO is random, more suitable place in the SSD. But still does not support automatic recovery space

16) After the online support and state dump and load Buffer pool is closed MySQL, avoiding the need to restart the database longer warm-up time

17) .InnoDB internal performance improvement, including splitting kernel mutex, the thread of Independent refresh, purge may be provided a plurality of threads

18) The optimizer performance, the introduction of ICP, MRR, BKA and other features, optimized for sub-queries


MySQL5.7

1) Support group replication and InnoDB Cluster

2) Support multi-source copy

3) support for enhanced semi-synchronous (AFTER_SYNC)

4) Support parallel copy table-based level (LOGICAL_CLOCK) of

5) Support online copy open GTID

6) Support online filtering rules set up replication

7) Support online modification of the size of Buffer pool

8).支持在同一长度编码字节内,修改VARCHAR的大小只需修改表的元数据,无需创建临时表

9).支持可设置NUMA架构的内存分配策略(innodb_numa_interleave)

10).支持透明页压缩(Transparent Page Compression)

11).支持UNDO表空间的自动回收

12).支持查询优化器的增强和重构

13).可查看当前session正在执行的SQL的执行计划(EXPLAIN FOR CONNECTION)

14).引入了查询改写插件(Query Rewrite Plugin),可在服务端对查询进行改写

15).EXPLAIN FORMAT=JSON会显示成本信息,这样可直观的比较两种执行计划的优劣

16).引入了虚拟列,类似于Oracle中的函数索引

17).新实例不再默认创建test数据库及匿名用户

18).引入ALTER USER命令,可用来修改用户密码,密码的过期策略,及锁定用户等

19).mysql.user表中存储密码的字段从password修改为authentication_string

20).支持表空间加密

21).优化了Performance Schema,其内存使用减少

22).Performance Schema引入了众多instrumentation。常用的有Memory usage instrumentation,可用来查看

MySQL的内存使用情况,Metadata Locking Instrumentation, 可用来查看MDL的持有情况,

Stage Progress instrumentation,可用来查看Online DDL的进度

23).同一触发事件(INSERT,DELETE,UPDATE),同一触发时间(BEFORE,AFTER),允许创建多个触发器

在此之前,只允许创建一个触发器

24).InnoDB原生支持分区表,在此之前,是通过ha_partition接口来实现的

25).分区表支持可传输表空间特性。

26).集成了SYS数据库,简化了MySQL的管理及异常问题的定位

27).原生支持JSON类型,并引入了众多JSON函数

28).引入了新的逻辑备份工具mysqlpump,支持表级别的多线程备份

29).引入了新的客户端工具mysqlsh,其支持三种语言:JavaScript, Python and SQL。两种API:X DevAPI,

AdminAPI,其中,前者可将MySQL作为文档型数据库进行操作,后者用于管理InnoDB Cluster

30).mysql_install_db被mysqld --initialize代替,用来进行实例的初始化

31).原生支持systemd

32).引入了super_read_only选项

33).可设置SELECT操作的超时时长(max_execution_time)

34).可通过SHUTDOWN命令关闭MySQL实例。

35).引入了innodb_deadlock_detect选项,在高并发场景下,可使用该选项来关闭死锁检测

36).引入了Optimizer Hints,可在语句级别控制优化器的行为,如是否开启ICP,MRR等,在此之前,只有Index Hints

37).GIS的增强,包括使用Boost.Geometry替代之前的GIS算法,InnoDB开始支持空间索引

郑州×××医院:http://yyk.familydoctor.com.cn/yiyuanzaixian/zztjyy//

MySQL8.0

1).引入了原生的,基于InnoDB的数据字典。数据字典表位于mysql库中,对用户不可见,同mysql库的其它系统表一样,

保存在数据目录下的mysql.ibd文件中。不再置于mysql目录下

2).重构了INFORMATION_SCHEMA,其中部分表已重构为基于数据字典的视图,在此之前,其为临时表

3).PERFORMANCE_SCHEMA查询性能提升,其已内置多个索引

4).支持不可见索引(Invisible index)

5).支持降序索引

6).优化器加入了直方图功能,对比Oracle

7).支持公用表表达式(Common table expressions)

8).支持窗口函数(Window functions)。

9).支持角色(Role)功能,对比Oracle

10).支持资源组(Resource Groups),可用来控制线程的优先级及其能使用的资源,目前,能被管理的资源只有CPU

11).引入了innodb_dedicated_server选项,可基于服务器的内存来动态设置innodb_buffer_pool_size,

innodb_log_file_size和innodb_flush_method

12).支持秒加字段(Instant add column)功能

13).JSON字段的部分更新(JSON Partial Updates)

14).支持自增主键的持久化

15).支持可持久化全局变量(SET PERSIST)

16).默认字符集由latin1修改为utf8mb4

17).默认开启UNDO表空间,且支持在线调整数量(innodb_undo_tablespaces)。在MySQL 5.7中,默认不开启,

若要开启,只能初始化时设置

18).支持备份锁

19).Redo Log的优化,包括允许多个用户线程并发写入log buffer,可动态修改innodb_log_buffer_size的大小

20).默认的认证插件由mysql_native_password更改为caching_sha2_password

21).默认的内存临时表由MEMORY引擎更改为TempTable引擎,相比于前者,后者支持以变长方式存储VARCHAR,

VARBINARY等变长字段。从MySQL 8.0.13开始,TempTable引擎支持BLOB字段

22).Grant不再隐式创建用户

23).SELECT ... FOR SHARE和SELECT ... FOR UPDATE语句中引入NOWAIT和SKIP LOCKED选项,解决电商场景热点行问题

24).正则表达式的增强,新增了4个相关函数,REGEXP_INSTR(),REGEXP_LIKE(),REGEXP_REPLACE(),

REGEXP_SUBSTR()

25).查询优化器在制定执行计划时,会考虑数据是否在Buffer Pool中。而在此之前,是假设数据都在磁盘中

26).ha_partition接口从代码层移除,如果要使用分区表,只能使用InnoDB存储引擎

27).引入了更多细粒度的权限来替代SUPER权限,现在授予SUPER权限会提示warning

28).GROUP BY语句不再隐式排序

29).information_schema中的innodb_locks和innodb_lock_waits表被移除,取而代之的是performance_schema中的

data_locks和data_lock_waits表

30).引入performance_schema.variables_info表,记录了参数的来源及修改情况

31).增加了对于客户端报错信息的统计(performance_schema.events_errors_summary_xxx)

32).可统计查询的响应时间分布(call sys.ps_statement_avg_latency_histogram())

33).支持直接修改列名(ALTER TABLE ... RENAME COLUMN old_name TO new_name)

34).用户密码可设置重试策略(Reuse Policy)

35).移除PASSWORD()函数。这就意味着无法通过“SET PASSWORD ... = PASSWORD('auth_string') ”命令修改用户密码

36).代码层移除Query Cache模块,故Query Cache相关的变量和操作均不再支持

37).BLOB, TEXT, GEOMETRY和JSON字段允许设置默认值

38).可通过RESTART命令重启MySQL实例


Guess you like

Origin blog.51cto.com/14337216/2421402