Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭 适合新手
#2,953 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
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 小时
30 天内合并 PR
81

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

codebar/planner 的其他 Issue

查看 codebar/planner 的全部 Issue

相似的 Issue

更多 Ruby Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。