Mysql, 5.5.21, high load, but very few slow queries. How, after about a week, we start to see like 30 slow queries a minute, and it gets worse and worse. The only thing I can do is restart the server. I did “explain” on one of the slow queries, and the result is unexpected, completely using the wrong index. After a server restart, I run the explain again and everything is fine (this query is no longer “slow” when it uses the correct index).
How do I go about finding out why this happens? So, one query is fine for about a week. Then suddenly it’s not, because mysql chooses the wrong query plan. Restart the server – query plan is fine, query run fast.
Thanks!