The information in this article applies to:
BUG #: 18283 (SQLBUG_65) SYMPTOMS
When a stored procedure is executed with the SET SHOWPLAN option on, a new
query plan is generated for each execution of the procedure. This is
expected behavior. When SHOWPLAN is set off, existing plans in the
procedure cache will be reused, if available, upon re-execution of the
procedure. However, if the procedure calls subprocedures, new plans will be
generated for each of the subprocedures on each execution, even after the
SHOWPLAN option has been set off. This can lead to excessive plans stored
in cache for the subprocedures.
WORKAROUNDTo work around this problem, execute the calling procedure with the WITH RECOMPILE option. This will stop subsequent executions from creating new plans for the subprocedures. Existing plans for the subprocedure will remain in procedure cache until they are flushed out. STATUSMicrosoft has confirmed this to be a problem in SQL Server version 6.5. MORE INFORMATION
The large number of plans in cache, in and of itself, is not a cause for
concern. The excess plans will be flushed out of cache when the memory is
needed for other requests. However, the performance benefit of avoiding
parse and compile time for the subprocedure will be lost as a new plan is
generated for each subprocedure when the calling procedure is executed.
Additional query words:
DBCC MEMUSAGE Number Trees Plans sub st proc
Keywords : kbbug6.50 |
Last Reviewed: April 22, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |