QuerySet .iterator() loads everything into memory anyway
|Reported by:||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:||1.1|
|Severity:||Keywords:||orm, cache, iterator|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Iterating through the result of .iterator() still causes a huge spike in memory consumption. In contrast, loading only one record with [:1] does not.
Others have run into this problem:
Notice his follow-up comment to the suggestion of using .iterator():
"Its still chewing through a ton of RAM when I use your call. :("
This has been my experience as well.
Change History (5)
comment:1 Changed 7 years ago by
|Patch needs improvement:||unset|
|Status:||new → closed|