Documentation should mention that QuerySet.iterator() method doesn't affect db driver
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)
Triage Stage: |
Unreviewed → Accepted
|
Severity: |
→ Normal
|
Type: |
→ New feature
|
Cc: |
timograham@… added
|
Has patch: |
set
|
Resolution: |
→ fixed
|
Status: |
new → closed
|
See e.g. http://initd.org/psycopg/docs/usage.html#server-side-cursors