ended9월 10일· 1 sources
count() on a prefetched relation is free. filter() costs a query per row.
Why it matters
Twelve queries where you expected two, in a loop that looks like somebody already optimised it. Second of two posts from the same afternoon. The first, Django's .exclude() does not drop your NULL rows...
1
Sources
+0
24h
—
Growth
11d
Active