0% found this document useful (0 votes)
80 views51 pages

March 31 - April 2, 2009

What happens when you upgrade and how to deal with bottlenecks and performance problems on mid-range to large databases. What are the real benefits and liabilities with your SS2005 / 2008 installation? what are the quirks that can hold up large queries and how to troubleshoot them? what's your database supposed to do? Any discussion on performance should address what it is your system needs to do.

Uploaded by

neovik82
Copyright
© Attribution Non-Commercial (BY-NC)
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)
80 views51 pages

March 31 - April 2, 2009

What happens when you upgrade and how to deal with bottlenecks and performance problems on mid-range to large databases. What are the real benefits and liabilities with your SS2005 / 2008 installation? what are the quirks that can hold up large queries and how to troubleshoot them? what's your database supposed to do? Any discussion on performance should address what it is your system needs to do.

Uploaded by

neovik82
Copyright
© Attribution Non-Commercial (BY-NC)
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/ 51

March 31 – April 2, 2009

Maximizing SQL Server Performance


2005/2008
Mary Romero Sweeney
Microsoft
Copyright Sammamish Software Services 2008 (All rights reserved)
Maximizing SQL Server 2008
Performance
ƒWhat happens when you upgrade and how
to deal with bottlenecks and performance
problems on mid-range to large databases.
ƒWhat you'll learn:
ƒ What are the real benefits and liabilities with your
SS2005/2008 installation
ƒ How do existing jobs and packages really transfer
over
ƒ The 5 important techniques you need to know to get
the best performance from SS2005/2008
ƒ What are the quirks that can hold up large queries
and how to troubleshoot them
Copyright Sammamish Software Services 2008 (All rights reserved)
What’s your database supposed to
do?
ƒAny discussion on performance should
address what it is your system needs to do
ƒ OLTP – Online Transaction Processing
ƒ Dynamic data entry – highly normalized
ƒ DSS – Decision Support system
ƒ Denormalized data usually from a single OLTP
ƒ Data Warehouse
ƒ Pre-aggregated data for effective reporting usually
from multiple OLTP’s and other systems
ƒ All of the above?

Copyright Sammamish Software Services 2008 (All rights reserved)


New stuff in SQL Server 2008
Performance Data Collection
http://www.microsoft.com/sqlserver/2008/en/us/whats-new.aspx

Copyright Sammamish Software Services 2008 (All rights reserved)


New Stuff in SS2008
Query Governor

http://blogs.msdn.com/manisblog/archive/2008/11/16/sql-server-2008-resource-
governor-part-ii.aspx

Copyright Sammamish Software Services 2008 (All rights reserved)


New Stuff in SS2008
SSAS Improvements
ƒ Major improvements so that you should see performance
improvements out of the

ƒ Performance Hints in the MDX language (similar to query


hints in relational language)

Copyright Sammamish Software Services 2008 (All rights reserved)


SQL Server 2005/2008 Performance
For SQL Devs

Copyright Sammamish Software Services 2008 (All rights reserved)


Setting up a performance
tuning process
ƒCreate a baseline
ƒFollow a process
ƒDetermine price vs. Performance!
ƒIs the investment of time and $ worth the
gain?
ƒStay informed! (see resources at the end
of this presentation)
Copyright Sammamish Software Services 2008 (All rights reserved)
Create a Performance
baseline
ƒ Create a performance baseline by application
ƒMeasure apps current performance
(profiler tool); ensure you capture trends
rather than one time numbers
ƒ Measure workload and data changes over time
ƒ Evalaute both peak and non-peak usage stats
ƒCompare other configurations for
hardware and software
ƒWhat are your applications performance
goals?
Copyright Sammamish Software Services 2008 (All rights reserved)
Follow a process
ƒSee this little gem from
www.sqlcat.com:
ƒhttp://sqlcat.com/presentations/
archive/2008/04/18/troubleshooti
ng-sql-server-2005-2008-
performance-and-scalability-
flowchart.aspx

Copyright Sammamish Software Services 2008 (All rights reserved)


