<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>7270</bug_id>
          
          <creation_ts>2015-01-30 15:39:40 +0000</creation_ts>
          <short_desc>Make django use a single query on queries using foreign key</short_desc>
          <delta_ts>2015-04-30 14:35:04 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>Toaster</product>
          <component>toaster</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>Future</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Wood">michael.g.wood</reporter>
          <assigned_to name="Alexandru Damian">alexandru.damian</assigned_to>
          <cc>alexandru.damian</cc>
    
    <cc>belen.barros.pena</cc>
    
    <cc>bluelightning</cc>
    
    <cc>cristiana.voicu</cc>
    
    <cc>jessica.zhang</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>48439</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Wood">michael.g.wood</who>
    <bug_when>2015-01-30 15:39:40 +0000</bug_when>
    <thetext>When we&apos;re querying the db and we want to access items from their foreign key e.g. Layer_Version.Layer if we use &apos;select_related&apos; which tells django that we&apos;re going to need the items in the foreign table then it&apos;s able to do a inner join instead of running a lookup query for each item.

https://docs.djangoproject.com/en/1.7/ref/models/querysets/#select-related

I implemented this in the error-report-web and it&apos;s a big performance win when returning larger data sets</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>48894</commentid>
    <comment_count>1</comment_count>
    <who name="Alexandru Damian">alexandru.damian</who>
    <bug_when>2015-02-17 18:01:03 +0000</bug_when>
    <thetext>partially implemented in adamian/20150217_bug_7004 because of annoying issues when refreshing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50646</commentid>
    <comment_count>2</comment_count>
    <who name="Alexandru Damian">alexandru.damian</who>
    <bug_when>2015-04-30 14:35:04 +0000</bug_when>
    <thetext>All identified performance bottlenecks due to multiple linked requests have been changed to select_related, or batched array-based selection, and patches merged.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>