title: queries are running slow after Too many connections error
body: <p>Couple of days ago i had persistent query running on my website which was taking couple of long minutes to complete ( i've run it about 3 time)</p>
  
  <p>It nearly killed my database , everything slowed down and i got <code>1040 too many connections</code> when i tried to get data from couple of my tables (session and setting tables for example which are the most used tables in my website - nearly every page is using them ) , and the odd thing is i wasn't trying to get data via my website , i was trying to access them from phpmyadmin ! that means those table were unreachable</p>
  
  <p>Any way i took the website down and deleted my session table and somehow it was fixed (of cures i've never run that query again ) .</p>
  
  <p>First of all i want to know what append to those tables ? were they corrupted ? i understand that connection limit were reached but i thought i should not get that inside phpmyadmin</p>
  
  <p>Second and most important thing is i feel my queries are running much slower now even though i dont get that error anymore and my connections are under 30 per page is that have something to do with Too many connections error that i got ? should i clear or empty something !?</p>
  
  <p>Here is the query (each tables has about 50-60 000 rows ) </p>
  
  <pre><code>SELECT 
  u.id,  u.username , u.created_on , meta.full_name as fullname , meta.avatar , COUNT(s.val) as image_scores
  FROM
     users u
         LEFT JOIN meta ON (u.id = meta.user_id)
         LEFT JOIN images i ON (u.id = i.user_id)
         LEFT JOIN score_history s ON (i.id = s.content_id)and s.content_type = 'image'
  GROUP BY
     u.id
  ORDER BY
     image_scores DESC
  LIMIT 9
  </code></pre>