Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.4.X] Fixed #13869 - Warned that QuerySet.iterator() doesn't affect…

… DB driver caching; thanks jtiai for the suggestion.

Backport of 2f722d9 from master
  • Loading branch information...
commit 6c1c490f64bb5114570a45a523bec365f89f681d 1 parent 13bbe91
Tim Graham authored

Showing 1 changed file with 10 additions and 0 deletions. Show diff stats Hide diff stats

  1. 10  docs/ref/models/querysets.txt
10  docs/ref/models/querysets.txt
@@ -1451,6 +1451,16 @@ evaluated will force it to evaluate again, repeating the query.
1451 1451
 Also, use of ``iterator()`` causes previous ``prefetch_related()`` calls to be
1452 1452
 ignored since these two optimizations do not make sense together.
1453 1453
 
  1454
+.. warning::
  1455
+
  1456
+    Some Python database drivers like ``psycopg2`` perform caching if using
  1457
+    client side cursors (instantiated with ``connection.cursor()`` and what
  1458
+    Django's ORM uses). Using ``iterator()`` does not affect caching at the
  1459
+    database driver level. To disable this caching, look at `server side
  1460
+    cursors`_.
  1461
+
  1462
+.. _server side cursors: http://initd.org/psycopg/docs/usage.html#server-side-cursors
  1463
+
1454 1464
 latest
1455 1465
 ~~~~~~
1456 1466
 

0 notes on commit 6c1c490

Please sign in to comment.
Something went wrong with that request. Please try again.