I have a query join a couple of tables, the biggest one of which has 12 million rows and an index that will be used in the query. The query uses group by and order by and speed is optimized to 150ms normally. However, If no query sent in couples of hours or days, the query may slow down to 30 seconds. If I run CHECK TABLE to the biggest table, then the query will speed up to 150ms again. Does anybody know what happened?
Thank you very much,