Repository navigation
perf: optimize queries for the meeting materials page - #12025
Merged
jennifer-richards merged 7 commits intoDec 3, 2026
Merged
Conversation
Move the active-materials Prefetch that the agenda helper and the group meetings view each built into active_materials_prefetch(), add SessionQuerySet.with_active_materials(), and use it for the sessions on /meeting/<num>/materials. Session.get_material() no longer replaces meeting_related() on prefetched documents. The prefetch carries the documents' states, so the real check costs no queries, and the replacement linked slides whose reuse policy is not "single" to meeting URLs that do not serve them. The agenda paths cache each document's href before calling get_material(), so their output does not change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drafts have no "deleted" state, so the prefetched active materials hold all of a session's drafts. Drafts carry no presentation order, so the order they are listed in remains unspecified. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Factor the official-assignment lookup out of set_order_in_meeting() into official_timeslotassignments() and add set_official_timeslotassignments(), which fills Session.official_timeslotassignment() for a list of sessions with one query. The materials view uses it before organizing sessions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add SessionQuerySet.with_has_attendance() and let organize_proceedings_sessions() use its annotation instead of querying Attended for each session. Prefetch the sessions' presentations so that the presentations.exists() check reads the prefetched rows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each row's last update was found by calling all_meeting_slides() and all_meeting_agendas() on every session, which re-fetched all of the group's sessions and their materials. Group the page's scheduled sessions, which are the same sessions all_meeting_sessions_for_group() returns, and read their prefetched materials instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Updated column was computed for every table except Other, so its rows always showed a blank. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fetch the meeting's proceedings materials once, with their documents and states, instead of once per material type. ProceedingsMaterial is unique per meeting and type, so the result is the same. Also reuse the correction cutoff date the view has already computed, and have get_meeting() call first() without a preceding exists(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #12025 +/- ##
==========================================
- Coverage 89.26% 89.24% -0.03%
==========================================
Files 343 343
Lines 46803 46831 +28
==========================================
+ Hits 41781 41795 +14
- Misses 5022 5036 +14 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
jennifer-richards
approved these changes
Dec 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The materials page for IETF 126 drops from 5,318 queries to 39, and for IETF 127 (the current default) from 4,108 to 33. IETF 126 renders in under a second instead of 5–8 s.
The rendered pages for IETF 126 and 127 are byte-identical to main except for two changes:
order0, so the old list came out in whatever order the database returned it, and so does the new one, from a different query. No row gains or loses a draft.For IETF 120, 124 and 125, every row matches main once draft order is ignored, and every Updated time is identical.
get_material()no longer replacesmeeting_related()on prefetched documents. That replacement sent slides without asinglereuse policy to meeting URLs that return 404. The agenda paths cache each document's link before callingget_material(), and their output (agenda data,.txt,.json,.ics, session materials, group meetings) is unchanged.🤖 Generated with Claude Code