Top SQL Server Performance
Killers
ƒ Poor Indexing (see my
ƒ Excessive fragmentation
Indexing section later in this
presentation!) ƒ Execution plan issues
ƒ Inaccurate Statistics ƒ Non-reusable
ƒ Excessive blocking and ƒ Poor
deadlocks ƒ Frequent recompilation
ƒ Non-setbased operations ƒ TempDB issues
(usually using T-SQL cursors)
ƒ Poor Query Design
ƒ Poor DB design

Source : SQL Server 2008 Query Performance Tuning Distilled, Fritchey,


Apress 2009
Copyright Sammamish Software Services 2008 (All rights reserved)
SS2005/20088 Performance
Tips for setup
ƒ SQL Server 2005/2008 supports named
instances of SQL Server.
ƒ You can run up to 16 concurrent instances of SQL Server
2005/2008 on the same server.
ƒ Each running instance of SQL Server takes up server resources.
Some resources are shared by multiple running instances, i.e.,
MSDTC and Search services, but most aren’t. Because of this,
each additional instance of SQL Server running on the same
server has to fight for available resources, hurting performance

ƒ For best performance, don't mix production databases


and development (test or staging) databases on the
same physical server.
ƒ This not only serves to better separate the two functions
(production and development), but prevents developers from
using up server resources that could be better used by
production users.
Copyright Sammamish Software Services 2008 (All rights reserved)
2008 Query Performance
ƒ ms-
help://MS.VSCC.v90/MS.VSIPCC.v90/MS.SQLSVR.v1
0.en/s10de_4deptrbl/html/c2eb5f77-2dc1-49b4-
bd19-2cdac4c6cae1.htm

ƒ Troubleshooting SQL Server 2005/2008 Query


Performance/Scalability Issues flow chart

Copyright Sammamish Software Services 2008 (All rights reserved)


SS2005/2008 Performance
Tips: Dev
ƒ Use Truncate table instead of Delete. Truncate is “minimally
logged” ; then you must run Update Statistics!
ƒ If you must allow users to access to your data, e.g. using Excel or
Access, instead point them to a replicated reporting server i.e., a
DM or DW, rather than your OLTP
ƒ Use consistent coding style and format
ƒ Instead of SELECT COUNT(*) from <table_name> A much faster,
and more efficient, way of counting rows in a table is to run the
following query:
ƒ SELECT rows
FROM sysindexes
WHERE id = OBJECT_ID('<table_name>') AND indid < 2

Copyright Sammamish Software Services 2008 (All rights reserved)


Is understanding indexing
really all that important?

Copyright Sammamish Software Services 2008 (All rights reserved)


Indexing for performance
ƒ Create covered non-
clustered indexes (make use
of included columns)
ƒ Use DETA (Database Engine
Tuning Advisor) for help with
specific reporting queries.
ƒ Ensure all DB devs
understand DB design and
especially indexing basics
ƒ (See indexing basics at the
end of this file)

Copyright Sammamish Software Services 2008 (All rights reserved)


Indexing for performance
ƒIndexing is a key way
to affect performance
across multiple system
types
ƒ Multiple Non-clustered
indexes on a heap can be
preferable to the
Clustered primary key,
multiple non-clustered
indexes.
ƒ Create indexes on join
columns to avoid hash
lookups
Copyright Sammamish Software Services 2008 (All rights reserved)
How SQL Processes queries
ƒ A SELECT statement is nonprocedural; it does
not state the exact steps that the database
server should use to retrieve the requested
data. This means that the database server must
analyze the statement to determine the most
efficient way to extract the requested data.
ƒ This is referred to as optimizing the SELECT
statement. The component that does this is
called the query optimizer.
ƒ The input to the optimizer consists of the query,
the database schema (table and index
definitions), and the database statistics. The
output of the optimizer is a query execution
plan
Copyright Sammamish Software Services 2008 (All rights reserved)
Using Execution Plans
ƒ In SQL Server 2008, you can display
execution plans by using the
following methods:
ƒ SQL Server Management Studio
Displays either an estimated graphical
execution plan (statements do not
execute) or an actual graphical
execution plan (on executed
statements), which you can save and
view in Management Studio.
ƒ Transact-SQL SET statement options
When you use the Transact-SQL SET
statement options, you can produce
estimated and actual execution plans
in XML or text.
ƒ SQL Server Profiler event classes

