title: MySQL monster query optimisation
body: <p>I have this large MySQL query that I developed long time ago. It is far from perfect and now the time has come to optimize it. I don't even know where to start, maybe add indexes to the tables involved? Or break the query down to subqueries, store them as views, and then reassemble the result using those views?
  Please tell me how you would handle such task.</p>
  
  <p>Link to the query:
  <a href="http://pastebin.com/sVvW8PCc" rel="nofollow">http://pastebin.com/sVvW8PCc</a></p>
  
  <p>MySQL version used: 5.0.96</p>
  
  <p>It currently loads in like 6,5 seconds, I look to reduce this time to 2 seconds or less.</p>
  
  <p>Thank you in advance!</p>