Skip to content

Commit

Permalink
Fixed #13869 - Warned that QuerySet.iterator() doesn't affect DB driv…
Browse files Browse the repository at this point in the history
…er caching; thanks jtiai for the suggestion.
  • Loading branch information
timgraham committed Oct 20, 2012
1 parent 4b27813 commit 2f722d9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/ref/models/querysets.txt
Expand Up @@ -1456,6 +1456,16 @@ evaluated will force it to evaluate again, repeating the query.
Also, use of ``iterator()`` causes previous ``prefetch_related()`` calls to be
ignored since these two optimizations do not make sense together.

.. warning::

Some Python database drivers like ``psycopg2`` perform caching if using
client side cursors (instantiated with ``connection.cursor()`` and what
Django's ORM uses). Using ``iterator()`` does not affect caching at the
database driver level. To disable this caching, look at `server side
cursors`_.

.. _server side cursors: http://initd.org/psycopg/docs/usage.html#server-side-cursors

latest
~~~~~~

Expand Down

0 comments on commit 2f722d9

Please sign in to comment.