IT Community - Software Programming, Web Development and Technical Support

Performance Tuning Tips About Sql Server Stored Procedures

This is a discussion on Performance Tuning Tips About Sql Server Stored Procedures within the Database Support forums, part of the Web Development category; * Avoid using temp tables and DDL statements This can cause stored procedure recompile when temp table, created in stored procedure, ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > Database Support

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 02-04-2008, 06:16 AM
vadivelanshanmugam vadivelanshanmugam is offline
D-Web Trainee
 
Join Date: Jan 2008
Posts: 41
vadivelanshanmugam is on a distinguished road
Default Performance Tuning Tips About Sql Server Stored Procedures

* Avoid using temp tables and DDL statements

This can cause stored procedure recompile when temp table, created in stored procedure, get referenced first time within stored procedure. Due to non-existense of statistics optimizer will not be able to reuse or create execution plan for queries using temp table which is created within stored procedure. Same applies on DDL statement as they also force stored procedure to recompile.

When a batch is recompiled in SQL Server 2000, all of the statements in the batch are recompiled, not just the one that triggered the recompilation. SQL Server 2005 improves upon this behavior by compiling only the statement that caused the recompilation, not the entire batch. This “statement-level recompilation” feature will improve SQL Server 2005’s recompilation behavior when compared to that of SQL Server 2000. In particular, SQL Server 2005 spends less CPU time and memory during batch recompilations, and obtains fewer compile locks.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Performance Tuning Tips About Sql Server Stored Procedures vadivelanshanmugam Database Support 0 02-04-2008 06:15 AM
Performance Tuning Tips About Sql Server Stored Procedures vadivelanshanmugam Database Support 0 02-04-2008 06:14 AM
Some Performance tuning tips about SQL Server Stored Procedures vadivelanshanmugam Database Support 0 02-04-2008 06:12 AM
SQL Server Undocumented Stored Procedures a.deeban Database Support 2 12-23-2007 11:20 PM
Executing SQL Server Stored Procedures With PHP - Executing stored procedures Jeyaseelansarc PHP Programming 1 07-19-2007 12:23 AM


All times are GMT -7. The time now is 06:42 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0