Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
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.9k
文字列の並び順 / Unicode Collation
tmtms
4
1.3k
夢の印税生活 / Life on Royalties
tmtms
0
670
文字列の並び順 / String Collation
tmtms
1
270
日本MySQLユーザ会ができるまで / making MyNA
tmtms
1
1.1k
Ruby on Browser - RubyWorld Conference 2024
tmtms
1
1.7k
Ruby on Browser
tmtms
1
2.4k
私のRSpecの書き方 / How I write RSpec
tmtms
5
2.4k
ショートカットと端末 / shortcut & terminal
tmtms
2
1.1k
Other Decks in Technology
See All in Technology
Deployment の 先にある AI Agent 基盤 - kagent vNext、Agent Substrate、Hermes から読み解く Agent Runtime の現在地 / k8s-matsuri-2-ai-agent-platform-amsy810
masayaaoyama
4
690
AI時代、データエンジニアが一番おもろい
genshun9
0
680
AIで社員の自主発信に広報目線を組み込む
_mossann_t
0
140
AIによるクリエイティブ生成を行う上での試行錯誤
plaidtech
PRO
0
170
バイブコーディング時代のWebアプリ開発入門~Cloud Runで学ぶセキュアなビルドとデプロイ
waiwai2111
1
140
ソフトウェアDNAとクラウドエージェントのススメ
cloudace
0
120
AIエージェントの自己改善をどう設計するか / How to Design Self-Improvement for AI Agents
22mi
25
17k
現場で役立つ技術負債の効果的な返済方法
masuda220
PRO
9
4.9k
C#未経験の僕がAIに読めるコードを書かせるまで
maguroalternative
0
210
Railsのように考える: See through the Master
snoozer05
PRO
5
1.2k
あけおめLINE 傾向とその対策
nasa9084
0
190
「どのログを見ればいい?」 から始めた サーバーレス障害解析
y_waka1
1
120
Featured
See All Featured
Evolving SEO for Evolving Search Engines
ryanjones
0
300
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
46k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
300
A designer walks into a library…
pauljervisheath
211
25k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
830
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
Paper Plane
katiecoart
PRO
4
53k
Making Projects Easy
brettharned
120
6.8k
Embracing the Ebb and Flow
colly
88
5.2k
Visualization
eitanlees
152
17k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
440
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
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