Representing Hierarchies in Relational Databases
summary
Relational parent-pointer trees force one database round trip per depth level unless the DB supports WITH RECURSIVE; using that, django-tree implements CTE traversal but is Postgres‑only and alpha. Materialized path (Vadim Tropashko) stores a path string so subtree queries use a single indexed LIKE/starts-with; Django Treebeard uses step length 4 (default) yielding about 1.6 million immediate children capacity per node. Nested sets (django-mptt) give single-query reads but require wide updates on inserts/deletes.
AI-written summary · about
chapters (5)
related talks
24mMany-to-many, minus the middleman
38mModern B-Tree techniques
22mDjango with PostgreSQL superpowers
24mOf Django, PostgreSQL schemas, and your multi-million dollar idea
44mPostgreSQL in Django 1.8
33mHow to Make Your Backend Roar
42mDjango ORM: The MTI vs STI Showdown
21mActual trees, not b-trees: or how I found PostgreSQL through PostGIS
