Meeting show pages run 63-93 queries per request (attendee N+1)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 74/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 領域
- backend, performance
調査の方向性
MeetingsController#show と app/views/meetings/show.html.haml から始めて、参加者とそのメンバーがどのように読み込まれ、レンダリングされるかを追跡します。変更を加える前に、Codebar requests dashboard で現在のクエリ数を再計測してください。完了の条件は、show ページが同一にレンダリングされ、queries_count の p50 が報告されている ~63 から一桁台に低下することです。
索引モデルが issue の本文から書いたものです。
説明
Summary
MeetingsController#show runs 63 queries per request (median), 93 at p95 for a page with ~60 attendees — a classic N+1. Only 412 requests in the last 7 days so this is small in aggregate (1.6% of allocations), but the per-request cost is the worst query-count in the app and cheap to fix.
Measured
7-day window 2026-09-21..27 (canonical logs): 412 requests, allocations p50 25,679, queries_count p50 63, p95 93. Re-measure from current logs before starting.
The loop in app/views/meetings/show.html.haml touches attendee.member.avatar(56) and attendee.member.full_name per row, and @attendees is built without preloading:
@attendees = @meeting.invitations.where(attending: true)
each attendee then triggers a members lookup (plus whatever avatar loading costs).
Suggested directions
- Preload members:
@meeting.invitations.where(attending: true).includes(:member) - Check
members/organisers_gridfor the same pattern on@meeting.organisers - While there:
sanitize(@meeting.description)runs per render — cache the fragment or sanitize on write (same treatment as #2951)
Verify
queries_count p50 for MeetingsController#show drops from ~63 to single digits on the Codebar requests dashboard; page renders identically.
Related: #2951, #2952 (same measurement method)
- 主要言語
- Ruby
- スター
- 104
- フォーク
- 205
- 平均マージ
- 1日 2時間
- マージ済み PR(30日)
- 81
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
codebar/planner のほかの issue
-
good first issue tech debt
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
good first issue refactoring tech debt
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
good first issue tech debt
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
Chapter show pages allocate ~21k+ objects per render for large chapters (18% of app allocations)オープンperformance
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
メンテナーはふだん 1 日以内に返信
codebar/planner の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
data error
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
riscv/riscv-unified-db#2648 ·
メンテナーはふだん 1 日以内に返信
-
P2 testing
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
メンテナーはふだん 1 日以内に返信