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
150
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
Back into Monolith, Back into Rails
morihirok
0
75
Sidekiq その前に:Webアプリケーションにおける非同期ジョブ設計原則
morihirok
18
11k
Ruby on Rails の楽しみ方
morihirok
12
7k
RubyKaigi で得た課題解決法・美意識・モチベーション
morihirok
0
760
混沌とした例外処理とエラー監視に秩序をもたらす
morihirok
24
4.8k
継続的にRailsアプリを開発する上で早めにやっておきたいこと
morihirok
11
3.5k
1日5分!子育て中もインプットを続ける工夫
morihirok
4
1.3k
rarray_value.pdf
morihirok
0
1.9k
失敗しても大丈夫!ひとりWebサービスのすゝめ
morihirok
2
550
Other Decks in Programming
See All in Programming
朝日新聞のデジタル版を支えるGoバックエンド ー価値ある情報をいち早く確実にお届けするために
junkiishida
1
370
RAGでハマりがちな"Excelの罠"を、データの構造化で突破する
harumiweb
9
2.5k
Codex の「自走力」を高める
yorifuji
0
460
今、アーキテクトとして 品質保証にどう関わるか
nealle
0
200
New in Go 1.26 Implementing go fix in product development
sunecosuri
0
330
TipKitTips
ktcryomm
0
150
メタプログラミングで実現する「コードを仕様にする」仕組み/nikkei-tech-talk43
nikkei_engineer_recruiting
0
160
AI時代でも変わらない技術コミュニティの力~10年続く“ゆるい”つながりが生み出す価値
n_takehata
2
640
CDIの誤解しがちな仕様とその対処TIPS
futokiyo
0
170
Claude Code、ちょっとした工夫で開発体験が変わる
tigertora7571
0
200
Head of Engineeringが現場で回した生産性向上施策 2025→2026
gessy0129
0
210
go directiveを最新にしすぎないで欲しい話──あるいは、Go 1.26からgo mod initで作られるgo directiveの値が変わる話 / Go 1.26 リリースパーティ
arthur1
2
470
Featured
See All Featured
SEO for Brand Visibility & Recognition
aleyda
0
4.3k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
79
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
260
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
67
37k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
150
A Soul's Torment
seathinner
5
2.4k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.2k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
490
Testing 201, or: Great Expectations
jmmastey
46
8.1k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
130
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
0
2.4k
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