I have problem I have never met before.
I was clearing yesterday clients db and table with stats of visits had 15GB of data, so I decided to delete all rows older than 1 Feb, because we have all that data stored in daily stats and there’s no need to keep those old single stats.
I tried to run DELETE FROM sv WHERE datetime < ? (index on datetime) and DELETE FROM sv WHERE id < ? (primary index on id), but both queries where too slow, took more than 15 mins. So I have just aborted those queries by Ctrl+C.
Then I thought better idea would be copying table structure and February rows and remove old table, but today I found out that mysql process on server is running up to 50% cpu usage with normal traffic on our site.
After moving sv table out of database folder (myIsam table) usage is still up to 50%.
First I thought that table must have been corrupted, but phpmyadmin does not show it marked as crashed.
How I can debug this one? What have happened there?
Your system is likely re-indexing the entire table as a result of the killed query. If it was in a transaction in INNODB, you are also having the system rebuild the table then recreating the index.
I would look at iostat and look for disk contention.