Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added warning about the performance of large IN clauses in prefetch_r…

…elated docs

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17147 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit e954a03871cdc1c155ba7a3f3000dcf75998d9f4 1 parent 648adcd
Luke Plant authored November 24, 2011

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

  1. 6  docs/ref/models/querysets.txt
6  docs/ref/models/querysets.txt
@@ -821,6 +821,12 @@ referenced is needed, rather than one query for all the items. There could be
821 821
 additional queries on the ``ContentType`` table if the relevant rows have not
822 822
 already been fetched.
823 823
 
  824
+``prefetch_related`` in most cases will be implemented using a SQL query that
  825
+uses the 'IN' operator. This means that for a large QuerySet a large 'IN' clause
  826
+could be generated, which, depending on the database, might have performance
  827
+problems of its own when it comes to parsing or executing the SQL query. Always
  828
+profile for your use case!
  829
+
824 830
 extra
825 831
 ~~~~~
826 832
 

0 notes on commit e954a03

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