MyPage is a personalized page based on your interests.The page is customized to help you to find content that matters you the most.


I'm not curious

SQL Server: Optimizing Ad Hoc Statement Performance

Course Summary

This course is about how different ad hoc statement execution methods affect caching, plan reuse, memory and ultimately performance. Knowing when to use each method is important and understanding how SQL Server works will demystify certain behaviors you m


  • +

    Course Syllabus

    ● Introduction
        ◦ Introduction and Background
        ◦ This Course
        ◦ What Does Optimizing Ad Hoc Statement Performance NOT Mean?
        ◦ What Does Optimizing Ad Hoc Statement Performance Mean?
        ◦ Why is This Course Relevant?
        ◦ Course Focus and Structure (1)
        ◦ Course Focus and Structure (2)
    ● Statement Execution Methods
        ◦ Introduction
        ◦ Different Ways to Execute SQL Statements
        ◦ Understanding Ad Hoc Statements
        ◦ Understanding sp_executesql
        ◦ Understanding Dynamic String Execution
        ◦ Dynamic String Execution and SQL Injection
        ◦ Demo: Credit Sample Database Setup for This Course
        ◦ Demo: Setting Up For Analyzing Cache
        ◦ Demo: Part 1 - Ad Hoc Safe Statements
        ◦ Demo: Part 2 - Ad Hoc Unsafe Statements
        ◦ Demo: Part 3 - Ad Hoc Safe and Unsafe with Variables
        ◦ Demo: Part 4 - sp_executesql with Safe Statement
        ◦ Demo: Part 5 - sp_executesql with Unsafe Statement
        ◦ Demo: Part 6 - Dynamic String Execution with Safe Statement
        ◦ Demo: Part 7 - Dynamic String Execution with Unsafe Statement
        ◦ Summary: Statement Execution Methods
    ● Estimates and Selectivity
        ◦ Introduction
        ◦ Statement Execution Simplified
        ◦ Cost-Based Optimization
        ◦ Understanding Selectivity
        ◦ Demo: Setup and First Look at Statistics
        ◦ Demo: Updates and Estimates
        ◦ Demo: Ad Hoc Statements and Variables
        ◦ Demo: When No Statistics Exist then Heuristics are Used
        ◦ Demo Summary: Estimates and Selectivity
        ◦ How Do You See Statistics?
        ◦ What Do Statistics Tell Us About Our Data? (1)
        ◦ What Do Statistics Tell Us About Our Data? (2)
        ◦ What Do Statistics Tell Us About Our Data? (3)
        ◦ What Do Statistics Tell Us About Our Data? (4)
        ◦ Demo: Reading the Histogram
        ◦ When and How Does SQL Server Use Statistics?
        ◦ Summary: Estimates and Selectivity
    ● Statement Caching
        ◦ Introduction
        ◦ What Affects Ad Hoc Statement Behavior?
        ◦ Default Ad Hoc Statement Behavior
        ◦ Ad Hoc Statement Textual Matching
        ◦ Ad Hoc Statements: Safe vs. Unsafe
        ◦ Ad Hoc Statement Caching
        ◦ Demo: Ad Hoc Statements and the Plan Cache
        ◦ Verifying Plans in Cache NOW
        ◦ Analyzing the Plan Cache
        ◦ Demo: query_hash and query_plan_hash
        ◦ Changing Ad Hoc Statement Behavior (1)
        ◦ Changing Ad Hoc Statement Behavior (2)
        ◦ Multiple Plans (Tipping/Covering)
        ◦ Demo: Part 1 - Making a Statement Safe with Covering
        ◦ Demo: Part 2 - The Right Way to Force Statements
        ◦ Summary: Statement Caching
    ● Plan Cache Pollution
        ◦ Plan Cache Pollution
        ◦ Ad Hoc Plan Cache Pollution Defined
        ◦ Plan Cache Stores
        ◦ Verifying State of Plan Cache
        ◦ Demo: Analyzing for Plan Cache Pollution - Setup
        ◦ Demo: Analyzing for Plan Cache Pollution
        ◦ Balancing Plan Cache Pollution, CPU, and PSP (1)
        ◦ Demo: Part 1a - Optimize for Adhoc Workloads
        ◦ Demo: Part 1b - Covering to Make a Query Safe
        ◦ Balancing Plan Cache Pollution, CPU, and PSP (2)
        ◦ Balancing Plan Cache Pollution, CPU, and PSP (3)
        ◦ Balancing Plan Cache Pollution, CPU, and PSP (4)
        ◦ Demo: Part 2a - Forcing a Stable Statement With sp_executesql
        ◦ Demo: Part 2b - Forcing a Stable Statement with a Plan Guide
        ◦ Demo: Part 2c - Optimizing an Expensive Statement
        ◦ Balancing Plan Cache Pollution, CPU, and PSP (5)


Course Fee:
USD 29

Course Type:

Self-Study

Course Status:

Active

Workload:

1 - 4 hours / week

This course is listed under Data & Information Management Community

Attended this course?

Back to Top

Awards & Accolades for MyTechLogy
Winner of
REDHERRING
Top 100 Asia
Finalist at SiTF Awards 2014 under the category Best Social & Community Product
Finalist at HR Vendor of the Year 2015 Awards under the category Best Learning Management System
Finalist at HR Vendor of the Year 2015 Awards under the category Best Talent Management Software
Hidden Image Url

Back to Top