• There are a multitude of possible reasons why the query started to run slower.

    But a very common scenario is that you have a query which involves something like "today's orders". When statistics have recently been updated, the optimizer can deal that there are a fair share of orders today and will arrive to a plan accordingly. But as the week moves on, statistics are not updated, neither manually, nor automatically beause the table is too big to trigger autostats very often. Now when you ask for today's orders, the optimizer looks at the statistics and finds nothing and estimate 1 order. And then it goes downhill from there.

    Often yoy may be lucky; if the query is inside a stored procedure stays in cache for a long time, why the bad statistics does not matter. But one day, the plan goes out of cache for whatever reason, for instance a server restart.

    [font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]