#30842: Prefetch_related spends considerable time constructing querysets.
-------------------------------------+-------------------------------------
Reporter: Alex Aktsipetrov | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: prefetch_related | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Alex Aktsipetrov:
Old description:
> As part of the [https://code.djangoproject.com/ticket/26226 bugfix]
> django started constructing N+1 querysets during a typical
> prefetch_related call while only 2 sql queries are executed.
>
> This adds a noticeable slowdown. Attaching the flamegraph for queryset
> fetching 100 objects.
New description:
As part of the [https://code.djangoproject.com/ticket/26226 bugfix] django
started constructing N+1 querysets during a typical prefetch_related call
while only 2 sql queries are executed.
This adds a noticeable slowdown. Attaching the flamegraph for queryset
fetching 100 objects, roughly 2/3 of the time are spent there.
--
--
Ticket URL: <https://code.djangoproject.com/ticket/30842#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/066.a564125c6fc75043039b7f14cd094c92%40djangoproject.com.