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
5分でわかるAdequateRecord
Search
Tomohiro MITSUMUNE
October 31, 2014
Programming
480
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
5分でわかるAdequateRecord
#dena_rubykaigi01 LT資料
Tomohiro MITSUMUNE
October 31, 2014
More Decks by Tomohiro MITSUMUNE
See All by Tomohiro MITSUMUNE
某サービスのリニューアルでECSを導入したよもやま話
tmitz
1
3k
Swift2 New Features
tmitz
0
150
Other Decks in Programming
See All in Programming
すこし踏み込む CancellationToken
htkym
2
1.7k
Optunaを作ったときにやりたかったこと、その後 (2026/10/16, Optuna Meetup #3)
iwiwi
1
390
當我們開始不讀 Code - AI Agent 時代,Code Review 與 Clean Code 還剩下什麼?
jame2408
1
120
モデルのリファクタリングが難しいと思ったら、そもそも複雑だったのはビジネス仕様だった ? / is-the-business-domain-the-real-complexity
hatsu38
0
480
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
150
wkhtmltopdfの次どうするか問題2026
willnet
2
1.9k
Apple Intelligence を用いた個人情報誤送信防止、及びユーザーリクエスト体験の改善について
yukiny
0
350
Starting & Sustaining Code-Based E2E Testing for Non-Coding QA Teams( #jasstniigata )
teyamagu
PRO
1
990
Androidだけじゃない、DroidKaigiで広がった私の技術スタック
akkeylab
0
130
Everything will be SERVERLESS — 信じて運用した10年の経験値 / Everything Will be Serverless — Lessons Learned from 10 Years of Operational Experience
seike460
PRO
1
1k
Next.js: The final boss of Web Performance
guaca
0
100
Railsのためのパスキー実践入門 〜マルチテナントSaaSでの意思決定〜
utakaha
1
290
Featured
See All Featured
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
570
Mind Mapping
helmedeiros
1
400
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
300
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.8k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
270
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
330
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
570
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
460
Typedesign – Prime Four
hannesfritz
42
3.2k
Practical Orchestrator
shlominoach
192
12k
Transcript
5ͰΘ͔Δ AdequateRecord @t_mitz
࠷ॳʹ
"[VTBUIFNF ͔ͿΓ͗͢Ͱ͢ ਓ IUUQTHJUIVCDPNTBOPHSBQIJYB[VTBLFZOPUF
2"EFRVBUF3FDPSE JTԿ
"3BJMTͰՃ͞ΕΔ .BKPS'FBUVSFTͷͭ
Rails 4.2ͷMajor Features • ActiveJob • AdequateRecord • Web Console
• Foreign key support
ݱࡏɺCFUB ͋ͨΓʹຊϦϦʔε͞Εͦ͏
ͱࡢॻ͍ͨΒ ຊCFUBϦϦʔε ͞Εͯ·ͨ͠ IUUQXFCMPHSVCZPOSBJMTPSH3BJMT CFUBIBTCFFOSFMFBTFE
ؓٳ
–Rails 4.2 Release Notes “Adequate Record is a set of
refactorings that make Active Record find and find_by methods and some association queries upto 2x faster.”
ࡶʹ༁͢ͱ
lϦϑΝΫλϦϯάͰ "DUJWF3FDPSEΛ ഒͨͥ͘͠ʂz
None
lਪଌ͢ΔͳܭଌͤΑz ͷֶʹج͖ͮϕϯνϚʔΫ
IUUQUFOEFSMPWFNBLJOHDPN BEFRVBUFSFDPSEQSPMJLFBDUJWFSFDPSEIUNM
3BJMT 3BJMTCFUB
ϗϯτʹ ഒʂʂʂ
੍͕͋Γ·͢
OK Query Article.find 1 Article.find_by_title ‘foobar’ ! article
= Article.find 2 article.comments
NG Query Article.where(title: ‘foobar’)
.where(user: 1) ! Article.find(1, 2, 3) ! Article.find_by ‘published_at < ?’, 2.weeks.ago
ҰମͲ͏ͬͯ ͯ͘͠Δͷ͔
None
IUUQUFOEFSMPWFNBLJOHDPN BEFRVBUFSFDPSEQSPMJLFBDUJWFSFDPSEIUNM
42-4USJOHͷ 5SBOTGPSNΛຖճͤͣ Ωϟογϡͯ͠ߴԽ
ಥવͷ ίʔυϦʔσΟϯά
;ΉɺCSBODI͕͋ΔΒ͍͠ http://tenderlovemaking.com/2014/02/19/adequaterecord- pro-like-activerecord.html
None
ແ͍͠ʂʂʂ
NBTUFSʹNFSHF͞Εͨͷ ͰEFMFUF͞Ε͍ͯ·ͨ͠
DPNNJUMPH͔ΒͦΕΆ͍࣮ Λ୳͢͜ͱํʹมߋ
͕Ή͠ΌΒʹίʔυͬͯ ͭΒ͍ͷͰώϯτ୳͠
;Ήɺ3BJMTϦϦʔεͨ͠ޙʹ NFSHF͢Δએݴ http://tenderlovemaking.com/2014/02/19/adequaterecord- pro-like-activerecord.html
Rails 4.1 Released 2014/04/08 IUUQXFCMPHSVCZPOSBJMTPSH3BJMT
IUUQTHJUIVCDPNSBJMTSBJMTDPNNJUTNBTUFS BDUJWFSFDPSE QBHFBVUIPSUFOEFSMPWF
ϦϦʔεʹ NFSHFͯͨ͆͠
None
"DUJWF3FDPSE4UBUFNFOU $BDIFͰΩϟογϡੜͯ͠Δ Έ͍ͨͰ͢Ͷ
ৄ͘͜͠ͷ͋ͨΓͷίʔυ • https://github.com/rails/rails/blob/master/ activerecord/lib/active_record/core.rb • https://github.com/rails/rails/blob/master/ activerecord/lib/active_record/ statement_cache.rb • https://github.com/rails/rails/blob/master/
activerecord/test/cases/statement_cache_test.rb
ͪͳΉͱ"34UBUFNFOU$BDIF ͷςετέʔεʹKPJOXIFSFͰ Ωϟογϡੜͷςετ͕͋ΔͷͰɺ কདྷpOEܥ౷Ҏ֎ վળ͞ΕΔ͔͠Εͳ͍
TL;DR
ಛʹؾʹ͠ͳͯ͘ ͔ΒpOEܥ͕ഒ
Enjoy Rails way!!!