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
北亜 - Hokua
May 26, 2026
Programming
54
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
25
assets:precompileを眺める w/ Propshaft
hokua_82
0
26
Other Decks in Programming
See All in Programming
クラウドゲーミングのパフォーマンス最適化に挑む / Cloud Gaming Performance Tuning
vivion
0
310
エージェントを使い続けるためのメタワーク / Meta-work for keeping using the agent
rkaga
6
2.1k
Compiling a real-world CLI tool to native with Static Hermes
tmikov2023
0
140
No More NoSuchMethodError
exoego
1
120
社内AIエージェント「Askワンバン」における コストチューニングの取り組み
t0yohei
0
120
AI時代のシニアエンジニアとは
yosuke_furukawa
PRO
13
11k
ActionController meets Protocol Buffers
sorah
1
760
パスワード再設定メールのURLについて知っておこう
uyuki234
0
200
Web3Dライブラリを作ってVue Custom Rendererの仕組みを理解しよう / lets learn vue custom renderer by making 3d library
drumath2237
1
110
私なりのハーネスエンジニアリング ~独自の言語処理系の開発を通して~
seosoft
0
150
Vapor Mode でアクセシビリティは 壊れないか検証した話
fuqda
1
280
S3 TablesのIcebergデータに、AIエージェントからアクセスしてみた / 20261016developersio2026joetsu-accessing-iceberg-in-s3tables-via-agent
kasacchiful
PRO
0
240
Featured
See All Featured
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
2
340
Thoughts on Productivity
jonyablonski
76
5.4k
Become a Pro
speakerdeck
PRO
31
6.3k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
290
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
Six Lessons from altMBA
skipperchong
29
4.5k
Making the Leap to Tech Lead
cromwellryan
135
10k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
570
Docker and Python
trallard
47
4.2k
Designing for humans not robots
tammielis
254
26k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
340
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年