~/talk

Auto-prefetching with model field fetch modes in Django 6.1

Talkat DjangoCon US 2026 · 2026-08-24..08-28· [web-platform, web-performance]
links:none on file
slides:none on file

Django 6.1 introduces model field fetch modes that change how deferred fields load: fetch_peers auto-prefetches single-valued relations (acts like on-demand prefetch_related and cascades down single-value chains), fetch_raise surfaces N+1 as exceptions, and fetch_1 preserves the old serial fetch. Configure modes per model via managers or call .fetch_mode on a QuerySet; you can write custom modes or fallbacks that warn then fetch_1. Tradeoffs: it can amplify existing over‑fetching, break assumptions about serial updates, and widen race windows; measure impact with Django Debug Toolbar or the queries test helper.

AI-written summary · about

  1. 0:00Introduction and speaker background
  2. 1:13N+1 queries problem explained
  3. 5:25Existing ORM helpers: select_related and prefetch_related
  4. 7:00Introducing fetch modes in Django 6.1
  5. 8:25Fetch modes: peers, raise, and default behavior
  6. 9:30Use cases and limitations of fetch peers
  7. 12:28History and development of fetch modes
  8. 13:54When not to use fetch peers
  9. 15:53Fetch raise mode for debugging and production
  10. 16:18Avoiding repetition with model managers
  11. 17:28Global settings and future of fetch modes
  12. 18:35Extending fetch modes and custom behavior
  13. 19:41Call to action and community involvement
  14. 20:03Q&A session
~/search
type to search 6,518 conferences, 143,918 speakers and 192,133 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.