Author: lukeplant Date: 2011-11-24 09:18:56 -0800 (Thu, 24 Nov 2011) New Revision: 17147
Modified: django/trunk/docs/ref/models/querysets.txt Log: Added warning about the performance of large IN clauses in prefetch_related docs Modified: django/trunk/docs/ref/models/querysets.txt =================================================================== --- django/trunk/docs/ref/models/querysets.txt 2011-11-24 13:17:24 UTC (rev 17146) +++ django/trunk/docs/ref/models/querysets.txt 2011-11-24 17:18:56 UTC (rev 17147) @@ -821,6 +821,12 @@ 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 ~~~~~ -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.