Quantcast
Channel: CodeSection,代码区,SQL Server(mssql)数据库 技术分享 - CodeSec
Viewing all articles
Browse latest Browse all 3160

Find, Analyze and Optimize SQL Server Performance with SolarWinds Database Perfo ...

$
0
0
Problem

As a SQL Server Professional, application performance is one of my top priorities. I know our applications have numerous inefficiencies and we are constantly firefighting to keep our internal and external users productive. Our team collects data all day long and get lots of metrics, which is great, but it is really difficult to pinpoint the issues that will yield the highest performance gain. Often times we are shooting from the hip with ideas. I need to know that spending time to work through our code release process will yield measurable performance gains. How can I correct the inefficiencies in our applications and have our SQL Server DBA team focus their efforts on the most important issues?

Solution

With large amounts of performance metrics at the server, database and object level, correlating, aggregating and trending data is difficult with an ever-increasing number of items to address on a daily basis. To take this a step further and truly prioritize the SQL Server performance issues often becomes very difficult. Often times the performance issue that gets the most attention is generally based on the loudest complaints. This is not necessarily the biggest issue; it could be a symptom of another problem.

At SolarWinds, they have been helping companies around the globe for decades by finding and analyzing SQL Server performance issues. With the latest release of Database Performance Analyzer (DPA) , the team at SolarWinds has taken this a step further by analyzing the overall workloads to help Database Administrators optimize the workload. This optimization is based on analyzing the overall workload on a daily basis to determine the biggest issues at the query and table levels then providing tangible recommendations with the estimated performance benefit to justify the changes. Let’s dive into Query Performance Analysis and the Table Tuning Advisors to learn how you can streamline your database performance optimizations.

Query Performance Analysis in SolarWinds Database Performance Analyzer

Query Performance Analysis provides a means to streamline improving your query performance by focusing on the queries with the highest waits, drilling into the portions of the query that are most problematic and getting recommendations to improve the query including the code. This puts the most important information in front of a DBA as quickly as possible in an intelligent manner to address performance issues such as:

Most expensive queries for the overall workload Highest wait types for each query Inefficient query plan steps to focus on Correlating performance metrics at numerous tiers in the stack Code executions on a daily basis to determine the impact on the wait types

This process starts when logging into DPA and checking out the 30-Day Trend Page where you are able to drill into individual queries for the associated code, their metrics and recommendations.


Find, Analyze and Optimize SQL Server Performance with SolarWinds Database Perfo ...

When you click on a query hash from the 30-day trend view, all of the performance metrics for that individual query are shown for the last 30 days keeping the timeframe consistent. The new query performance analysis view contains multiple sections that are collapsible/expandable so that emphasis can be drawn to the most important data. The data in this view is intelligently displayed in a couple ways:

If there are resource metrics associated with the predominant waits for the query, those will be pulled into the metrics section. If this query was involved in significant blocking (either as the blocker or the blockee), it will expand the blocking section. If the optimizer used multiple plans for this query in the timeframe you have set, it will expand the plan section.

The top two sections are reserved for any findings during analysis of this query:

Query Advisors missing index recommendations, significant wait types, unusual usage patterns (periods with high executions), missing where clauses, full table scans, etc. Table Tuning Advisors indicates that this query was causing inefficient workload against one or more table (more on this in a bit).

If the query itself didn’t change, yet is accruing more wait time, then one of the other sections provided in this view can help answer why, such as:

Increased executions or physical reads vs logical (statistics) Plan change (plans) System resource pressure (metrics) Concurrency (blocking)

The example below shows the predominant activity for the chosen query is Memory/CPU. Because of this, memory and CPU metrics are pulled into our view in the metrics section. However, had the predominant wait been disk related (say pageiolatch_ex), disk latency and other related metrics would have been pulled into the view.


Find, Analyze and Optimize SQL Server Performance with SolarWinds Database Perfo ...

As we click through the Plan link on the right side of the screen, we are able to see the entire query plan with the associated costs as well as the Plan Advice at the bottom of the page. The Plan Advice also includes the associated impact to justify the benefits associated with following the recommendation.


Find, Analyze and Optimize SQL Server Performance with SolarWinds Database Perfo ...

To continue the query analysis, you have options at the chart level to add relevant counters based on the specific report. The top chart is also sticky and hovers above each section to better correlate the data across the 30-Day Trend chart.


Find, Analyze and Optimize SQL Server Performance with SolarWinds Database Perfo ...

Beyond the ability to add statistics for specific charts, you also have the ability to add 66 individual metrics to truly customize the charts based on your workload.


Find, Analyze and Optimize SQL Server Performance with SolarWinds Database Perfo ...

Further, the performance metrics and associated recommendations at the query level, with Query Performance Analysis you also have the ability to click on the SQL TEXT tab to see the T-SQL code associated with the query as well as the SUPPORTING DATA tab with the ability to see the Database, User, Files, Machines, Programs, etc. corresponding to the query plan.


Find, Analyze and Optimize SQL Server Performance with SolarWinds Database Perfo ...
Find, Analyze and Optimize SQL Server Performance with SolarWinds Database Perfo ...
How can Query Performance Analyzer help me?

Query Performance Analyzer helps SQL Server Professionals by:

Intelligently displaying the most important performance information to streamline the performance tuning process by the DBA Ability to customize interface to review the most relevant metrics for your workload Viewing 30-day trend of the query performance with the ability to drill down into the query plan details Copying, pasting and minimally updating code to fast track the performance improvement Justifying performance recommendations: Query inefficiencies Index tuning Missing indexes Predicate issues Data type mismatches Outdated statistics

Viewing all articles
Browse latest Browse all 3160

Trending Articles