Documentation should mention that QuerySet.iterator() method doesn't affect db driver
|Reported by:||jtiai||Owned by:||nobody|
|Severity:||Normal||Keywords:||orm large dataset psycopg2|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Some Python database drivers, like psycopg2 does caching if using client side cursors (instantiated with connection.cursor() call).
Driver itself will still cache all data from queryset causing in huge datasets massive usage of memory even Django documentation suggests that using QuerySet.iterator() doesn't cache anything. It should be noted that database drivers still might do that.
Side-effects: This also will lead to double caching in normal situations. First psycopg2 caches raw queryset itself and after that Django caches queryset.
Change History (9)
comment:1 Changed 6 years ago by gabrielhurley
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Accepted
Changed 4 years ago by timo
comment:7 Changed 4 years ago by Tim Graham <timograham@…>
- Resolution set to fixed
- Status changed from new to closed