|
Comments
|
|
Should also mention the WITH RECOMPILE option of CREATE PROCEDURE.
|
|
|
wish it was a bit more detailed possibly with the trace showing the benefit.
still very good
|
|
|
wish it was a bit more detailed possibly with the trace showing the benefit.
still very good
|
|
|
Where is the testing?
|
|
|
nice demo
|
|
|
thank you
|
|
|
It given an idea that there is a option using recompile.
Missing is
Why with WITH RECOMPILE? What are the impacts without recompile?
|
|
|
Code had a mistake, and would have been nice to see the actual execution
|
|
|
nice
|
|
|
It would be much better, if we actually saw the execution plan resulting from an atypical parameter and the changed plan as well as the actual impact of using the wrong execution plan.
|
|
|
Satyabodhi, yes you can create stored procedure using WITH RECOMPILE, but the point here was to show solution after the procedure is created. In essence it does the same.
|
|
|
Murali, there are other videos that discuss the other options to solve parameter sniffing. Here is one: http://www.jumpstarttv.com/solve-parameter-sniffing-by-using-option-recompile_534.aspx. You can also see all methods at a glance on my blog: http://pratchev.blogspot.com/2007/08/parameter-sniffing.html.
|
|
|
The where clause has variable @local_Customerid which is not declared anywhere
|
|
|
Good topic.
|
|
|
who knew that a cached query plan from execution #1 of a new proc could be so harmful to later executions...I imaging with recompile is not something you want to use as a strategy however...so when is the next part that explains how to mitigate those two factors?
|
|
|
difficult to understand
need to clarify reason for use better
|
|
|
Orlando, in general you should not worry about parameter sniffing unless you have performance problem. Then you have to decide on a solution. I listed a few solutions in detail on my blog here: http://pratchev.blogspot.com/2007/08/parameter-sniffing.html.
|
|
|
Ray, as already noted, parameter sniffing is a good thing. But in some case it may cause performance issues. Only in those cases you have to worry. Here is a great white paper on plan caching issues with details: http://technet.microsoft.com/en-us/library/cc966425.aspx.
|
|
|
It would have been nice to show other places the WITH RECOMPILE hint could be used. i.e.(within the sp itself)
|
|
|
Good.
Thanks & regards,
A Alagu Ganesh.
|
|
|
good
|