Hi, I've got a stored proc that after a period of weeks will start to run very slowly. It starts its life executing in a few seconds and ends up taking a couple of minutes to execute.
We've found that dropping and recreating the procedure results in it executing in a few seconds again.
The procedure itself contains a few inner joins and a couple of left outer joins - but nothing out of the ordinary.
Why should it be slowing down so dramatically and what should we be doing to prevent this issue happening in the first place?
Many thanks.