A query which we run daily for the last two months and which took 3-4 minutes has over the last week jumped to a 33 minute run time. When the query was run the system was not working particularly hard and most of the rest of the system was performing OK. I pinned it down to a particular table used in the query by running other simple queries against it which likewise performed poorly. The table has 33 million rows but grows at a steady rate. I recreated a couple of the indexes which were being used in the query but to no effect. As a last resort I copied the table to a new table, recreated all the indexes, renamed the old table and renamed the new table as the old table. This did the trick and the query is back running at 3 minutes.
Any ideas as to what could have gone wrong with the original table over the last week to cause such a drop in performance? I did notice when I was getting the details of the indexes to recreate on the new table that the check box - Do not recompute statistics (not recomended)- had been ticked, could this have been the culprit. I'd like to prevent this happening again so any thoughts will be gratefully received.
Any ideas as to what could have gone wrong with the original table over the last week to cause such a drop in performance? I did notice when I was getting the details of the indexes to recreate on the new table that the check box - Do not recompute statistics (not recomended)- had been ticked, could this have been the culprit. I'd like to prevent this happening again so any thoughts will be gratefully received.