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
47
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
16
assets:precompileを眺める w/ Propshaft
hokua_82
0
23
Other Decks in Programming
See All in Programming
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
5
5.2k
個人開発者よ、Honoを使え(おじさんver)
tanahiro2010
2
260
The Rails Doctrine Decade
koic
2
590
半永久的に提供し続けられるプライベートクラウドを目指して ― 利用者の認知負荷を抑えるAPI抽象化とハードウェア世代交代の基盤設計
tomokon
0
500
Vue Fes Japan の “作る側”に関わってみて
naokihaba
0
160
外から家のPCの電源入れたい!をPHPで解決する
kawashimo0
1
140
Rでドレミ/Do-Re-Mi_with_R
florets1
0
130
npm との違いを手がかりにGo の依存管理を理解したい
optim
0
520
現場と育てるRailsモデリング 〜Spreadsheetから始めたモデル設計〜
siroemk
2
610
APNsからLive Activityを開始する話
yumnumm
0
170
dotNET_vulnclicker_intro.pdf
deka_morita
0
140
[ハンズオン]AIへの指示だけで「五目並べ」を作ってみよう
satoshi256kbyte
1
380
Featured
See All Featured
Visualization
eitanlees
153
17k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Un-Boring Meetings
codingconduct
0
460
Raft: Consensus for Rubyists
vanstee
142
7.8k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
220
Crafting Experiences
bethany
1
380
A Tale of Four Properties
chriscoyier
163
24k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
AI: The stuff that nobody shows you
jnunemaker
PRO
10
1.2k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.6k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
The Pragmatic Product Professional
lauravandoore
37
7.5k
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年