But, why is the admin slow?
summary
Demo uses Django Debug Toolbar to show an admin list view running 204 queries to 4 by switching from a callable unicode to explicit list_display or list_select_related and cutting load from ~28–30ms to ~1.5ms — a 20x speed up on SQLite local. Examples show mistakes with only/defer causing extra per-row queries, when to use list_select_related vs prefetch_related for FKs vs M2M, and using annotate book_count to push counts into SQL. Caching and Redis complete the toolbox.
AI-written summary · about
chapters (7)
- 0:00Start
- 7:31Django Debug Toolbar
- 13:14Use a Custom Query Set
- 13:29Custom Query Sets for Fun and Profit
- 14:38Defer
- 21:25Decrease List per Page
- 24:34Sorting through the List of Sql Queries
related talks
23mOptimizing your webapp by using django-debug-toolbar
26mDjango migrations, friend or foe? Optimize them for testing
25mDjango migrations, friend or foe? Optimize your Django migrations for faster testing
23mEntomology 101: Effective Bug Hunting
50mLightning Talks III
15m"Stress Less: Easy Database Load Testing Using Python and Locust"
33mDjango REST Framework: Moving Past the Tutorial to Production
01h 00mLightning Talks 1
