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
MySQLでタグ検索
Search
T. MOTOOKA
October 23, 2014
Technology
0
500
MySQLでタグ検索
2014.10.23(木) MySQL勉強会 in 大阪 LT
タグ件数10^5〜10^6程度のタグ検索の仕組みをMySQLで組んでみた話
T. MOTOOKA
October 23, 2014
Tweet
Share
More Decks by T. MOTOOKA
See All by T. MOTOOKA
一意に定まらない話
motooka
0
37
自動化した処理を止めてしまった話
motooka
0
110
StoredFunctionのすゝめ
motooka
1
110
コメントは英語で書く!
motooka
1
110
TCPポート使い切り事件
motooka
1
480
SVG画像をPHPで生成しよう
motooka
0
1.4k
Working with Database Replications in CakePHP
motooka
1
2.1k
文字とPDFとPDFKit
motooka
2
2.1k
SVG破損事例の解説
motooka
1
770
Other Decks in Technology
See All in Technology
なぜスクラムはこうなったのか?歴史が教えてくれたこと/Shall we explore the roots of Scrum
sanogemaru
3
750
カミナシ社の『ID管理基盤』製品内製 - その意思決定背景と2年間の進化 #AWSUnicornDay / Kaminashi ID - The Big Whys
kaminashi
3
760
Skrub: machine-learning with dataframes
gaelvaroquaux
0
110
Jaws-ug名古屋_LT資料_20250829
azoo2024
3
230
コスト削減の基本の「キ」~ コスト消費3大リソースへの対策 ~
smt7174
2
340
衝突して強くなる! BLUE GIANTと アジャイルチームの共通点とは ― いきいきと活気に満ちたグルーヴあるチームを作るコツ ― / BLUE GIANT and Agile Teams
naitosatoshi
0
300
生成AI時代のデータ基盤
shibuiwilliam
4
3.1k
AIのグローバルトレンド2025 #scrummikawa / global ai trend
kyonmm
PRO
1
220
AI時代にPdMとPMMはどう連携すべきか / PdM–PMM-collaboration-in-AI-era
rakus_dev
0
270
実運用で考える PGO
kworkdev
PRO
0
140
ライブサービスゲームQAのパフォーマンス検証による品質改善の取り組み
gree_tech
PRO
0
500
落ちる 落ちるよ サーバーは落ちる
suehiromasatoshi
0
120
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
45
7.6k
Git: the NoSQL Database
bkeepers
PRO
431
66k
Optimizing for Happiness
mojombo
379
70k
Code Review Best Practice
trishagee
70
19k
Embracing the Ebb and Flow
colly
87
4.8k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
139
34k
RailsConf 2023
tenderlove
30
1.2k
Making Projects Easy
brettharned
117
6.4k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
18
1.1k
Why You Should Never Use an ORM
jnunemaker
PRO
59
9.5k
Transcript
MySQLͰλάݕࡧ 2014.10.23() MySQLษڧձ in େࡕ https://atnd.org/events/57326 ຊԬ ٱ
ࣗݾհ ຊԬ ٱʢ @t_motooka / id:t_motookaʣ Web ΞϓϦ։ൃ iOS ΞϓϦ։ൃ
ςΫχΧϧΤϯδχΞʢσʔλϕʔεʣ ʢݱɿσʔλϕʔεεϖγϟϦετʣ
Disclaimer ͜ͷ༰ݸਓͷݟղΛड़ͨͷͰ͋ͬͯɺ ॴଐ͍ͯ͠Δʗ͍ͯͨ͠৫ͱແؔͰ͢ɻ
Ͳ͏͢Δʁ λάݕࡧ શจݕࡧʁ λά֨ೲςʔϒϧʁ
ͦͦɿλάݕࡧͷཁ݅ શҰகʁɹ෦Ұகʁɹ͍͋·͍ʁ ෳλάࢦఆͷΑΔߜΓࠐΈɹYes or Noʁ λάจࣈྻϢʔβೖྗɹYes or Noʁ
ࠓճͷཁ݅ λάͷ෦Ұக Ұக߹͍ʹΑΔॱҐ͚ʢશҰக্ʹདྷΔɺʣ ෳλάͰͷ AND ݕࡧ 5ສ݅ͷຊମσʔλɺ100ສ݅ͷλά ˞ॏෳআڈͨ͠λά4ສ݅ఔ
࠷ॳʹదʹΜͩͷ ຊମςʔϒϧʹλάςʔϒϧΛ୯७ʹ inner join ඞવతʹλάςʔϒϧΛ full [table | index] scan
ʢ࣌50ສ݅ʣ ʊਓਓਓਓਓਓʊ ʼɹेඵɹʻ ʉ:?:?:?:?:ʉ
ߟ͑ͨ݁Ռ ॏෳআڈͨ͠λάͷٙࣅ Materialized View Λ༻ҙʢ4ສ݅ʣ ɹˠ ͜͜Ͱ full table scan
ͦͷ݁ՌΛ engine=memory ͳҰ࣌දʹಥͬࠐΉ ˞֤λάͷҰக߹͍ΛείΞԽʢޙͰ order by Ͱ͏ʣ ͦ͜ͱλάදΛjoinʢͪΌΜͱ index ͬͯ͘ΕΔʣ ͳΜͱ͔࣮༻ʹ͑ΔϨϕϧ
·ͱΊ Materialized View… શจݕࡧ͡Όͳͯ͘ ෦Ұகͷλάݕࡧ͕ͦΕͳΓͷͰ ͬͱ͘Ͱ͖ͨΒվΊͯLTΛ…