~/talk

A Related Matter: Optimizing your webapp

Talkat DjangoCon US 2024 · 2024-09-22..09-27· [django, web-performance]
slides:none on file

Shows how django-debug-toolbar surfaces an N+1 problem in a toy blog app and how using select_related()/prefetch_related() collapses ~50 SQL queries down to two or seven, with concrete examples for foreign keys, many‑to‑many likers and comment submitters. Demonstrates QuerySet laziness and immutability, logging and DB general‑log techniques to capture queries, explains that prefetch assembles related rows in Python, and warns about pathological users and watching 95th/99th percentile latency.

AI-written summary · about

  1. 0:00Introduction
  2. 1:29Django tool and limits
  3. 2:54Django query sets
  4. 4:43Debugging SQL queries
  5. 8:19N+1 problems with toolbar
  6. 12:52Fix N+1 with select_related
  7. 15:21Optimize many-to-many with prefetch_related
  8. 20:14Complex query optimizations
  9. 22:00Query optimization summary
  10. 23:05Q&A prefetch_related
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 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
?
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.