MySQL 升级:Server 版本变更详解 (8.0.36 ~ 8.0.37)
2024 年上半年,MySQL Server 共发布了两个版本:
- MySQL 8.0.36, 2024-01-16
- MySQL 8.0.37, 2024-04-30
下面探讨这些版本的重要变更,并以 MySQL 8.0.37 为例做演示。
优化器
- (MySQL 8.0.36) The hashing algorithm employed yielded poor performance when using a HASH field to check for uniqueness. (Bug #109548 , Bug #34959356)
示例:
问题复现案例中的执行计划,新版本执行很快,问题版本则要若干秒。
1 | mysql> EXPLAIN ANALYZE SELECT COUNT(*) FROM ( SELECT value FROM product GROUP BY code, name, comment, platform ) derived\G |
- (MySQL 8.0.37) The multi-range read (MRR) optimization did not perform as well as in previous releases. (Bug #113711, Bug #36220640)
解析:
MySQL 8.0.36 开启 MRR 后,主键排序性能下降。
MRR 可用于表的索引范围扫描和等值连接操作。当使用 MRR 时,EXPLAIN
输出中的 Extra
列显示 Using MRR
。
1 | mysql> EXPLAIN |
Performance Schema
- (MySQL 8.0.36) When executing a stored program, the Performance Schema instrumentation caused some unnecessary overhead. As of this release, all stored procedure micro instructions (statement/sp/%), except statement/sp/stmt, are disabled by default. (Bug #27934653)
示例:
1 | mysql> SELECT name,enabled,timed |
功能
-
(MySQL 8.0.36) For platforms on which OpenSSL libraries are bundled, the linked OpenSSL library for MySQL Server has been updated to version 3.0.12. Issues fixed in OpenSSL version 3.0.12 are described at https://www.openssl.org/news/cl30.txt . (Bug #36033684)
-
(MySQL 8.0.37) For platforms on which OpenSSL libraries are bundled, the linked OpenSSL library for MySQL Server has been updated to version 3.0.13. Issues fixed in OpenSSL version 3.0.13 are described at https://www.openssl.org/news/cl30.txt . (Bug #36261675)
解析:
在 Oracle Linux 7 上仍可使用 openssl 1.1.1,但在 Oracle Linux 8/9 系统,则应使用 openssl 3。
-
(MySQL 8.0.37) Group Replication: When issued with
group_replication_consistency
set toBEFORE_ON_PRIMARY_FAILOVER
, the MySQLKILL
statement now ignores any consistency guarantees, with any interrupted transactions now being rolled back. -
(MySQL 8.0.37) Packaging: Added support for Fedora 40 and Ubuntu 24.04.
解析:
Fedora 40 将作为 CentOS Stream 10 和 RHEL 10 的上游,意味着 MySQL 已经在为新版本的企业级操作系统做准备。
- (MySQL 8.0.37) The clone plugin version requirements were relaxed to allow cloning between different point releases in the same series. In other words, only the major and minor version numbers must match when previously the point release number also had to match.
问题修复
- (MySQL 8.0.37) The Robin Hood hashing library has been replaced with
unordered_dense
. (Bug #36158022)
解析:
从 MySQL 8.0.37 开始,引入 ankerl::unordered_dense
v4.4.0 类库,替换掉之前的 robin-hood-hashing 。
unordered_dense 是一个高性能哈希表实现,基于 robin-hood 后移删除算法,适用于 C++17 及更高版本。
Reference
- https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-37.html
- https://codecapsule.com/2013/11/17/robin-hood-hashing-backward-shift-deletion/
- https://jacksonallan.github.io/c_cpp_hash_tables_benchmark/
– / END / –
- Title: MySQL 升级:Server 版本变更详解 (8.0.36 ~ 8.0.37)
- Author: ShawnYan
- Created at: 2024-07-24 21:00:00
- Updated at: 2024-07-24 21:00:00
- Link: https://shawnyan.cn/2024/mysql/mysql-upgrade-change-2024-1/
- License: This work is licensed under CC BY-NC-SA 4.0.