#9554: select related - maximum depth
-----------------------------------+----------------------------------------
          Reporter:  gert          |         Owner:  nobody        
            Status:  reopened      |     Milestone:                
         Component:  Contrib apps  |       Version:  1.0           
        Resolution:                |      Keywords:  select related
             Stage:  Unreviewed    |     Has_patch:  0             
        Needs_docs:  0             |   Needs_tests:  0             
Needs_better_patch:  0             |  
-----------------------------------+----------------------------------------
Comment (by gert):

 ramiro: yes, I only picked it up in the admin contrib app. At that stage I
 was unaware of the depth=X parameter. I think it adequately addresses the
 issue for custom applications, also I don't think internally
 select_related needs to drop the 5 down to 3.


 BUT, for the admin application I think a tweak is required. Arguments for
 explicitly lowering select_related for admin to say 3 :) are;

 1) Whatever value you take must hit the sweat spot for 90% of situations
 otherwise it will slow down rather than increase overall application
 speed. I can not even think of an example where I want to go down 5
 levels. (object.level1.level2.level3.level4.level5)

 2) Remember that the effect on the database increases exponentially, e.g.

 3 levels 2 references per object => 3^2^ = 9 DB tables

 5 levels 2 references per object => 5^2^ = 25 DB tables

 5 levels 3 references per object => 5^3^ = 125 DB tables

-- 
Ticket URL: <http://code.djangoproject.com/ticket/9554#comment:5>
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to