Django 6.1's tip Fetch Modes: #python #django #fetch_modes
Django 6.1 fixes N+1 without you rewriting your queries you never touch the for loop. You just tell the queryset how permissive it should be about surprise trips to the database — and FETCH_PEERS quietly turns "101 queries" into "2 queries" with zero extra code at the call site.
Docs
Django 6.1 fixes N+1 without you rewriting your queries you never touch the for loop. You just tell the queryset how permissive it should be about surprise trips to the database — and FETCH_PEERS quietly turns "101 queries" into "2 queries" with zero extra code at the call site.
Docs
❤3