How MySQL5.7 new feature rocks your heart
Updated:
Contents
- 1. 新增特性
- 2. 新特性描述
- 3. 移除的特性
- 4. 关键特性详解
- 4.1. Adding JSON Support to MySQL
- 4.2. Generated Columns & Indexable Virtual Columns
- 4.3. Performance & Scalability
- 4.4. Online Operations
- 4.5. Optimizer Improvements
- 4.6. Parser Refactoring
- 4.7. Optimizer Refactoring
- 4.8. Work towards a New Cost Model
- 4.9. Page Compression
- 4.10. InnoDB Fulltext Search
- 4.11. Performance Schema
- 4.12. SYS Schema
- 4.13. Fabric Support
- 4.14. Secure by Default
- 4.15. Security Features
- 4.16. InnoDB Native Partitioning
- 4.17. InnoDB General Tablespaces
- 4.18. InnoDB Temporary Table Performance
- 4.19. Buffer Pool—Dump and Load
- 4.20. Tools
- 4.21. Community Contributions
- 4.22. Triggers
- 4.23. IGNORE Clause
- 4.24. STRICT Mode
- 4.25. GIS: InnoDB Spatial Indexes
- 4.26. GIS: Geometry Functions & Formats
- 4.27. Multi-Source Replication
- 4.28. Replication — Multi-Threaded Slaves (MTS)
- 4.29. Semi-Sync Replication (lossless)
- 4.30. Replication — GTID (online)
- 4.31. Replication — Refactoring
- 4.32. Other Replication Features
- 4.33. Other Improvements
- 5. 关键参数
- 6. 参考
新增特性
种类 | 特性名称 | 备注 | 相关链接 |
---|---|---|---|
Performance&Scalability | online rename index | inplace方式,针对所有引擎 | alter index |
Performance&Scalability | online alter varchar | [0~255]是inplace修改,[256 ~ 256+] 是inplace修改 | online alter varchar |
Performance&Scalability | innochecksum | 增强版本的innochecksum | innochecksum,Improving Innochecksum,deep innochecksum |
Performance&Scalability | innodb_buffer_pool_dump_pct | - | innodb_buffer_pool_dump_pct |
Performance&Scalability | multi page cleaner | innodb_page_cleaners | innodb_page_cleaners |
Performance&Scalability | online DDL for optimize, alter engine=innodb | inplace的方式优化表 | online ddl |
Performance&Scalability | 可传输表空间 | - | 可传输表空间 |
Performance&Scalability | buffer_pool动态调整 | innodb_buffer_pool_size | Configuring InnoDB Buffer Pool Size Online |
Performance&Scalability | 创建所有和重建索引的时候使用bulk load | sorted index build,innodb_fill_factor | Sorted Index Builds |
Performance&Scalability | 缩小undo空间 | innodb_undo_log_truncate | Truncating Undo Logs |
Performance&Scalability | general tablespaces | - | InnoDB General Tablespaces |
Performance&Scalability | show_compatibility_56 | 兼容5.6参数用法 | Migrating to Performance Schema System and Status Variable Tables |
Replication improvements | Master dump thread improvements | 提升dump thread,减少锁竞争,增大吞吐量 | improvements |
Replication improvements | Changing the replication master without STOP SLAVE | 在线change master | CHANGE MASTER,Switching Masters During Failover |
Replication improvements | Multi-source replication | 多源复制 | Multi-Source Replication |
Replication improvements | Group Replication | - | SQL Statements for Controlling Group Replication,Group Replication |
Replication improvements | online GTID | - | - |
Replication improvements | multi-threaded replication | - | - |
Replication improvements | lossless semi-sync replication | - | - |
Performance Schema | sys schema增强版 | 包含了一些列ps的操作 | sys schema |
Optimizer | explain增强 | 可以根据connection_id查看 | explain connection |
Optimizer | hint增强 | optimizer_switch | hints |
JSON support | 提供JSON支持 | NoSQL扩展 | JSON |
Security | 密码过期策略 | - | Password Expiration Policy |
Security | 账号锁定 | - | account-locking |
Security | mysql初始化 | 1,只创建root@local用户 2,不创建test库 | initial |
Security | 支持SSL连接 | 更加安全 | SSL |
Other | Generated Columns | 虚拟列 | CREATE TABLE and Generated Columns |
Other | mysql client增强 | ctrl+c 终止操作,但是不会退出终端 | ctrl+c |
Other | 数据库重命名 | —rewrite-db | rewrite dbname |
新特性描述
Performance & Scalability: innoDB可伸缩性增强,临时表的性能,快速的online操作以及bulk load
JSON Support: JSON的支持,可以让RDB和NoSQL结合,让其更加灵活
Replication improvements: multi-source replication, multi-threaded slave enhancements, online GTIDs, and enhanced semi-sync replication 超级特性
Performance Schema: new SYS Schema 可以更加全面和底层的了解到数据库的性能
Security: MySQL5.7的新特性可以让数据库更加安全
Optimizer: 在解析器,优化器,代价模型上重构了大量的代码。并且在管理性,扩展性,性能方面得到了大量的提升
GIS: 地理位置查询,支持InnoDB spatial索引
移除的特性
- YEAR(2) Limitations and Migrating to YEAR(4)
- storage_engine 用 default_storage_engine 替换
- 去除thread_concurrency 参数
- 去除 timed_mutexes 参数
- alter table 不在有 ignore语句
- insert delayed 不在支持
- mysql_upgrade 不在支持—basedir,—datadir,—tmpdir
- SHOW ENGINE INNODB MUTEX 废除
- innodb_monitor,innodb_lock_monitor废除,代替的是: innodb_status_output, innodb_status_output_locks
- innodb_use_sys_malloc and innodb_additional_mem_pool_size 废除
- innodb_log_checksum_algorithm废除
关键特性详解
Adding JSON Support to MySQL
|
|
Generated Columns & Indexable Virtual Columns
|
|
Performance & Scalability
性能和可伸缩性一直都是MySQL的重点优化对象
在InnoDB read-only(RO)方面,通过不断地迭代研发,让server层的connection处理更加快速
在InnoDB read-write(RW)方面,改善了很多internal的操作(如:flushing/purging 更加快速和稳定),以及快速的bulk 数据导入
- InnoDB Read-Only Scalability
|
|
- InnoDB Read-Write Scalability
|
|
- InnoDB Faster & Parallel Flushing
|
|
- Speeding up Connection Handling
|
|
- Bulk Data Load Improvements
|
|
Online Operations
|
|
Optimizer Improvements
|
|
Parser Refactoring
|
|
Optimizer Refactoring
Work towards a New Cost Model
Page Compression
|
|
InnoDB Fulltext Search
|
|
Performance Schema
|
|
SYS Schema
|
|
Fabric Support
Secure by Default
Security Features
InnoDB Native Partitioning
|
|
InnoDB General Tablespaces
InnoDB Temporary Table Performance
|
|
Buffer Pool—Dump and Load
|
|
Tools
- mysqlpump
|
|
- innochecksum
|
|
- mysqlbinlog
|
|
Community Contributions
|
|
Triggers
IGNORE Clause
STRICT Mode
GIS: InnoDB Spatial Indexes
GIS: Geometry Functions & Formats
Multi-Source Replication
|
|
Replication — Multi-Threaded Slaves (MTS)
|
|
Semi-Sync Replication (lossless)
|
|
Replication — GTID (online)
|
|
Replication — Refactoring
Other Replication Features
- SHOW SLAVE STATUS 不阻塞
- mysqlbinlog幂等模式
- mysqlbinlog重写DB
- replication的变量和参数已经加入到performance schema中
- GTIDs 存入InnoDB表中
- 增加参数: —binlog_group_commit_sync_delay,binlog_group_commit_sync_no_delay_count 让更多的事务加入到binlog的组提交队列中
Other Improvements
- ROW_FORMAT=DYNAMIC 成为默认
- PERFORMANCE_SCHEMA 中新增 THREADS.THREAD_OS_ID
- 在sys中打印出long query的进度报告
- 新增Information_Schema.Files
- InnoDB的填充因子可设置了
- 支持32k和64k页了
- 5.6到5.7可以更加平滑的升级了,以前是需要制定—skip-grant-tables
- 插件和系统表大部分都修改成innoDB了
- TRUNCATE TABLE 操作变成原子的了,意味着table_id 是同一个,不会新增了
- 新增参数:—disabled-storage-engines
- 新增参数:Super-read-only(super权限也无法操作) , 这个设置后,read-only 也会自动设置on
关键参数
参数名 | 备注 | 链接 |
---|---|---|
default_password_lifetime | - | default_password_lifetime |