SQL Server: Optimizing Stored Procedure Performance

Pluralsight
Course Summary
When using stored procedures, their performance is dependent on creating the optimal plan for the execution environment and making sure that it remains cached. This comprehensive course will show you all of that and more, and is applicable to SQL Server developers and anyone responsible for ensuring performance of stored procedures, from SQL Server 2005 onward.
-
+
Course Description
If you want to use SQL Server databases effectively, you will end up using stored procedures. Their aim is that you have optimized and compiled code that resides in a cache to improve workload performance for subsequent executions. However, you might find that it does not always work out that way. The performance of a stored procedure is heavily dependent on how the plan is chosen and cached. If the plan is not optimal for subsequent executions it could cause performance to suffer greatly. In the end, you might suffer from what is known as parameter-sniffing-problems where the optimal plan for a procedure varies based on the parameters supplied. This comprehensive course will teach you how stored procedure plan caching works and how to get SQL Server to produce the optimal plan for your stored procedure performance in a variety of circumstances. The course is applicable to SQL Server developers and anyone who is responsible for writing stored procedures that must repeatedly perform well. The demo database provided is compatible with SQL Server 2008 through SQL Server 2014. All course demos are shown on SQL Server 2014 with references to behaviors (where different) on all versions. Optimization strategies you will learn in the course apply to SQL Server 2005 onward, and some even back to SQL Server 2000.
-
+
Course Syllabus
Introduction- 21m 19s
—Introduction 1m 51s
—This Course 2m 35s
—What Does Optimizing Stored Procedure Performance Mean? 2m 49s
—Does This Sound Familiar? 2m 11s
—What Does Optimizing Stored Procedure Performance NOT Mean? 3m 46s
—Why This Course Is Relevant 3m 11s
—Course Focus and Structure (1) 2m 9s
—Course Focus and Structure (2) 2m 44sWhy Use Stored Procedures?- 27m 4s
—Overview 2m 4s
—Different Ways to Execute SQL Statements 2m 25s
—Some Statements Can Be Cached for Reuse (1) 1m 45s
—Some Statements Can Be Cached for Reuse (2) 3m 43s
—Version-Specific Plan Caching Whitepapers 1m 26s
—Reducing Plan Cache Pollution 4m 32s
—Understanding sp_executesql 2m 51s
—Stored Procedures / sp_executesql and the Cache 2m 39s
—Parameter Sniffing 2m 1s
—Summary: Why Use Stored Procedures? 3m 34sCreation, Compilation, and Invalidation Section 1- 1h 8mCreation, Compilation, and Invalidation Section 2- 53m 29sOptimization and Recompilation Section 1- 55m 44sOptimization and Recompilation Section 2- 51m 43sOptimization and Recompilation Section 3- 1h 8mOptimization and Recompilation Section 4- 1h 2mOther Concerns and Considerations- 23m 17s