BUG: Stored Proc Keeping Extra Execution Plans in Proc Cache

Last reviewed: April 28, 1997
Article ID: Q98968

The information in this article applies to:
  • Microsoft SQL Server version 4.2 for OS/2
BUG# OS/2: 1680 (4.2)

SYMPTOMS

If you create a stored procedure in a particular case, that is, "Create proc UPPERCASE, MiXeD cAsE or lowercase," and do not call it in the exact same case, SQL Server will create a new execution plan in the procedure cache.

CAUSE

When you call a procedure, its name gets passed to a function, which builds a numeric representation of the procedure based on the ASCII value of its name. It then looks in the procedure cache to see if there is already another procedure in cache of the same numeric value. If there is no execution plan based on this comparison, the function then goes to sysprocedures, gets the query tree and builds a new plan.

These plans are retained in the procedure cache and are only cleared from the procedure cache by dropping and recreating the procedure or shutting down SQL Server. An indication that this problem has been encountered is that large numbers of execution plans for a given procedure will be shown when doing a DBCC memusage. The server may slow down after many procedures are called with the incorrect case. This is due to the procedure cache being used up by the extra execution plans in memory. Restarting the SQL Server will temporarily improve performance.

WORKAROUND

Call all stored procedures in the same case they are created.

STATUS

Microsoft has confirmed this to be a problem in SQL Server version 4.2 for OS/2. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.


Additional query words:
Keywords : kbbug4.20 kbtool SSrvGen SSrvISQL
Version : 4.2
Platform : OS/2


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 28, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.