Advanced Indexing and Concurrency in Django and PostgreSQL
summary
Builds a Django URL-shortener and uses PostgreSQL EXPLAIN ANALYZE and SQL logging to compare real effects of indexes. Shows index-only scan by including URL in the unique index to drop a disk fetch, and a function-based index turning a 3s domain regex scan into ~50ms (≈60×). Demonstrates partial index reduced size from 7MB to 88KB for hits=0, and a hash index that cuts URL index from 47MB to 32MB and runs faster; BRIN trades space (64KB) for slightly higher latency on correlated timestamps.
AI-written summary · about
chapters (16)
- 0:00Introduction and speaker intro
- 1:11Speaker background and talk overview
- 3:24Building the URL shortener demo
- 4:26Inspecting Django SQL queries
- 8:19Understanding B-tree indexes
- 13:15Inclusive covering indexes
- 16:31Partial indexes explained
- 21:10Function-based indexes
- 25:55Finding unused keys
- 30:56Reverse URL lookup
- 38:18Hash indexes deep dive
- 47:00Index size and performance comparison
- 56:40Block range indexes (BRIN)
- 1:08:14Common index misconceptions
- 1:12:52Summary of indexing techniques
- 1:13:56Q&A session
