#19578: lazy prefetch_related
-------------------------------------+-------------------------------------
     Reporter:  g00fy                |                    Owner:  nobody
         Type:  New feature          |                   Status:  closed
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |               Resolution:  wontfix
     Severity:  Normal               |             Triage Stage:
     Keywords:  prefetch_related     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by akaariai):

 * status:  new => closed
 * needs_docs:   => 0
 * resolution:   => wontfix
 * needs_tests:   => 0
 * needs_better_patch:   => 0


Comment:

 I am going to close this.

 There are two reasons for this:
   1. I don't see any easy way to achieve this. Implementing this is likely
 possible, but it is going to cost us in code complexity.
   2. Lazy prefetch_related might lead to situations where prefetch_related
 is littered just in case in get_query_set() of base manager. This has the
 side effect that if you access toppings.all() for one object, then you are
 going to do a prefetch for the whole queryset. In short, it will be harder
 to understand what queries are made and when which isn't a nice property
 to have in the ORM.

 If there is an easy way to make this achievable in 3rd party app, then
 lets add that into core. But that is separate ticket's issue, and that
 ticket should be opened only if it is accompanied with an idea how to
 achieve the wanted result.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/19578#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 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 https://groups.google.com/groups/opt_out.


Reply via email to