Inhouse Training Microsoft SQL Server

Inhouse Training: Tuning and Optimizing Queries using Microsoft SQL Server

Delivered: 2011-03-29

Client: Stig Andersson, division: Volvo IT Skövde

Profile: 3 day course on-site in Skövde with Informator's instructor.

Graded: 4,5 out of 5.0


Course outline: MS2784 Tuning and Optimizing Queries using Microsoft SQL Server 2005/2008R2

This three-day instructor-led workshop provides database developers working in enterprise environments using Microsoft SQL Server 2005 the knowledge and skills to evaluate and improve queries and query response times. The workshop focuses on systematic identification and optimization of database factors that impact query performance.



This course is intended for current professional database developers who have three or more years of on-the-job experience developing SQL Server database solutions in an enterprise environment. At Course Completion After completing this course, students will be able to:

  • Normalize databases.
    • Design a normalized database.
    • Optimize a database design by denormalizing.
  • Optimize data storage.
  • Manage concurrency
    • Manage concurrency by selecting the appropriate transaction isolation level.
    • Select a locking granularity level.
  • Optimize and tune queries for performance.
  • Optimize an indexing strategy.
  • Decide when cursors are appropriate.
  • Identify and resolve performance-limiting problems.

Course Outline:

Module 1: Measuring Database Performance

  • Importance of Benchmarking
  • Key Measures for Query Performance: Sysmon
  • Key Measures for Query Performance: Profiler
  • Guidelines for Identifying Locking and Blocking

Lab : Measuring Database Performance

  • Reviewing Tables and Scripts
  • Determining Performance Baselines
  • Prioritizing Identified Problems

Module 2: Optimizing Physical Database Design

  • Performance Optimization Model
  • Schema Optimization Strategy: Keys
  • Schema Optimization Strategy: Responsible Denormalization
  • Schema Optimization Strategy: Generalization

Lab : Optimizing Schemas

  • Optimizing Memberships
  • Optimizing Events
  • Normalizing Event Sponsorships
  • Denormalizing Membership Visits
  • Cleaning Up Schema
  • Adapting the Solution to the New Database Schema
  • Determining Performance

Module 3: Optimizing Queries for Performance

  • Performance Optimization Model: Queries
  • What Is Query Logical Flow?
  • Considerations for Using Subqueries
  • Guidelines for Building Efficient Queries

Lab : Optimizing Queries

  • Optimizing and Rewriting Slow Performing Stored Procedures
  • Optimizing and Rewriting Slow Performing Views
  • Optimizing and Rewriting Slow Performing Non-Cursor Aggregate Queries
  • Determining Performance

Module 4: Refactoring Cursors into Queries

  • Performance Optimization Model: Query-Set-based solutions
  • Five Steps to Building a Cursor
  • Strategies for Refactoring Cursors

Lab : Refactoring Cursors into Queries

  • Refactoring the pMembershipCategory Cursor
  • Refactoring the pCommunityImpact Cursor
  • Refactoring the pMemberInvitation Cursor
  • Determining Performance

Module 5: Optimizing an Indexing Strategy 

  • Performance Optimization Model: Indexes
  • Considerations for Using Indexes
  • Best Uses of the Clustered Index
  • Best Practices for Non-Clustered Index Design
  • How to Document an Indexing Strategy

Lab : Optimizing an Indexing Strategy

  • Identifying Tables to Optimize
  • Designing Indexes
  • Determining Performance

Module 6: Managing Concurrency

  • Performance Optimization Model: Locking and Blocking
  • Multimedia - "How to Use Efficient Queries to Reduce Locking and Blocking"
  • Strategies to Reduce Locking and Blocking

Lab : Reducing Blocking

  • Identifying Code with Locking and Blocking Issues
  • Reducing Concurrency Issues
  • Determining Final Performance