Vous êtes sur la page 1sur 11

Unit 1:

Measuring Database
Performance

Overview
Best Practices for Measuring Performance
Key Measures for Query Performance
Using Performance Monitor

Using SQL Server Profiler


Guidelines for Identifying Locking and Blocking

Lab Scenario
Lab Outcomes

Lab: Measuring Database Performance


Lab Discussion

Best Practices for Measuring Performance

When measuring performance:


Identify a performance baseline

Use appropriate SQL Server and Windows tools


SQL Server Profiler
Performance Monitor
Activity Monitor
Carefully select the performance problems to monitor
with each tool

Key Measures for Query Performance

Key factors for query performance:


Resources used to execute the query

Time required for query execution

SQL Server tools to measure query performance:


Performance Monitor
SQL Server Profiler

Using Performance Monitor

Useful Performance Monitor counters are:


SQLServer:Access Methods
SQLServer:SQL Statistics

SQLServer:Databases
SQLServer:Transactions
SQLServer:Locks

Using SQL Server Profiler


Useful SQL Server Profiler events are:
Stored Procedures category:
RPC:Completed
SP:Completed
SP:StmtCompleted
TSQL category:

SQL:StmtCompleted
SQL:BatchCompleted
Locks category:
Lock:Acquired
Lock:Released

Lock:Timeout

Guidelines for Identifying Locking and Blocking

Guidelines to identify procedures that cause locking


and blocking:
Use Activity Monitor
Use SQL Server Profiler blocked process report

Watch for situations in which the same procedure


executes in different amounts of time
Identify the transaction isolation level of the procedure

Lab Scenario
Background information
Current situation
Requirements

Lab Outcomes
Anomalies and issues with the physical
schema identified
Baseline performance times recorded
Potential concurrency issues identified
Prioritized list of potential problems or
issues recorded

Lab: Measuring Database Performance


Exercise 1: Reviewing Tables and
Scripts
Exercise 2: Capturing Baseline
Performance

Exercise 3: Prioritizing Identified


Problems

Lab Discussion
Does your company take regular baseline
measurements?
If not, why not? Why do most companies
not take baselines?

Could you automate the performance


baseline process?
From the analysis of the database, what
areas require review?

Vous aimerez peut-être aussi