Optimize Python & Django apps with Postgres superpowers
summary
Shows exact fixes and measurements: use pg_stat_statements and Postgres logs to find offenders, cut 101 queries down to 6 with prefetch_related and limiting columns with only, avoid 96 per-page queries that explode with 1,000,000 rows, replace offset/limit with keyset pagination to halve DB time (1.2s → 628ms in the demo), add a partial index to remove sequential scans, and scale out with Hyperscale (Citus) when a single node maxes out.
AI-written summary · about
chapters (15)
- 0:00Intro
- 5:49pg_stat_statements / analyzing performance
- 6:29Query Performance Insights / on Azure
- 7:01Performance Recommendations / on Azure
- 8:59Logs on Postgres / are they useful?
- 14:33Loops, once upon a thousand times
- 16:37CATCHING LOOPS ON PROD
- 18:11Limiting what you are selecting
- 21:17Pagination / why is paginating so important?
- 22:14Pagination / Default paginator class
- 27:50Keyset pagination / why you should care
- 31:44Fixing a slow query / Looking into EXPLAIN
- 33:01Fixing a slow query / adding a partial index
- 34:51Fixing a slow query / scaling UP your server
- 39:28Your 8 takeaways, the Postgres superpowers
related talks
41mOptimizing your app by understanding your PostgreSQL database
46mPostgreSQL Beyond Django: Strategies to Get Max Performance with Álvaro Justen
23mDjango with PostgreSQL superpowers
22mDjango with PostgreSQL superpowers
34mSimple and Awesome Database Tricks
31mUsing Databases to pull your applications weight
44mPostgreSQL in Django 1.8
30mPuny to Powerful PostgreSQL Rails Apps
