Tuning and Optimizing Queries using Microsoft SQL Server 2005
Course
In Bath and London
Description
-
Type
Course
-
Location
-
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
Start date
Start date
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...
Reviews
Course programme
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
- Measuring Database Performance
- Optimizing Physical Database Design
- Optimizing Queries for Performance
- Refactoring Cursors into Queries
- Optimizing an Indexing Strategy
- Managing Concurrency
- 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.
- 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.
- 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.
- 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.
- 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.
- 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