Support prefetch_related() with Queryset.iterator()
I was surprised when I found out that prefetch_related
calls are ignored when using Queryset.iterator
. I noticed in the docs here https://docs.djangoproject.com/en/dev/ref/models/querysets/#iterator that it is because the "these two optimizations do not make sense together." That may have been true in the past, but it is definitely not the case now. The iterator allows chunking (by default 2000) and it would be very helpful to prefetch related for each chunk.
Change History
(12)
Summary: |
Support prefetch_related with Queryset.iterator → Support prefetch_related() with Queryset.iterator()
|
Triage Stage: |
Unreviewed → Accepted
|
Has patch: |
set
|
Needs documentation: |
set
|
Description: |
modified (diff)
|
Version: |
2.1 → master
|
Patch needs improvement: |
set
|
Owner: |
changed from nobody to Jacob Walls
|
Status: |
new → assigned
|
Needs documentation: |
unset
|
Patch needs improvement: |
unset
|
Patch needs improvement: |
set
|
Patch needs improvement: |
unset
|
Triage Stage: |
Accepted → Ready for checkin
|
Resolution: |
→ fixed
|
Status: |
assigned → closed
|
The situation isn't completely straightforward. There's a discussion on django-developers. Accepting the ticket to do something.