0% found this document useful (0 votes)
120 views1 page

1403 Confio SQL Server Tuning Infographics 8 5x11

This document outlines a 12 step program for tuning SQL Server query performance. The steps include examining tables and filters, analyzing query columns, reviewing existing indexes, examining the execution plan, adjusting the query and indexes, and engineering out inefficient elements.

Uploaded by

Barry Ghotra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
120 views1 page

1403 Confio SQL Server Tuning Infographics 8 5x11

This document outlines a 12 step program for tuning SQL Server query performance. The steps include examining tables and filters, analyzing query columns, reviewing existing indexes, examining the execution plan, adjusting the query and indexes, and engineering out inefficient elements.

Uploaded by

Barry Ghotra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

SQL Server Query Performance Tuning:

A 12Step Program
CHECK FOR
TABLES + ROWCOUNTS

EXAMINE THE FILTERS

Make certain
you know the
rowcount

KNOW THE
SELECTIVITY OF
THE TABLES

2
1

Make sure youre


working with tables
(not views)

Examine WHERE and


JOIN clauses what is
the filtered rowcount?

Most useful
for RIGHT, LEFT,
OUTER joins

ANALYZE
QUERY COLUMS
Look for
CASE, CAST,
CONVERT

SARG-able
(make an index
searchable so a full
scan isnt needed)

Sub-queries

REVIEW EXISTING KEYS,


CONSTRAINTS
AND INDEXES

EXAMINE THE
EXECUTION PLAN

Check to see if covering


indexes can be created (avoid
duplication, overlapping)

Set statistics on (set


statistics IO on + set
statistics time on)

5
Know what objects
exist (avoid duplicating
efforts later on)

RE-RUN
THE QUERY

ADJUST
THE QUERY

RECORD
RESULTS

Focus on logical
I/O (number of
logical reads)

8
Record the
results and
compare

Look for logical reads


(fewer logical I/Os
means faster query)

CONSIDER ADJUSTING INDEXES

Make small
changes

Run the
plan

Check the actual


plan, not the
estimated plan

What is primary key


definition, and is it
clustered?

Focus on
most expensive
operations first

Make sure to work


with the smallest
possible logical set

Know when the


predicate is applied
should be earlier
rather than later

Look for select * or scalar


functions (the more data brought
back, the less optimal it may be
to use certain functions

Consider covering indexan


index that includes every
column that satisfies the query

Consider a filtered
index (but not if you
have parameterized
statements)

RE-RUN
THE QUERY

11

10

ENGINEER OUT
THE STUPID

Look to reduce
logical i/o

Cursors and
row-by-row
processing

Scalar functions

Join/query/table hints

Code-first generators
(EMF, LNQ, nHibernate)
can be mis-used and
bloat the plan cache

Nested views that go


across linked servers

12

Abuse of wildcards (*)


pulling back too many rows

Find and fix query performance faster with SolarWinds Database Performance Analyzer. Free 14-day trial at: www.solarwinds.com/dpa-download
2015 SolarWinds. All rights reserved.

You might also like