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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
北亜 - Hokua
May 26, 2026
Programming
58
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Redmineのデータ構造が "素晴らしい" 話
北亜 - Hokua
May 26, 2026
Transcript
11 slides
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年
More Decks by 北亜 - Hokua
See All by 北亜 - Hokua
技術書同人誌を出す - for Those Who Output-
hokua_82
1
27
assets:precompileを眺める w/ Propshaft
hokua_82
0
35
Other Decks in Programming
See All in Programming
AIが実装を担う時代の「技術設計」と「チームマネジメント」
kamina_zzz
2
450
Debian JP Projectのサーバー構成
uwabami
1
180
How SRE Grew Out of Server-Side Work and Became the Team's Own / サーバサイドから始まったSREを チームに渡すまで
maaaato
1
260
Engineering Biometric UX Across Android Versions | DroidKnights 2026
ryunen344
1
220
なぜ私たちは「現時点では」KMPの導入を見送ったのか
chigichan24
1
640
Materialが消えた日 〜真っ白なFlutterキャンバスにRenderObjectで絵を描く〜
umigishiaoi
0
170
ローカルLLMの基本と近況 2611 / Local LLM basics and recent situation 2611
kishida
3
660
ruby/uri meets WHATWG
jinroq
0
140
Claude Code ハーネスDeep Dive – 君はどこまで制御する? -
takateeen_knj
6
6.3k
あなたはMCPの機能を、まだ知らない。
4geru
1
740
はじめてのPLATEAU
nokonoko1203
1
670
Secure Your Coding Agent Like It’s Malware (v1.5) 🇬🇧 @Code.talks 2026
richargh
0
210
Featured
See All Featured
Balancing Empowerment & Direction
lara
6
1.4k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
480
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
61k
For a Future-Friendly Web
brad_frost
184
11k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
2
450
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.5k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
48k
A Soul's Torment
seathinner
9
4k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
680
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Building Adaptive Systems
keathley
44
3.3k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
620