I scrubbed the SQL here to protect the innocent, but check this fun stuff out. Working with a client who randomly started seeing huge spikes in CPU and disk activity on their server after weeks of seemingly running fine. I tracked it down to a subset of long running queries. These queries typically run in around a second per run, but out of the blue they started taking 600 seconds.
Here is the explain for the first query:
Explain:
+—-+————-+——-+——-+——————————-+————+———+——————————-+——–+———————————————-+ | id | select_type | table | type | possible_keys | key | key_len | … |