Off the Beaten Path: Exploring Unusual Roads to Django Performance
summary
Shows concrete recipes and numbers: using materialized views (unmanaged Django model + custom SQL/migration command) turns a 6.33s author-aggregation into 3.42ms (~1,800× speedup) for analytics; Django 5 generated fields push a 500k-post annotation from 1m47s to 66.8ms by storing computed values in PostgreSQL; rewriting DISTINCT (99ms) as subquery (23ms) avoids sorting; replacing per-author correlated subqueries (2.23s) with a ROW_NUMBER window (560ms) removes thousands of loops.
AI-written summary · about
chapters (6)
- 0:00Introduction
- 1:14Materialized views
- 6:44Generated fields
- 10:22Distinct vs subqueries
- 11:50ROW_NUMBER for queries
- 16:40Summary and closing
related talks
25mBuilding effective Django queries with expressions
31mHigh Performance Django
47mReal World Django Q&A
47mHigh Performance Django at Ten: Old Tricks & New Picks
42mA Nice Problem to Have: Django Under Heavy Load
26mA Related Matter: Optimizing your webapp
37mPerformant Django
28mThe life of a web request - techniques for measuring and improving Django application performance
