title: Doctrine much long time as in phpMyAdmin?
body: <p>I am using symfony with doctrine (2.5). I have select (taken from Symfony Profiler->doctrine->queries->view runnalbe query). It takes ~200ms via phpMyAdmin or on web via doctrine (same time).</p>
  
  <pre><code>SELECT col1, col2 ... col 12, MIN(t0_.price) AS sclr_24 
  FROM tablo t0_ 
  WHERE t0_.visible = (1) AND t0_.status &lt;&gt; (0) AND t0_.price IS NOT NULL 
  GROUP BY t0_.kat_id 
  ORDER BY t0_.hotel ASC;
  </code></pre>
  
  <p>But if i remove <code>orderBy</code> from php - doctrine will generate this query: (same as previous but without <code>orderBy</code>)</p>
  
  <pre><code>SELECT col1, col2 ... col 12, MIN(t0_.price) AS sclr_24 
  FROM tablo t0_ 
  WHERE t0_.visible = (1) AND t0_.status &lt;&gt; (0) AND t0_.price IS NOT NULL 
  GROUP BY t0_.kat_id;
  </code></pre>
  
  <p>This query takes time nearly previous query BUT only on web via doctrine if i copy this query and paste to phpMyAdmin it takes a lot of time less (~20ms).</p>
  
  <p>Can some explain me why? Or what i must change to have same time as in phpMyAdmin?</p>
  
  <p>UPDATE:
  code from repository:</p>
  
  <pre><code>$query = $repository
     -&gt;createQueryBuilder('t')
     -&gt;select('t.col1', 't.col2' .... 't.col12', 'MIN(t.price) AS price');
  
  $query-&gt;where('t.visible = (:visible)')-&gt;setParameter('visible', 1);
  $query-&gt;andWhere('t.status!= (:status)')-&gt;setParameter('splneno', 0);
  $query-&gt;andWhere('t.priceis not null');
  
  $query-&gt;groupBy('t.katId');
  $result = $query-&gt;getQuery()-&gt;getArrayResult();
  </code></pre>