Skip to main content
3 votes

Trouble with slow stored procedure performance on 35M rows with CTE/Temp table

This is a classic Kitchen Sink Query. While you could add OPTION (RECOMPILE) as a quick fix, this comes at a cost of recompiling on every run. Instead, you should build a dynamic query. Don't forget ...
Charlieface's user avatar
  • 13.7k

Only top scored, non community-wiki answers of a minimum length are eligible