Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Meeting show pages run 63-93 queries per request (attendee N+1)

オープン 初心者向け
#2,953 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
74/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
rails, ruby

調査の方向性

MeetingsController#show と app/views/meetings/show.html.haml から始めて、参加者とそのメンバーがどのように読み込まれ、レンダリングされるかを追跡します。変更を加える前に、Codebar requests dashboard で現在のクエリ数を再計測してください。完了の条件は、show ページが同一にレンダリングされ、queries_count の p50 が報告されている ~63 から一桁台に低下することです。

索引モデルが issue の本文から書いたものです。

説明

performance

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

  1. Preload members: @meeting.invitations.where(attending: true).includes(:member)
  2. Check members/organisers_grid for the same pattern on @meeting.organisers
  3. 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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

codebar/planner のほかの issue

codebar/planner の issue をすべて見る

似ている issue

Ruby の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。