[转帖]MySQL 8.0: When to use utf8mb3 over utf8mb4?

mysql,when,to,use,utf8mb3,over,utf8mb4 · 浏览次数 : 0

小编点评

Sure, here's a summary of the content you provided: **MySQL 8.0:** * Significantly improves the performance of utf8mb4. * Introduces several new collations for better performance. **Comparison between utf8mb3 and utf8mb4:** | Feature | utf8mb3 | utf8mb4 | |---|---|---| | Performance | Slower | Faster | | Support for emojis | Limited | Extensive | | Support for language sorting | Basic | Accent and case sensitivity | | Support for Japanese | Limited | Supports Japanese | **Conclusion:** * UTF8mb4 is the default character set for MySQL 8.0 and is significantly faster than utf8mb3. * For cases where performance is not a major concern, UTF8mb4 is still a good choice. * UTF8mb4 is the recommended choice for new applications due to its improved performance and support for a wider range of languages.

正文

https://dev.mysql.com/blog-archive/mysql-8-0-when-to-use-utf8mb3-over-utf8mb4/

 

MySQL 8.0: When to use utf8mb3 over utf8mb4?

Long time MySQL users will recognize that there are two varieties of utf8 support in MySQL; utf8mb3 and utf8mb4.  Let me dig a little bit deeper in explaining the history between the two:

  • MySQL 4.1 (2004) was the first version to support character sets and collations.  The default character set was latin1, but utf8[mb3] was available as an option.  An optimization was chosen to limit utf8 to 3 bytes, enough to handle almost all modern languages. 
  • MySQL 5.5 (2010) added support for up to 4 byte utf8 using the new utf8mb4 character set.
  • MySQL 5.7 (2015) added some optimizations such as a variable length sort buffer, and also changed InnoDB’s default row format to DYNAMIC.  This allows for indexes on VARCHAR(255) with utf8mb4; something that made migrations more difficult prior.
  • MySQL 8.0 (In development) vastly improves the performance of utf8mb4, as well as adding several new collations.  It is now the default character set for MySQL.

Is utf8mb3 still faster?

With the original purpose of utf8mb3 being a performance optimization, the next question is, does this still yield true today?  The short answer is no; the new utf8mb4-based collations are much faster than any of the old utf8mb3-based ones:

 

 

utf8mb4 shown in red.  Results in transactions per second; higher is better.

We expect cases where utf8mb3 is faster to be quite rare, and any such case will be considered a bug 🙂

Making the case for utf8mb4

If the performance gains in MySQL 8.0 aren’t enough to entice you, perhaps these additional points will:

  • Even for English speaking markets, the prevalence of emojis as character input is driving adoption of utf8mb4 over utf8mb3 and latin1.
  • We have improved our collations to account for a number of language specific sorting rules.  The collations for utf8mb3 are correct for the common cases, but the devil is in the details.
  • The new collations also support accent and case sensitivity.
  • Even in Asia, we are seeing adoption of utf8mb4 over CJK character sets, largely because it supports a super-set of possible characters.  We also now support a collation specific to Japanese.

Future Steps

As we no longer see a strong use-case for utf8mb3, we intend to mark it as deprecated in MySQL 8.0.  Because upgrading from earlier character-sets requires tables to be rebuilt, we expect that it may be some it time before we are able to move from deprecation to removal.  However, in making this first step we are communicating that it is a legacy feature that should no longer be used in new applications.

与[转帖]MySQL 8.0: When to use utf8mb3 over utf8mb4?相似的内容:

[转帖]MySQL 8.0: When to use utf8mb3 over utf8mb4?

https://dev.mysql.com/blog-archive/mysql-8-0-when-to-use-utf8mb3-over-utf8mb4/ MySQL 8.0: When to use utf8mb3 over utf8mb4? Posted on May 19, 2017 by 

[转帖]MySQL 8.0.19 instant add column,亿级数据秒速增加字段

一、MySQL DDL 的方法 MySQL 在大型表上的 DDL 会带来耗时较久、负载较高、额外空间占用、MDL、主从同步延时等情况。需要特别引起重视,而MySQL 的 DDL 有很多种方法。 MySQL 本身自带三种方法,分别是:copy、inplace、instant。 copy 算法为最古老的

[转帖]MySQL 8.0 Instant Add Column功能解析

https://zhuanlan.zhihu.com/p/408702204 概述 DDL(Data Definition Language)是数据库内部的对象进行创建、删除、修改的操作语言,主要包括:加减列、更改列类型、加减索引等类型。数据库的模式(schema)会随着业务的发展不断变化,如果没有

[转帖]MySQL 8.0新特性和性能数据

https://plantegg.github.io/2022/07/03/MySQL8.0%E7%9A%84%E4%B8%80%E4%BA%9B%E6%95%B0%E6%8D%AE/ MySQL 8.0带来了很多新特性 针对性能方面介绍全在这个PPT( http://dimitrik.free.f

【转帖】MySQL 8.0.32如期而至

MySQL 8.0版本计划 MySQL 8.0开始采用快速迭代开发模式,基本上是每隔3个月就发布一个新的小版本。去年1月18日(2022.1.18)发布MySQL 8.0.28,今年1月17日发布MySQL 8.0.32,再看看其他几个版本的时间,还真是贼守时啊。 版本发布时间上一年版本上一年发布时

【转帖】MySQL 8.0 hash join有重大缺陷?

我并不这么看。 友情提醒:本文建议在PC端阅读。 徐春阳老师发文爆MySQL 8.0 hash join有重大缺陷。 文章核心观点如下:多表(比如3个个表)join时,只会简单的把表数据量小的放在前面作为驱动表,大表放在最后面,从而导致可能产生极大结果集的笛卡尔积,甚至耗尽CPU和磁盘空间。 就此现

[转帖]【MySQL】MySQL 8.0 redo log写入性能问题分析

http://kernelmaker.github.io/MySQL_8_core 最近对比了MySQL 5.6和8.0在8核环境下oltp_write_only的性能,发现8.0写入性能(QPS 6-7万)反而低于5.6版本的(QPS 14万),所以进一步测试分析了下redo log这里可能导致性

[转帖]MySQL Performance : 8.0 and UTF8 impact

http://dimitrik.free.fr/blog/posts/mysql-performance-80-and-utf8-impact.html 2018-04-26 00:58 | MySQL, Performance, UTF8 by Dimitri The world is movin

[转帖]第一章 MySQL 8.0 介绍及安装配置

第一章 MySQL 8.0 介绍及安装配置 https://www.jianshu.com/p/d190c6b3520d 本课程,适合具备一定Linux运维或者开发基础的朋友,课程定级中、高级DBA。只要掌握80%,轻松助力薪资15k-25K。课程内容均来自与MySQL官网+MySQL源码。配套精品

[转帖]【MySQL 8】MySQL 5.7都即将停只维护了,是时候学习一波MySQL 8了

https://www.cnblogs.com/paul8339/p/17026571.html 阅读目录 账户与安全 索引增强 原子DDL操作 通用表达式(CTE) 其他 MySQL 8新特性选择MySQL 8的背景:MySQL 5.6已经停止版本更新了,对于 MySQL 5.7 版本,其将于 2