ƒ Icon info:
ƒ http://msdn.microsoft.com/en-
us/library/ms175913.aspx
Copyright Sammamish Software Services 2008 (All rights reserved)
SQL Server system stored
procedures

ƒ sp_who/sp_who2 Reports snapshot information about current SQL


Server users and processes, including whether the statement is
blocked.

ƒ sp_lock Reports snapshot information about locks

ƒ sp_spaceused Displays an estimate of the current amount of disk


space used by a table (or a whole database).

ƒ sp_monitor Displays statistics, including CPU usage, I/O usage, and


the amount of time idle since sp_monitor was last executed.

ƒ Learn about some of the hundreds of Dynamic Management


views available in SQL Server 2005/2008.
Copyright Sammamish Software Services 2008 (All rights reserved)
Query optimizer hints:
select TesterContextID
, o.Name Operation
, elTester.Name Tester
, ts.ComputerName
, elGroup.Name TesterGroup
FROM dbo.TesterContext tc
join dbo.Operation o with (nolock) on o.OperationID = tc.OperationID
left JOIN dbo.TesterStation ts with (nolock) on ts.TesterStationID =
tc.TesterStationID
join dbo.EquipmentLocation ElTester with (nolock) on
ElTester.equipmentLocationID = tc.equipmentLocationID
left join dbo.EquipmentLocationHierarchy elh1 with (nolock) on
elh1.childLocationID = elTester.equipmentLocationID
left join dbo.EquipmentLocation ElGroup with (nolock) on
ElGroup.equipmentLocationID = elh1.ParentLocationID
left join dbo.EquipmentLocationHierarchy elh2 with (nolock) on
elh2.childLocationID = elGroup.equipmentLocationID
Copyright Sammamish Software Services 2008 (All rights reserved)
Tools: System Monitor
ƒAKA Perfmon
(Performance
Monitor)
ƒYou can view SQL
Server objects,
performance
counters, and the
behavior of other
objects
ƒ processors,
ƒ memory,
ƒ cache,
ƒ threads,
ƒ processes.
Copyright Sammamish Software Services 2008 (All rights reserved)
Tools: Activity Monitor

Copyright Sammamish Software Services 2008 (All rights reserved)


Tools: SQL Server Profiler
ƒ SQL Server Profiler is a graphical user interface to SQL
Trace for monitoring an instance of the SQL Server
Database Engine or Analysis Services. You can
capture and save data about each event to a file
or table to analyze later. For example, you can
monitor a production environment to see which
stored procedures are affecting performance by
executing too slowly.

Copyright Sammamish Software Services 2008 (All rights reserved)


Tools: DETA
ƒ Database Engine Tuning
Advisor analyzes the
performance effects of
workloads run against
one or more databases.
ƒ A workload is a set of
Transact-SQL statements
that executes against
databases you want to
tune.

ƒ DTA provides
recommendations to
add, remove, or modify
physical design
structures:
ƒ physical clustered
indexes,
ƒ nonclustered indexes,
ƒ indexed views, and
ƒ partitioning.
Copyright Sammamish Software Services 2008 (All rights reserved)
Horizontal data partitioning
ƒ Partitions enable organizations to manage
large, growing tables more effectively by
transparently breaking them into
manageable blocks of data.
ƒ SQL Server 2008 builds on the advances on
partitioning in SQL Server 2005 by improving
performance on large, partitioned tables.

Copyright Sammamish Software Services 2008 (All rights reserved)


Horizontal table partitioning
ƒHorizontal partitioning
Orders
is a good way to
increase database < 2004

performance in large
tables Orders

ƒData is partitioned 2004 -- 2008


