July 19, 2005 03:19 PM
Conditional Recompile
Strike a balance between performance and security
Rating:

(0)
SQL Server Magazine
InstantDoc ID #46643
Since SQL Server's first release, the ability to reuse the saved execution plans for stored procedures has been touted as one of the best things about the product. As I demonstrated last month in "Reusing Query Plans" (InstantDoc ID 46233), reusing a saved plan doesn't always produce the best performance. It works when the saved plan is a useful plan, but not when the plan is inappropriate for the current parameter values. SQL Server's query optimizer develops the execution plan for a stored procedure based on the parameters available at the time. So, the plan might be ideal for the initial parameters but not for parameters passed in subsequent procedure calls.
Las...
...This article is for paid Professional Members only.
Already a Professional Member? Please log in now: