summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Plant <L.Plant.98@cantab.net>2011-11-24 17:18:56 +0000
committerLuke Plant <L.Plant.98@cantab.net>2011-11-24 17:18:56 +0000
commite954a03871cdc1c155ba7a3f3000dcf75998d9f4 (patch)
tree99273dcba4a2ecb8a261840cc35d3451bb1b7b68
parent648adcd35ff76f56f0df88d3a7519a439da96f46 (diff)
Added warning about the performance of large IN clauses in prefetch_related docs
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17147 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--docs/ref/models/querysets.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt
index 9736d94838..6f2cad3464 100644
--- a/docs/ref/models/querysets.txt
+++ b/docs/ref/models/querysets.txt
@@ -821,6 +821,12 @@ referenced is needed, rather than one query for all the items. There could be
additional queries on the ``ContentType`` table if the relevant rows have not
already been fetched.
+``prefetch_related`` in most cases will be implemented using a SQL query that
+uses the 'IN' operator. This means that for a large QuerySet a large 'IN' clause
+could be generated, which, depending on the database, might have performance
+problems of its own when it comes to parsing or executing the SQL query. Always
+profile for your use case!
+
extra
~~~~~