mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	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
This commit is contained in:
		| @@ -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 | additional queries on the ``ContentType`` table if the relevant rows have not | ||||||
| already been fetched. | 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 | extra | ||||||
| ~~~~~ | ~~~~~ | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user