#11604: ChangeList should pass depth=1 to .select_related()
---------------------------------------------+------------------------------
          Reporter:  rlaa...@wiktel.com      |         Owner:  nobody         
            Status:  new                     |     Milestone:                 
         Component:  django.contrib.admin    |       Version:  1.0            
        Resolution:                          |      Keywords:  efficient-admin
             Stage:  Design decision needed  |     Has_patch:  1              
        Needs_docs:  0                       |   Needs_tests:  0              
Needs_better_patch:  0                       |  
---------------------------------------------+------------------------------
Comment (by ishirav):

 Yes! Please please please apply this patch. We've seen ridiculous queries
 joining 20 or more tables needlessly, and MySQL hanging while trying to
 run these queries.

 As a temporary workaround, here's a way to override the select_related
 depth in the admin queryset:

 {{{
 class FoobarAdmin(admin.ModelAdmin):
     def queryset(self, request):
         qs = super(FoobarAdmin, self).queryset(request)
         return qs.select_related(depth=1)

 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/11604#comment:6>
Django <http://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-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to