#19080: ChangeList.get_queryset() automatically applies select_related() in a 
very
"brute" way
--------------------------------------+-------------------------
     Reporter:  bberes                |      Owner:  bberes
         Type:  Cleanup/optimization  |     Status:  new
    Component:  contrib.admin         |    Version:  1.4
     Severity:  Normal                |   Keywords:  performance
 Triage Stage:  Unreviewed            |  Has patch:  0
Easy pickings:  0                     |      UI/UX:  0
--------------------------------------+-------------------------
 If there is a '''single''' related field from the listing model in
 `list_display`, `ChangeList.get_queryset` will apply `select_related()` so
 it will join everything, with no depth or field limitations.

 Combined with the fact that there's no documented way to clear that
 (#16856), it's quite undesirable behaviour.

 In my opinion this could be resolved in 2 ways:
 1. Remove that .select_related() call altogether and let the developer
 choose the exact optimization if he is displaying related fields in the
 listing
 2. Optimize the select_related() call so that it's constructed exactly
 based on which fields appear in `list_display`

-- 
Ticket URL: <https://code.djangoproject.com/ticket/19080>
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to