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
Redmineのデータ構造が "素晴らしい" 話
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
北亜 - Hokua
May 26, 2026
Programming
56
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Redmineのデータ構造が "素晴らしい" 話
北亜 - Hokua
May 26, 2026
More Decks by 北亜 - Hokua
See All by 北亜 - Hokua
技術書同人誌を出す - for Those Who Output-
hokua_82
1
26
assets:precompileを眺める w/ Propshaft
hokua_82
0
32
Other Decks in Programming
See All in Programming
オーケストレーション記述言語 Katari
yukikurage
0
240
protojson における文字化けの扱い
kazuki1023
0
150
Materialが消えた日 〜真っ白なFlutterキャンバスにRenderObjectで絵を描く〜
umigishiaoi
0
150
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
360
まずはコードより業務と向き合う:テーブル解体のためにPdMを呼んだ話
sakawe_ee
0
180
高橋メソッドでCVE解説シリーズ 〜CVE-2026-112816〜
hakkadaikon
0
230
React Native에 현대적인 빌드 도구 더하기: Rollipop 구현기
leegeunhyeok
0
180
Moscow Python Meetup №112. Как поселить ИИ агентов в event driven архитектуре
moscowdjango
PRO
0
110
あなたの await、OS まで届いてる? strace で覗く JavaScript の非同期
hasutosasaki
1
2.3k
ChromeでローカルLLM
ryu1013
0
200
Apple Intelligenceとオンデバイス時代の到来
yahir0
0
230
AmebaブログはKMPから卒業します
kmars0605
0
330
Featured
See All Featured
WCS-LA-2024
lcolladotor
0
980
Deep Space Network (abreviated)
tonyrice
0
410
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
520
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
400
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
590
Rails Girls Zürich Keynote
gr2m
96
14k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
480
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
4
4.4k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
Designing for Performance
lara
612
70k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
22k
Transcript
Redmineのデータ構造が "素晴らしい" 話 北亜 - Hokua
自己紹介 • 北亜 - ほくあ ◦ @Hokua_82 • Ruby歴 9年
◦ (まともに書いてるのは) 約2年 • 本業 ◦ Rails / React / erb など…… • VRChat ◦ チュートリアル2周目終 ◦ アバター:しなの/真冬
Redmine • プロジェクトマネジメントツール ◦ Ruby on Rails製 • Rubyのチケット管理とかでも使われてたりします ◦
https://bugs.ruby-lang.org/
Redmineの特徴 • 無限に作れる親子 階層 • 深さ上限なしで「無 限に」深い親子階層 が作れる ◦ チケット
◦ プロジェクト ◦ etc……
親子階層が無限 • シンプルに作るなら各チケット(Issue)が parent_id を保持する形が良さそう • 問題点は取得 ◦ チケットの親子階層を解決しようと思うと、クエリを何度も発行する必要がある •
「隣接リスト」と呼ばれている
Redmineの"素晴らしい"解決 - Nested Sets (入れ子集合) • 木構造を作りたい • 各Issueに左端(lft)と右端(rgt)の情報を持たせる •
親の lft , rgt の内側にあるIssueをそのIssueの子孫として扱 う。
Nested Sets - 入れ子集合 (2)
Nested Sets - 入れ子集合 (3)
Nested Setsが得意なこと • 取得が早い • 1クエリで子孫を全て取得可能
ここが辛いよ Nested Sets UPDATEが地獄 追加位置の lftより 右のチケットを全て 更新する必要がある
終わり • DB構造によって得意なことは変わる ◦ Nested Sets ▪ GETは得意 ▪ UPDATEは苦手
◦ 隣接リスト ▪ GETは苦手 ▪ UPDATEは得意 • サービスの特性によって"素晴らしい"データ構造は変わる 参考資料: Bill Karwin『SQLアンチパターン 第2版』オライリー・ジャパン、2025年