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
5分でわかるAdequateRecord
Search
Tomohiro MITSUMUNE
October 31, 2014
Programming
480
1
Share
5分でわかるAdequateRecord
#dena_rubykaigi01 LT資料
Tomohiro MITSUMUNE
October 31, 2014
More Decks by Tomohiro MITSUMUNE
See All by Tomohiro MITSUMUNE
某サービスのリニューアルでECSを導入したよもやま話
tmitz
1
2.9k
Swift2 New Features
tmitz
0
140
Other Decks in Programming
See All in Programming
의존성 주입과 모듈화
fornewid
0
160
Claude Codeをカスタムして自分だけのClaude Codeを作ろう
terisuke
0
160
2026-04-15 Spring IO - I Can See Clearly Now
jonatan_ivanov
1
160
Making the RBS Parser Faster
soutaro
0
650
Symfony AI in Action - SymfonyLive Berlin 2026
chr_hertel
1
110
My daily life on Ruby
a_matsuda
2
160
Firefoxにコントリビューションして得られた学び
ken7253
2
150
ローカルLLMでどこまでコードが書けるか / How much code can be written on a local LLM
kishida
2
200
第3木曜LT会 #28
tinykitten
PRO
0
120
Import assertionsが消えた日~ECMAScriptの仕様はどう決まり、なぜ覆るのか~
bicstone
2
170
10 Tips of AWS ~Gen AI on AWS~
licux
5
520
Spec-Driven Development with AI Agents (Workshop, May 2026)
antonarhipov
2
280
Featured
See All Featured
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
730
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
140
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
300
Being A Developer After 40
akosma
91
590k
Documentation Writing (for coders)
carmenintech
77
5.3k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
110k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.7k
The SEO Collaboration Effect
kristinabergwall1
1
440
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
230
WCS-LA-2024
lcolladotor
0
570
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!!!