Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta Adatta ai principianti
#2,953 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
74/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rails, ruby

Direzione di ricerca

Inizia da MeetingsController#show e app/views/meetings/show.html.haml per tracciare come vengono caricati e renderizzati i partecipanti e i loro membri. Misura nuovamente il conteggio attuale delle query dal Codebar requests dashboard prima di apportare modifiche. Il lavoro è completato quando la pagina show viene renderizzata in modo identico e il suo p50 di queries_count scende dai ~63 riportati a una cifra singola.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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)

Lingua principale
Ruby
Stelle
104
Fork
205
Merge medio
1g 2h
PR unite (30g)
81

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di codebar/planner

Tutte le issue di codebar/planner

Issue simili

Altre issue su Ruby

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.