horizontally by range
ƒNew to SQL Server Orders
2008 and replaces the 2008 -- 2006

practice of using views


and unions to partition
Copyright Sammamish Software Services 2008 (All rights reserved)
Process for partitioning a
table:
1. Create a partitioning function based on a field such
as a date -- this function can be used multiple times
for different tables
2. Add enough filegroups to your DB to
accommodate the # of partitions you want plus
one more for the "next" filegroup -- add a file to
each file group
3. Create a partitioning scheme that uses the
partitioning function
4. Create your table using the partitioning scheme
instead of assigning to a single file group.
Copyright Sammamish Software Services 2008 (All rights reserved)
Partition Functions Define
Partition Boundaries
• Boundary values can be assigned to LEFT or RIGHT

Orders Orders Orders Orders

< 2004 2004 -- 2008 2008 -- 2006 > 2006

CREATE PARTITION FUNCTION pf_OrderDate (datetime)


AS RANGE RIGHT
FOR VALUES ('01/01/2004', '01/01/2004', 01/01/2008')

Copyright Sammamish Software Services 2008 (All rights reserved)


Creating a partitioning
Scheme
ƒ Once you have created the appropriate number
of Filegroups desired to match the # of partitions
you want -- you will need to create a partitioning scheme

ƒ The partitioning scheme links the database partitions and the


partitioning function that you created earlier
CREATE PARTITION SCHEME ps_OrderDate
AS PARTITION pf_OrderDate
TO (fg1, fg2, fg3, fg4, fg5) This is the “next” filegroup!

‡ You will specify the partitioning scheme – instead of a filegroup –


when creating tables
CREATE TABLE dbo.PartitionedTransactions
(TransactionID int IDENTITY(1,1) NOT NULL,
ProductID int NOT NULL,
TransactionDate datetime NOT NULL DEFAULT (getdate()),
TransactionType nchar(1) NOT NULL)
ON ps_OrderDate(TransactionDate) -- name of new partition scheme
Copyright Sammamish Software Services 2008 (All rights reserved)
A process for performance
troubleshooting
www.sqlcat.com

http://sqlcat.com/presentations/archive/2008/04/18/troubleshooting-sql-server-
2005-2008-performance-and-scalability-flowchart.aspx
Copyright Sammamish Software Services 2008 (All rights reserved)
Indexing Basics

Copyright Sammamish Software Services 2008 (All rights reserved)


How data is stored

ƒ Data is stored in data pages in one of two arrangements:


ƒHeap
Page 4 Page 5 Page 6 Page 7 Page 8 Page 9
Con...470 Rudd...471 Alba...471 Smith ...470 Martin
...470 Grey...471
Funk...470 White
...470 Funk...472 Ortega...472 Phua...472 Jones
...470
White
...470 Barr...473 Smith...473 Jones...470 Jones
...473 Hall...470
... ... ... ... ... ... Martin
...470 ... ... ... Smith
...470 ... ... ...
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...

ƒBalanced tree Alba


...
Martin
Alba Martin
Grey Smith
... ...

Alba Grey Martin Smith


Barr Hall Martin Smith
Con Jones Ornish Smith
Fung Jones Phua White
Fung Jones Rudd White
Copyright Sammamish Software Services 2008 (All rights reserved)
Heap
Data Pages
Page 4 Page 5 Page 6 Page 7 Page 8 Page 9
Smith ... 470401 Rudd ... 470501 Alba ...470601 Smith ... 470701 Martin ...470801 Grey ... 470901
Fung ... 470402 White ... 470502 Fung ...470602 Ornish ... 470702 Phua ...470802 Jones ... 470902
White ... 470403 Barr ... 470503 Smith ...470603 Jones ... 470703 Jones ...470803 Hall ... 470904
... ... ... ... ... ... Martin ...470604 ... ... ... Smith ...470804 ... ... ...
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...

ƒ Heaps are a collection of data pages for a table


ƒ Heaps are best used for data for which most queries
on the table will usually or frequently span the entire
table
ƒ If you do not provide a clustered index for a table,
your table will be arranged in a heap
Copyright Sammamish Software Services 2008 (All rights reserved)
Balanced trees
ƒWhen you created a primary key you got a
balanced tree structure for your table by
default unless you specified “non-
clustered” (in which case you got a heap)
Alba
... Root node
Martin

Alba Martin Non-Leaf (intermediary)


Grey Smith nodes
... ...

Alba Grey Martin Smith Leaf nodes


Barr Hall Martin Smith
Con Jones Ornish Smith
Fung Jones Phua White
Fung Jones Rudd White
Copyright Sammamish Software Services 2008 (All rights reserved)
Indexes
ƒ Indexes provide an alternate way
of accessing data
Gardening
ƒ A table can have multiple indexes
just like a book.
ƒ Think of a gardening book with
plants organized by common
name, like daisy and pansy, and
an index with the scientific name
as an alternate, but quick, way of Scientific
names
accessing a specific kind of plant
ƒ Reasons to use indexes:
ƒ speeds data access,
ƒ enforces uniqueness of rows
Copyright Sammamish Software Services 2008 (All rights reserved)
How SQL Server Accesses Data
• Table scan
• SQL Server reads all table pages (same as clustered
index scan BTW!)
• Best for tables stored in a heap!
• Index seek
• SQL Server uses index pages to find rows
• Best for tables stored in a specified arrangement!
• Note: Indexes can facilitate the speed of some
queries and greatly slow others.
• We’ll see why…
Copyright Sammamish Software Services 2008 (All rights reserved)
Index Considerations
ƒ Pros
ƒ Speeds up data access; Enforces
uniqueness of rows
ƒ Cons
ƒ Consumes disk space; Incurs overhead

zHow SQL Server uses indexes:


{Determines Whether an Index Exists and Is
Useful
{Navigates Through the Index
{Evaluates the Search Value Against Each Key
Value and Repeats This Evaluation
Copyright Sammamish Software Services 2008 (All rights reserved)
Clustered Indexes
ƒ Each Table Can Have only one Clustered Index
because it represents the physical storage of the
table Each primary key gets an index; Clustered
index is the default when you create a primary
key unless you specify otherwise
ƒ The Physical Row Order of the Table and the
Order of Rows in the Index Are the Same
Alba
...
Martin
Alba Martin
Grey Smith
... ...

Alba Grey Martin Smith


Barr Hall Martin Smith
Con Jones Ornish Smith
Fung Jones Phua White
Fung Jones Rudd White
Copyright Sammamish Software Services 2008 (All rights reserved)
Non-clustered Indexes
ƒ Nonclustered indexes are the
SQL Server default when using the Create Index
statement
CREATE INDEX IX_ProductVendor_VendorID ON
Purchasing.ProductVendor (VendorID);

ƒ Existing non-clustered Indexes Are Automatically


Rebuilt When:
ƒ An existing clustered index is dropped
ƒ A clustered index is created
ƒ The DROP_EXISTING option is used to change which
columns define the clustered index
Copyright Sammamish Software Services 2008 (All rights reserved)
Multiple indexes
ƒIn an OLTP multiple indexes on a table are
generally the norm and generally beneficial
as long as well architected and maintained
ƒMore is NOT necessarily better!
Non-Clustered Alba
...
Alba
...
Martin Alba
Alba
...
Martin
Martin Alba Martin Alba ... Martin
indexes Alba
Grey
...
Martin
Smith
...
Grey
... Smith
... Grey
...
Alba
Martin Smith
...
Martin
Grey Smith
... Grey Martin ... Smith
Alba Grey Martin Smith Alba
Barr Grey
Hall Martin
Martin Smith
Smith Alba
Barr Hall Martin Smith
Barr
Con Hall
Jones Martin
Ornish Smith
Smith Con
Fung Jones
Jones Ornish
Phua Smith
White Con
Alba
Fung Jones
Grey
Jones Ornish
Martin Smith
Phua Smith
White
Fung Jones Phua White Fung Jones Rudd Barr
White ConFung Hall Martin
Jones Ornish
Jones Rudd Smith
White
Smith
Fung Jones Rudd White Fung
Fung Jones Phua
Jones Rudd White White
Alba
...
Martin
Alba
Grey Martin
Smith
... ... Alba
Alba Grey Martin ...
Barr
Con Hall
Jones Martin Smith
Ornish Smith Martin
Fung
Fung Jones
Jones Phua Smith
Rudd White
White
Alba Martin
Grey Smith
... ...

Alba Grey Martin Smith


Clustered index Barr Hall Martin Smith
Con Jones Ornish Smith
Fung Jones Phua White
Fung
Copyright Sammamish Software Services 2008 (All rights reserved)
Jones Rudd White
Non-clustered index on top of a heap
Index Pages Alba
Akhtar Non-Leaf
Non-leaf
... Level
Martin
Page 37 Page 28
Page 12 - Root
SELECT
Akhtar lastname,
Alba firstanme
Martin
Ganio
Grey Smith
FROM... member ...
WHERE lastname
Page 41 Page 51 Page 61 Page 71 Leaf Level
Akhtar BETWEEN
Alba 470601 Ganio'Martin'
Grey 470901 AND
Martin 'Rudd'
Martin 470801
470801 Smith 470603 (Key Value)
Barr 470503 Hall 470904 Martin
Martin 470604
470604 Smith 470804
Con 470401 Jones 470902 Ota
Ota 470702
470702 Smith 470701
Fung
Funk 470602 Jones 470803 Phua 470802
470802 White 470403
Fung
Funk 470402 Jones 470703 Rudd 470501
470501 White 470502

Data Pages
Heap data pages
Page 4 Page 5 Page 6 Page 7 Page 8 Page 9
Con ... 470401 Rudd ... 470501 Alba
Akhtar ...470601 Smith ... 470701 Martin
Martin ...470801 Grey ... 470901
Ganio
Funk
Fung ... 470402 White ... 470502 Fung
Funk ...470602 Ota ... 470702 Phua
Phua ...470802 Jones ... 470902
White ... 470403 Barr ... 470503 Smith ...470603 Jones ... 470703 Jones ...470803 Hall ... 470904
... ... ... ... ... ... Martin ...470604
...470604 ... ... ... Smith ...470804 ... ... ...
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...

Copyright Sammamish Software Services 2008 (All rights reserved)


Non-clustered index on clustered
index
1234
Index ... Non-Leaf
Non-leaf
Pages 5678 Level
Page 37 Page 28
Page 12 - Root
1234 5678
2234 7678
SELECT lastname, firstanme
... ...
Page 41 FROM member Page 51 Page 61 Page 71 Leaf Level
1234 Martin
1234 2234 White 5678 Barr 7678 Grey
Ganio
WHERE
1334 Fung
Funk member_no
2334 Alba
Akhtar 5778 Smith 8721 7778 Martin 7206 (Key Value)
BETWEEN
1434 Smith 2434 5678
Jones AND58786078
Ota
Ortega 7878 Phua
1534 Fung4705
Funk4705 2534 Con 5978 Jones 5788 7978 Smith 8772
1634 White9355 2634 Jones6002 6078 Rudd 8078 Hall

Clustered Alba
Akhtar
Index ...
Page 141 Martin Page 145
Akhtar
Alba Page 140 - Root Martin
Ganio
Grey Smith
... ...

2334 Alba
Akhtar ... 7678 Grey
Ganio ... 1234 Martin ... 1434 Smith ...
5678 Barr
Barr ... 8078 Hall ... 7778 Martin ... 7206 5778 Smith ... 8721
2534 Con ... 2434 Jones ... 5878 Ota
Ortega... 7978 Smith ... 8772
1334 Fung
Funk ... 5978 Jones ... 5788 7878 Phua ... 2234 White ...
Funk ... 4705
1534 Fung 2634 Jones ... 6002 6078 Rudd ... 1634 White ... 9355
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
Page 100 Page 110 Page 120 Page 130
Copyright Sammamish Software Services 2008 (All rights reserved)
What columns should I
index?
ƒ Columns to Index
ƒ Primary (gets an index by default) and foreign keys
(do not get an index by default)
ƒ Those frequently searched in ranges
ƒ Those frequently accessed in sorted order
ƒ Columns Not to Index
ƒ Those rarely referenced in queries (in the filter i.e.,
where clause)
ƒ Those that contain few unique values
ƒ e.g. the State column when most customers are local
ƒ Those defined with bit, text, or image data types
Copyright Sammamish Software Services 2008 (All rights reserved)
Using the FILLFACTOR Option
ƒ Specifies How Much to Fill the Page
ƒ Impacts Leaf-Level Pages only (not intermediary)
Data Pages Full
Con ... 470401 Alba ... 470601 Martin ... 470801
Fung ... 470402 Fung ... 470602 Phua ... 470802
White ... 470403 Smith ... 470603 Jones ... 470803
Rudd ... 470501 Martin ... 470604 Smith ... 470804
White ...470502 Smith ... 470701 Grey ... 470901
Barr ...470503 Ortega ...470702 Jones ...470902

Data Pages
50% Fillfactor
Con ... 470401 Rudd ... 470501 Alba ... 470601 Martin ... 470604 Martin ... 470801 Smith ... 470804
Fung ... 470402 White ... 470502 Fung ... 470402 Smith ... 470701 Phua ... 470802 Grey ... 470901
White ... 470403 Barr ... 470503 Smith ... 470603 Ortega ... 470702 Jones ... 470803 White ... 470902

Copyright Sammamish Software Services 2008 (All rights reserved)


Composite Indexes
CREATE NONCLUSTERED INDEX K_Contact_FullName
ON Person.Contact (LastName ASC, FirstName ASC)

Person.Contact
ContactI NameSty
D le Title Firstname M Lastname
1 0 Mr. Gustavo NULL Achong
2 0 Ms. Catherine R. Abel
3 0 Ms. Kim NULL Abercrombie
4 0 Sr. Column 1
Humberto NULL Acevedo Column 2
Composite
5 0 Sra. Pilar NULL Ackerman
Key

Note: yes one column can be involved in multiple indexes!


Copyright Sammamish Software Services 2008 (All rights reserved)
Problems with upgrades?
ƒ For those of you planning an upgrade:
ƒCheck the Upgrade advisor and
follow it in detail
ƒCheck forums and white papers
(see references on last page)

Copyright Sammamish Software Services 2008 (All rights reserved)


Mary’s Top 5 Performance
Recommendations for SQL Dev
ƒUse covering indexes and included columns
to improve query performance (understand
indexing!)
ƒUse the DETA to get indexing advice
ƒUnderstand and utilize query execution plans
ƒUse SQL Server file grouping and table
partitioning
ƒSet up a Performance Baseline and Process
Copyright Sammamish Software Services 2008 (All rights reserved)
References
ƒ Excellent Technet article:
ƒhttp://www.microsoft.com/te
chnet/prodtechnol/sql/bestpr
actice/dw_perf_top10.mspx
ƒ General SQL Server Performance Tuning Tips
ƒ Source : SQL Server 2008 Query
Performance Tuning Distilled, Fritchey,
Apress 2009

Copyright Sammamish Software Services 2008 (All rights reserved)


Resources (in addition to STP
Con!):
ƒ SQL Server white papers:
ƒ http://www.microsoft.com/sqlserver/2008/en/us/w
hite-papers.aspx
ƒ SQL Server performance web site:
ƒ http://www.sql-server-performance.com/
ƒ Website for enabling SQL server customers
ƒ http://www.sqlcat.com/

Copyright Sammamish Software Services 2008 (All rights reserved)


Summary
ƒ Dev strategies

ƒ Set up strategies

ƒ Resources

ƒ Good luck!

Copyright Sammamish Software Services 2008 (All rights reserved)

You might also like