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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
とみたまさひろ
August 19, 2019
Technology
2.8k
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
630
文字列の並び順 / String Collation
tmtms
1
230
日本MySQLユーザ会ができるまで / making MyNA
tmtms
1
1.1k
Ruby on Browser - RubyWorld Conference 2024
tmtms
1
1.6k
Ruby on Browser
tmtms
1
2.3k
私のRSpecの書き方 / How I write RSpec
tmtms
5
2.3k
ショートカットと端末 / shortcut & terminal
tmtms
2
1.1k
Other Decks in Technology
See All in Technology
Making sense of Google’s agentic dev tools
glaforge
1
170
SREとQA 二人三脚で進めるSLO運用/sre-qa-slo
sugitak
0
440
AI駆動開発におけるQAエンジニアの役割事例 〜AI駆動開発の現場から〜
kobayashiyorimitsu
0
490
穢れた技術選定について
watany
3
300
CSに"SLO"は要らない、経営層に"99.9%"は伝わらない - SREを全社に"翻訳"する3原則
cscengineer
PRO
1
4.5k
AIに「使われる」時代のSaaS戦略 〜既存WebAPIのMCPサーバー化における開発ノウハウ〜
ekispert_api
0
310
Baseline対応のDOMの型定義を作った
uhyo
3
740
インフラ寄りSREでも 開発に踏み出せる〜境界を越えてユーザー体験に向き合いたい〜
sansantech
PRO
2
3.7k
タスクの複雑さでモデルを選ぶ ── Thompson Samplingで動かす“トークン/コスト最適化
satohy0323
0
230
10年目を迎えた「ABEMA」がどのように AI 活用を推進して、AI 駆動開発にシフトしているのか / How ABEMA, entering its 10th year, is promoting the use of AI and shifting toward AI-driven development
miyukki
0
120
環境凍結という Toil を倒す -セルフサービス型 Ephemeral テスト環境の 設計と実践
shirouz
1
2.3k
凡エンジニアがこの先生きのこるためには。〜TypeScript完全に理解したい〜
alchemy1115
2
160
Featured
See All Featured
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.6k
[SF Ruby Conf 2025] Rails X
palkan
2
1.2k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.1k
WCS-LA-2024
lcolladotor
0
680
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
310
New Earth Scene 8
popppiees
3
2.4k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
220
Why Our Code Smells
bkeepers
PRO
340
58k
Building Applications with DynamoDB
mza
96
7.1k
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