Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
utf8mb4_0900_bin
Search
とみたまさひろ
August 19, 2019
Technology
2.9k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
utf8mb4_0900_bin
とみたまさひろ
August 19, 2019
More Decks by とみたまさひろ
See All by とみたまさひろ
MySQLとPostgreSQLのコレーション / Collation of MySQL and PostgreSQL
tmtms
1
1.8k
文字列の並び順 / Unicode Collation
tmtms
4
1.1k
夢の印税生活 / Life on Royalties
tmtms
0
650
文字列の並び順 / String Collation
tmtms
1
250
日本MySQLユーザ会ができるまで / making MyNA
tmtms
1
1.1k
Ruby on Browser - RubyWorld Conference 2024
tmtms
1
1.6k
Ruby on Browser
tmtms
1
2.4k
私のRSpecの書き方 / How I write RSpec
tmtms
5
2.3k
ショートカットと端末 / shortcut & terminal
tmtms
2
1.1k
Other Decks in Technology
See All in Technology
Forza Horizon 6 のテレメトリ機能で 自動運転に使えそうな学習データを集める話
henjin0
0
180
クラウドセキュリティ入門 ~安全なクラウド利用のための基礎知識~
lhazy
13
13k
AI-DLC実践録_フルサイクル開発への挑戦
miyuc
0
100
侵入は突然に 〜 IoTマルウェアと悪用される家庭の機器 ~ / When Intrusion Strikes: IoT Malware and the Abuse of Home Devices
nttcom
0
5.8k
社内の7割が使うデータ基盤を、 データチーム2人で回すためにやったこと
koh_yoshi
4
1.4k
【CEDEC2026】次世代デジタルカードゲームのサーバー設計と運用 〜『Shadowverse: Worlds Beyond』の舞台裏~
cygames
PRO
1
1.3k
ブラウザ研修 2026
recruitengineers
PRO
6
1k
【CEDEC2026】『GRANBLUE FANTASY: Relink - Endless Ragnarok』のバトル制作事例 ~最高のキャラゲーを目指して~
cygames
PRO
0
300
Software Supply Chain Attackからクラウド環境を守るためにできること
lhazy
2
260
今こそ聞きたいソフトウェア設計 ドメイン駆動設計再入門
masuda220
PRO
17
7.3k
グローバル基準のSREは、運用現場でどう機能したか:成熟度アセスメントの実践 / SRE NEXT 2026
sorawatanabe
0
230
Master Dataグループ紹介資料
sansan33
PRO
1
4.8k
Featured
See All Featured
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
66
57k
Making Projects Easy
brettharned
120
6.7k
The Cult of Friendly URLs
andyhume
79
7k
Documentation Writing (for coders)
carmenintech
77
5.4k
The SEO identity crisis: Don't let AI make you average
varn
0
530
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
280
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.6k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
990
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
240
Producing Creativity
orderedlist
PRO
348
40k
Transcript
utf8mb4_0900_bin utf8mb4_0900_bin とみたまさひろ 2019-08-19 MyNA会 2019年8月 1
自己紹介 自己紹介 とみたまさひろ 富士通クラウドテクノロジーズ 日本MySQLユーザ会 文字化け担当 @tmtms https://tmtm.github.io/mysql-params/ 2
utf8mb4_0900_bin utf8mb4_0900_bin 3
utf8mb4_0900_bin utf8mb4_0900_bin Collation名 MySQL 8.0.17 から登場 4
Collation Collation 文字のソート順 文字の一致/不一致 デフォルトの utf8mb4_0900_ai_ci では a = A
= A, 1 = ① は = ぱ = ば = ハ = パ = バ 平成 = ㍻ != 5
https://suzuri.jp/tmtms/1934346/t-shirt/s/sumi 6
utf8mb4_bin との違い utf8mb4_bin との違い mysql> SHOW COLLATION LIKE 'utf8mb4%bin'; +------------------+---------+-----+---------+----------+---------+---------------+
| Collation | Charset | Id | Default | Compiled | Sortlen | Pad_attribute +------------------+---------+-----+---------+----------+---------+---------------+ | utf8mb4_0900_bin | utf8mb4 | 309 | | Yes | 1 | NO PAD | utf8mb4_bin | utf8mb4 | 46 | | Yes | 1 | PAD SPACE +------------------+---------+-----+---------+----------+---------+---------------+ 7
CollationのPAD属性 CollationのPAD属性 8.0 から追加 PAD SPACE - 末尾空白文字の有無を無視する 5.7までの振る舞い NO
PAD - 末尾空白文字の有無を無視しない 8.0からの新しいCollationだけ utf8mb4_*0900_* 8
PAD SPACE と NO PAD PAD SPACE と NO PAD
mysql> set names utf8mb4 collate utf8mb4_unicode_520_ci; mysql> select 'a' = 'a '; +--------------+ | 'a' = 'a ' | +--------------+ | 1 | +--------------+ mysql> set names utf8mb4 collate utf8mb4_0900_ai_ci; mysql> select 'a' = 'a '; +--------------+ | 'a' = 'a ' | +--------------+ | 0 | +--------------+ 9
utf8mb4_0900_bin ができた経緯(妄想) utf8mb4_0900_bin ができた経緯(妄想) utf8mb4_bin にも NO PAD バージョンが欲しい 互換のために
utf8mb4_bin は変更できない utf8mb4_0900_bin 新設 10
utf8mb4_bin と utf8mb4_0900_bin utf8mb4_bin と utf8mb4_0900_bin mysql> set names utf8mb4
collate utf8mb4_bin; mysql> select 'a' = 'a '; +--------------+ | 'a' = 'a ' | +--------------+ | 1 | +--------------+ mysql> set names utf8mb4 collate utf8mb4_0900_bin; mysql> select 'a' = 'a '; +--------------+ | 'a' = 'a ' | +--------------+ | 0 | +--------------+ 11
名前がイマイチな気がする 名前がイマイチな気がする 12
Collation Collation デフォルト: utf8mb4_0900_ai_ci 要素 意味 utf8mb4 4バイトUTF-8 0900 Unicode
9.0.0 ai アクセントの違いを無視 ci 大文字小文字の違いを無視 13
0900 は Unicode 9.0.0 準拠のCollationという意味 utf8mb4_0900_bin は Unicode 準拠じゃない NO
PADなCollationは0900だけだからこうなった? それにしてもなー 14
測ってないけどたぶん utf8mb4_bin よりも速いから みんな utf8mb4_0900_bin を使うといいと思う 15