SQL Server compiles the stored procedures using (sniffing) the parameters send the first time the procedure is compiled and
put it in plan cache. After that every time the procedure executed again, SQL Server retrieves the execution plan from the cache
and uses it (unless there is a reason for recompilation). The potential problem arises when the first time the stored procedure
is executed, the set of parameters generate an acceptable plan for that set of parameters but very bad for other more common
sets of parameters.
Submitted questions and answers are subject to review and editing, and may or may not be selected for posting, at the sole discretion of w3Sniff.
Get Started
Comments
Leave a Comment