Tuning and Optimizing Queries using Microsoft SQL Server 2005

Course

In Bath and London

£ 1,050 + VAT

Description

  • Duration

    3 Days

After completing this course, students will be able to design a normalized database; optimize a database design by denormalizing; optimize data storage; 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. Suitable for: This workshop provides database developers the knowledge and skills to evaluate and improve queries and query response times. It 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.

Facilities

Location

Start date

Bath (Somerset)
3 Kelso Place, Upper Bristol Road, BA1 3AU

Start date

On request
London
See map
Valiant House, 4-10 Heneage Lane, EC3A 5DQ

Start date

On request

About this course

Before attending this course, students must have the following pre-requisites:Be familiar with SQL Server 2005 features, tools, and technologies.Have basic knowledge of the operating system and platform.Have had hands-on database developer experience.Have a Microsoft Certified Technology Specialist: Microsoft SQL Server 2005 credential - or equivalent experience.In addition, it is...

Questions & Answers

Add your question

Our advisors and other users will be able to reply to you

Who would you like to address this question to?

Fill in your details to get a reply

We will only publish your name and question

Reviews

Course programme

Target Audience
This workshop provides database developers the knowledge and skills to evaluate and improve queries and query response times. It 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.

Pre-Requisites
Before attending this course, students must have the following pre-requisites:Be familiar with SQL Server 2005 features, tools, and technologies.Have basic knowledge of the operating system and platform.Have had hands-on database developer experience.Have a Microsoft Certified Technology Specialist: Microsoft SQL Server 2005 credential - or equivalent experience.In addition, it is recommended, but not required, that students have completed: Course 2778, Writing Queries Using Microsoft SQL Server 2005 Transact-SQL; Course 2779, Implementing a Microsoft SQL Server 2005 Database; Course 2780, Maintaining a Microsoft SQL Server 2005 Database.

Purpose
After completing this course, students will be able to design a normalized database; optimize a database design by denormalizing; optimize data storage; 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
  1. Measuring Database Performance
  2. Optimizing Physical Database Design
  3. Optimizing Queries for Performance
  4. Refactoring Cursors into Queries
  5. Optimizing an Indexing Strategy
  6. Managing Concurrency
Supplementary InformationPlease note that this course is mainly workshop based and as such, it involves the Trainer spending a short time introducing each topic followed by the delegates themselves performing the Labs and Workshops with the assistance of the trainer as needed. The course also assumes some knowledge of Transact SQL and SQL Server 2005 queries, stored procedures and functions. 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
  • Describe best practices for measuring performance.
  • Describe the key Sysmon counters for problem identification.
  • Describe the key Profiler trace events for problem identification.
  • Select best methods for identifying which procedures are causing locking and blocking.
  • Review database tables and scripts.
  • Use a script to identify performance and concurrency problems.
  • Capture baseline performance.
  • Prioritize 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
  • Explain the strategy for database optimization presented in the Performance Optimization Model.
  • Explain the importance of schema design in database optimization.
  • Describe the strategic use of natural and surrogate keys and their roles in schema optimization.
  • Describe responsible denormalization and the role of this strategy in schema optimization.
  • Describe generalization and the role of this strategy in schema optimization.
  • Normalize a database schema for optimization.
  • Generalize a database schema for optimization.
  • Denormalize a database schema for optimization.
  • Clean up database schema by verifying and adjusting data types and verifying referential integrity.
  • Convert data to the new schema.
  • Correct table and column names in queries, stored procedures, and triggers to reconcile schema changes.
  • Test for 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
  • Explain the importance of set-based solutions in database optimization.
  • Explain the utility of the query logical flow diagram in query optimization.
  • Discuss considerations when using subqueries in query optimization.
  • Describe strategies for building efficient queries.
  • Rewrite stored procedures for optimization.
  • Rewrite views for optimization.
  • Rewrite non-cursor aggregate queries for optimization.
  • Test queries for 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
  • Explain the importance of set-based solutions in database optimization.
  • List five steps to building a cursor.
  • Describe strategies for refactoring cursors.
  • Refactor cursors into queries by rebuilding cursor logic as multiple queries, user-defined function, and complex queries with case expression.
  • Test queries for 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
  • Explain the importance of optimizing index strategies in database optimization.
  • Explain considerations for using indexes in database optimization.
  • Describe the best uses of clustered indexes as they relate to optimization.
  • Describe the best practices for designing non-clustered databases.
  • Explain the methodology for using an indexing strategy worksheet.
  • Determine tables that need to be optimized based on slow running code.
  • Design, implement, and adjust clustered and non-clustered indexes.
  • Test for 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
  • Explain the importance of concurrency management in database optimization.
  • Explain how efficient queries reduce locking and blocking.
  • List strategies for reducing locking and blocking.
  • Identify code with locking and blocking issues.
  • Tighten and optimize logical transactions in code with concurrency issues.
  • Adjust transaction isolation levels in code with concurrency issues.
  • Test database for performance.
  • Determine percentage gain on database performance from baseline.

Tuning and Optimizing Queries using Microsoft SQL Server 2005

£ 1,050 + VAT