title: Mysql very slow query, but fast working after reboot (CPU usage 99%)
body: <p>I have a SQL query generated ORM (Hibernate). Query is big, but after restart MySQL service it works fast (0.2 sec.). A few days later, the query is becoming slower and slower (> 1 min.). I run DESCRIBE. And I see that the query plan is different. But I do not know what the problem is and how I can remedy the situation.</p>
  
  <p>Fast:</p>
  
  <p><a href="https://i.stack.imgur.com/BsgeT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BsgeT.png" alt="Fast"></a></p>
  
  <p>Slow:</p>
  
  <p><a href="https://i.stack.imgur.com/GuyfB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GuyfB.png" alt="Slow"></a></p>
  
  <p><a href="https://drive.google.com/file/d/0B6aJ6H5VNJ4XN2NXVGRHV3lKVVk/view?usp=sharing" rel="nofollow noreferrer">Generated query</a></p>