Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đã đóng Phù hợp với người mới
#2,953 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
74/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rails, ruby
Lĩnh vực
backend, performance

Hướng nghiên cứu

Bắt đầu với MeetingsController#show và app/views/meetings/show.html.haml để theo dõi cách những người tham dự và các thành viên của họ được tải và render. Đo lại số lượng query hiện tại từ Codebar requests dashboard trước khi thực hiện thay đổi. Được coi là hoàn tất khi trang show được render giống hệt và p50 của queries_count giảm từ mức ~63 được báo cáo xuống còn một chữ số.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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)

Ngôn ngữ chính
Ruby
Star
104
Fork
205
Merge trung bình
1 ngày 2 giờ
Pull request đã merge (30 ngày)
77

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của codebar/planner

Tất cả issue của codebar/planner

Issue tương tự

Thêm issue về Ruby

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.