~/talk

Auto-prefetching with model field fetch modes in Django 6.1

Talkat DjangoCon Europe 2026 · 2026-04-15..04-19· [django, web-performance]
links:none on file
slides:none on file

Django 6.1 adds concrete fetch modes that automatically prefetch single-valued relations without listing fields, shipping fetch_peers (just-in-time prefetch), raise mode (error on unexpected access) and the default fetch_one. It demonstrates configuring modes on model managers, shows how to write a custom mode that logs a warning instead of raising, and explains tradeoffs: lazy prefetching increases the race window, does not cover multivalued relations, and can amplify existing overfetching if applied indiscriminately.

AI-written summary · about

  1. 0:00Introduction
  2. 0:24About the speaker
  3. 1:27What fetch modes solve
  4. 4:36Traditional N+1 solutions
  5. 6:24Fetch peers vs select related
  6. 8:08Fetch modes in Django 6.1
  7. 11:42History of fetch modes
  8. 12:45Single valued relationships
  9. 13:48Pitfalls with fetch peers
  10. 15:56Lazy fetching implications
  11. 17:40Reducing boilerplate with managers
  12. 18:42Raise mode for debugging
  13. 19:06Creating custom fetch modes
  14. 20:11Q&A begins
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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.