Documentation should mention that QuerySet.iterator() method doesn't affect db driver
|Reported by:||Jani Tiainen||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.