Tuning and Optimizing Queries using Microsoft SQL Server 2005

Short course

In London

£ 995 + VAT

Description

  • Type

    Short course

  • Location

    London

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.

Facilities

Location

Start date

London
See map
3-5 Crutched Friars, EC3N 2HR

Start date

On request

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

Course contentUnit 1: Measuring Database PerformanceThis unit provides students with an opportunity to measure database performance and identify database performance bottlenecks. Students will use a sample script to identify performance and concurrency problems, capture baseline performance, and prioritize identified problems for optimization.
Topics
  • 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
After completing this unit, students will be able to:
  • 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
Unit 2: Optimizing Physical Database DesignIn this unit, students work with strategies for optimizing physical database design. Students will optimize a database schema using normalization, generalization, and denormalization.
Topics
  • 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
After completing this unit, students will be able to:
  • 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
Unit 3: Optimizing Queries for PerformanceIn this unit students experience optimizing and tuning queries to improve performance. In the lab, students will optimize stored procedures, views, and non-cursor aggregate queries to improve database performance and user experience.
Each query that is optimized improves the overall system because the query will use fewer resources, freeing up those resources for other queries, and reducing the amount of locking done by the query. The domino effect is profound.
Topics
  • 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
After completing this unit, students will be able to:
  • 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
Unit 4: Refactoring Cursors into QueriesIn this unit, students will work with strategies for refactoring cursors into queries. In the lab, students will work to optimize a database by replacing slow iterative code with faster set-based code.
Topics
  • 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
After completing this unit, students will be able to:
  • 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
Unit 5: Optimizing an Indexing StrategyIn this unit, students will work on optimizing indexing strategies. Students will work with a given database to add and delete indexes, by providing the optimum bridge between the query and the data without any redundancies.
Topics
  • 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
After completing this unit, students will be able to:
  • 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.
Unit 6: Managing ConcurrencyThis unit provides students with the opportunity to work with concurrency management. Students will look for concurrency issues and then solve them by optimizing transactions and adjusting the transaction isolation level.
Topics
  • 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
After completing this unit, students will be able to:
  • 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

£ 995 + VAT