~/talk

Partitioning very large tables with Django and PostgreSQL

Talkat DjangoCon Europe 2026 · 2026-04-15..04-19· [databases]
slides:none on file

A real production case has a 3 TB table with 9 billion rows receiving 20–30 million updates per day, where autovacuuming takes 16–20 hours and blocks schema work. The chosen solution is range partitioning on the primary key using an mammoth-first partition technique: rename the table, create a partitioned table, attach the old table as the first partition, add an empty new partition, and perform fast metadata-only constraints and an atomic switch via a custom Django migration to avoid copying all data.

AI-written summary · about

  1. 0:00Introduction and speaker welcome
  2. 1:05Speaker introduction and background
  3. 3:12What is table partitioning?
  4. 6:22Partitioning as a leaky abstraction
  5. 7:27Why partition tables?
  6. 8:30When to consider partitioning
  7. 8:51Key partitioning decisions
  8. 10:14Partitioning design principles
  9. 10:56Partition pruning explained
  10. 12:22Partitioning limitations
  11. 13:03Django and partitioning
  12. 14:47Tools for partitioning in Django
  13. 15:30Case study workflows step table
  14. 16:56Choosing partition key
  15. 19:05Online partitioning method
  16. 21:31Partitioning process details
  17. 25:04SQL for partitioning workflow
  18. 26:09Query performance after partitioning
  19. 27:37Current status and next steps
  20. 28:00Caveats and schema changes
  21. 28:41Conclusions and takeaways
  22. 29:02Q&A session
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.