#ORM
3 posts
9 min read
Django Advanced #3: Query optimization — N+1, select_related, EXPLAIN, indexes
From the anatomy of N+1 to select_related/prefetch_related, only/defer, EXPLAIN, indexes, bulk_*, and select_for_update — the performance toolbox of Django ORM.
8 min read
Django Intermediate #2: ORM Advanced — annotate, aggregate, F/Q, prefetch_related
The proper Django ORM tools — aggregation, expressions, complex conditions, relation prefetch. The N+1 problem and how to solve it.
7 min read
Django Basics #3: Models and ORM Basics
Define Django models, walk the migration flow, set up ForeignKey/ManyToMany, and use QuerySet filter/get/exclude/order_by — all in one place.