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
introduce_pattern_matching_with_mongo-clarify
Search
morihirok
May 09, 2019
Programming
0
110
introduce_pattern_matching_with_mongo-clarify
Hello hey for Engineers vol.3で発表した内容です。
morihirok
May 09, 2019
Tweet
Share
More Decks by morihirok
See All by morihirok
Ruby on Rails の楽しみ方
morihirok
6
3.6k
RubyKaigi で得た課題解決法・美意識・モチベーション
morihirok
0
550
混沌とした例外処理とエラー監視に秩序をもたらす
morihirok
22
4.1k
継続的にRailsアプリを開発する上で早めにやっておきたいこと
morihirok
9
3.2k
1日5分!子育て中もインプットを続ける工夫
morihirok
4
1.2k
rarray_value.pdf
morihirok
0
1.7k
失敗しても大丈夫!ひとりWebサービスのすゝめ
morihirok
2
500
try_to_making_a_gem_with_pattern_matching.pdf
morihirok
0
220
Other Decks in Programming
See All in Programming
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
41
27k
Create a website using Spatial Web
akkeylab
0
290
Bytecode Manipulation 으로 생산성 높이기
bigstark
2
360
単体テストの始め方/作り方
toms74209200
0
510
iOSアプリ開発で 関数型プログラミングを実現する The Composable Architectureの紹介
yimajo
2
210
Javaに鉄道指向プログラミング (Railway Oriented Pro gramming) のエッセンスを取り入れる/Bringing the Essence of Railway-Oriented Programming to Java
cocet33000
2
580
Javaのルールをねじ曲げろ!禁断の操作とその代償から学ぶメタプログラミング入門 / A Guide to Metaprogramming: Lessons from Forbidden Techniques and Their Price
nrslib
3
2k
来たるべき 8.0 に備えて React 19 新機能と React Router 固有機能の取捨選択とすり合わせを考える
oukayuka
2
810
Elixir で IoT 開発、 Nerves なら簡単にできる!?
pojiro
1
150
KotlinConf 2025 現地参加の土産話
n_takehata
0
100
既存デザインを変更せずにタップ領域を広げる方法
tahia910
1
240
FormFlow - Build Stunning Multistep Forms
yceruto
1
190
Featured
See All Featured
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
53
2.8k
Music & Morning Musume
bryan
46
6.6k
Making the Leap to Tech Lead
cromwellryan
134
9.3k
Adopting Sorbet at Scale
ufuk
77
9.4k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
20
1.3k
Git: the NoSQL Database
bkeepers
PRO
430
65k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
32
5.9k
Raft: Consensus for Rubyists
vanstee
140
7k
The Invisible Side of Design
smashingmag
299
51k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.7k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
920
Transcript
Introduce Pattern matching with mongo-clarify Hello hey for Engineers vol.3
@_morihirok
About me • Github: morihirok • Twitter: @_morihirok • STORES.jp
ϓϩμΫτਪਐνʔϜ
Ruby 2.7ͷ৽ػೳ Pattern matching͕ ໘നͦ͏
3VCZ,BJHJ1BUUFSONBUDIJOH/FXGFBUVSFJO3VCZΑΓҾ༻ IUUQTTQFBLFSEFDLDPNL@UTKQBUUFSONBUDIJOHOFXGFBUVSFJOSVCZEPU
3VCZ,BJHJ1BUUFSONBUDIJOH/FXGFBUVSFJO3VCZΑΓҾ༻ IUUQTTQFBLFSEFDLDPNL@UTKQBUUFSONBUDIJOHOFXGFBUVSFJOSVCZEPU
ͬͯΈ͍ͨͷͰ Կ͔࡞Ζ͏
.POHP%#YΠϯσοΫεੜલޙͷFYQMBJO ݁ՌΛಡΉΑΓҾ༻ IUUQTCMPHNLOLJTLDPNNPOHPECJOEFYFYQMBJO
MongoDBͷexplain গ͠ಡΈͮΒ͍…
MongoDBͷexplain݁Ռͷ αϯϓϧ > db.items.find({price: 119}).explain("executionStats") { "queryPlanner" : { "plannerVersion"
: 1, "namespace" : "sample_db.items", "indexFilterSet" : false, "parsedQuery" : { "price" : { "$eq" : 119 } }, "winningPlan" : { "stage" : "COLLSCAN", "filter" : { "price" : { "$eq" : 119 } શͯ+40/Ͱදݱ͞ΕΔ
͜ΕΛಡΈ͘͢ දࣔͤ͞Δͷʹ Pattern matching͕ ศརͦ͏
ͱ͍͏͜ͱͰ࡞ͬͨͷ͕͜Ε FYQMBJOͷ+40/Λ ͍͍۩߹ʹ.BSLEPXOͷ ςʔϒϧʹม͢Δ
ΠϯσοΫε͕ޮ͍ͯͳ͍ͱ͖ͷ explain݁Ռ ͕͜͜z$0--4$"/zʹͳΔ
͜͏ॻ͚Δ ͕͜͜z$0--4$"/zʹͳΔ
ΠϯσοΫε͕ޮ͍͍ͯΔͱ͖ͷ explain݁Ռ ͕͜͜z'&5$)zʹมΘΔ ͕͜͜z*94$"/zʹͳΔ ͜͜ʹΠϯσοΫε໊͕ೖΔ
͜͏ॻ͚Δ ͕͜͜z'&5$)zʹมΘΔ ͕͜͜z*94$"/zʹͳΔ ͜͜ʹΠϯσοΫε໊͕ೖΔ
͜͏ॻ͚Δ มΛόΠϯυͰ͖Δ ͜͜ʹΠϯσοΫε໊͕ೖΔ
࠷ऴతʹ͜͏ͳΔ
STORES.jpͰ ͍͍ײ͡ʹ͑ͦ͏
ൃੜ
Ruby 2.7(trunk)͡Όͳ͍ͱ ͑ͳ͍
Pattern matchingແ͠Ͱ ॻ͖͑Δ
Pattern matchingແ͠Ͱ ॻ͖͑Δ
কདྷతʹ ॏๅ͞Εͦ͏ͳ༧ײ
ࠓͷίʔυͪ͜Β͔Β IUUQTHJUIVCDPNNPSJIJSPLNPOHPDMBSJGZ