title: Query takes long in Codeigniter than in Phpmyadmin
body: <p>I've got the following query, and in phpmyadmin it takes 0.055 seconds, but in CodeIgniter the exact same query takes more then 2 seconds. Anybody got an idea what the problem might be?</p>
  
  <p>The query only gives about 25 results, so that shouldn't be any problem...</p>
  
  <p>Here's the query</p>
  
  <pre><code>SELECT `Qty`, `Invt`, `ClassNr`, `SubPartCode`, `Description`, `DesignCode`, `Measure`, `Remark`, `PartMnem`
  FROM (`loodvrij_receptuur` lr)
  JOIN `loodvrij_artikel` la ON `la`.`PartCode` = `lr`.`SubPartCode`
  WHERE `lr`.`PartCode` =  'M2430A'
  ORDER BY `SubPartCode`, `Qty` desc
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>This is the way I tried to execute the query in CodeIgniter</p>
  
  <pre><code>$this-&gt;db-&gt;query("SELECT `Qty`, `Invt`, `ClassNr`, `SubPartCode`, `Description`, `DesignCode`, `Measure`, `Remark`, `PartMnem`
                    FROM (`loodvrij_receptuur` lr)
                    JOIN `loodvrij_artikel` la ON `la`.`PartCode` = `lr`.`SubPartCode`
                    WHERE `lr`.`PartCode` =  'M2425B'
                    ORDER BY `SubPartCode`, `Qty` desc");
  </code></pre>
  
  <p>And </p>
  
  <pre><code>$this-&gt;db-&gt;select('Qty, Invt, ClassNr, SubPartCode, Description, DesignCode, Measure, Remark, PartMnem');
  $this-&gt;db-&gt;from('loodvrij_receptuur lr');
  $this-&gt;db-&gt;join('loodvrij_artikel la', 'la.PartCode = lr.SubPartCode');
  $this-&gt;db-&gt;where('lr.PartCode', 'M2425B');
  $this-&gt;db-&gt;order_by('SubPartCode');
  $this-&gt;db-&gt;order_by('Qty', 'desc');
  </code></pre>