• It could be parameter sniffing, but recompiling the whole procedure shouldn't have a positive effect if it is.

    Why do you say that?[/quote]

    Parameter sniffing is the process whereby the optimizer uses the initial values of the parameters to generate an optimal execution plan. One of the problems can occur when the plan created with the initial parameter values is reused with atypical parameter values later. This would not be occurring if the procedure is recompiled every time it is executed.

    Parameter sniffing is a "feature" that is suppose to help the optimizer, and I know that this scenario is not the only possibility. Sometimes parameter sniffing has an adverse affect because the procedure either changes the value of the parameter before the long running statement, or because the distribution of the parameter values is radically different by the time the procedure gets to the long running statement. I agree with you that it could be a problem associated with parameter sniffing, and I definitely agree with you that whether it is or not, a good understanding of parameter sniffing is essential.