Changes between Version 1 and Version 2 of CookBookPreloadRelated


Ignore:
Timestamp:
Apr 5, 2006, 3:36:38 PM (19 years ago)
Author:
Antti Kaihola
Comment:

added note about magic-removal

Legend:

Unmodified
Added
Removed
Modified
  • CookBookPreloadRelated

    v1 v2  
    2323{{{preload_related()}}} will create one SQL query for each related model. This is a huge improvement, since previously every access to, say, {{{user.userproperty_set.all()}}} would run a separate SQL query. In one of my more complex views, this reduced the number of queries from over 6000 to just eight.
    2424
     25The attached file contains an implementation of {{{preload_related()}}} for the magic-removal branch.
     26
    2527-- ''akaihola'' 2006-04-05
Back to Top