title: Mysql left join very slow
body: <p>I have a left join:</p>
  
  <pre><code>$query = "SELECT a.`id`, a.`documenttitle`, a.`committee`, a.`issuedate`, b.`tagname`
     FROM `#__document_management_documents` AS a 
     LEFT JOIN `#__document_managment_tags` AS b 
     ON a.id = b.documentid 
     ".$tagexplode."
     ".$issueDateText."
     AND a.committee in (".$committeeQueryTextExplode.")
     AND a.documenttitle LIKE '".$documentNameFilter."%'
     GROUP BY a.id ORDER BY a.documenttitle ASC
  
    ";
  </code></pre>
  
  <p>It's really slow abaout 7 seconds on 4000 records </p>
  
  <p>Any ideas what I might be doing wrong</p>
  
  <pre><code>SELECT a.`id`, a.`documenttitle`, a.`committee`, a.`issuedate`, b.`tagname` 
  FROM `w4c_document_management_documents` AS a 
  LEFT JOIN `document_managment_tags` AS b 
  ON a.id = b.documentid WHERE a.issuedate &gt;= '' 
  AND a.committee in ('1','8','9','10','11','12','13','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47') 
  AND a.documenttitle LIKE '%' GROUP BY a.id ORDER BY a.documenttitle ASC
  </code></pre>