Re:Ban 1+N in Django
by lr4444lr on Sunday March 26, 2023 @05:34PM
(#35319875)
I don't disagree with the author in principle, but I find once the data gets big enough where it makes a difference, I've already shifted to using ".values()" to avoid the overhead of model creation, and the KeyErrors that will throw if I leave the query lazy is tantamount to the solution he describes.
[ Parent
| on HN ]
I usually use `.values()` and `.values_list()` only when model creation is really slow. Usually many rows fetched.