~/talk

Finding and fixing an N+1 problem in the Django docs

Talkat Python Web Conf 2023 · 2023-03-13..03-17· [databases, web-performance]
slides:none on file

Django docs site loads a version picker that was causing 11 queries per page load (one + N), found by Sentry’s new Sentry performance issues detection; the fix is a single-line DB change using select_related to collapse those queries into one. The talk compares detection methods: Django Debug Toolbar, the n+1 Python package, DB-side tools like PG Badger, and suggests running N+1 checks on staging with realistic dumps or automated log parsing to catch hidden ORM inefficiencies.

AI-written summary · about

  1. 0:00Introduction
  2. 1:10What is N+1 problem
  3. 6:31Fixing N+1 in ORMs
  4. 9:01Detecting N+1 problems
  5. 16:47Database-level detection
  6. 20:15Django docs case study
  7. 23:00Sentry performance issues
  8. 25:49Q&A
~/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.