Date post: | 29-Aug-2014 |
Category: |
Documents |
Upload: | kensimmons |
View: | 1,465 times |
Download: | 0 times |
The Art ofIndexing
Ken Simmons
http:
//w
ww
.flic
kr.c
om/p
hoto
s/h-
k-d/
2837
1287
11/
Who is this guy?
DBADeveloperAuthorSQL Server MVPIT Industry for 10+ years
ObjectivesIntroduce the different kinds of indexes and index options along with best practices for using them.Provide strategies for creating indexes by taking advantage of DMVs and the Plan Cache.Cover the various ways indexes can degrade performance along with options for finding and removing them.
http://www.flickr.com/photos/pandora_6666/4686646577/
http://www.flickr.com/photos/marsi/2208227079/
The Boring Technical
Stuffhttp://www.flickr.com/photos/paraflyer/386529128/
Types of Indexes
ClusteredNon ClusteredUniqueFilteredFull-TextSpatialXML
http://www.flickr.com/photos/leunix/518329490/
Types of Indexes
ClusteredNon ClusteredUniqueFilteredFull-TextSpatialXML
http://www.flickr.com/photos/leunix/518329490/
Types of Indexes
ClusteredNon ClusteredUniqueFilteredFull-TextSpatialXML
http://www.flickr.com/photos/leunix/518329490/
Types of Indexes
ClusteredNon ClusteredUniqueFilteredFull-TextSpatialXML
http://www.flickr.com/photos/leunix/518329490/
Regulations1 Clustered Index249 Non Clustered (2005)999 Non Clustered (2008)16 Columns or 900 Bytes
http://www.flickr.com/photos/slworking/2209152444/
CharacteristicsClustered IndexNarrowUniqueStaticIncreasing
http://www.flickr.com/photos/braden71/4539323020/
CharacteristicsClustered IndexNarrow
Less Data DuplicatedSmaller…
DatabasesBackupsMaintenance times
UniqueStaticIncreasing
http://www.flickr.com/photos/seibi/207579197/
CharacteristicsClustered IndexNarrowUnique
Not Required4 Byte UniquifierNarrow Remember?
StaticIncreasing
http://www.flickr.com/photos/fazen/3778408/
CharacteristicsClustered IndexNarrowUniqueStatic
Changes Cause… Additional Overhead for Non Clustered Indexes
Clustered Index Fragmentation
Increasinghttp://www.flickr.com/photos/st3f4n/4085958000/
CharacteristicsClustered IndexNarrowUniqueStaticIncreasing
Data is added to the end of the Index
Reduces Page Splits and Fragmentation
http://www.flickr.com/photos/kevinkrejci/3065365140/
CharacteristicsNon Clustered IndexCover Common QueriesLink to Clustered Index
Lookup
http://www.flickr.com/photos/dantaylor/1145628275/
The Cool Stuff
http://www.flickr.com/photos/fpat/4242800364/
Demo
http://www.flickr.com/photos/winterhalter/2883847843/
SELECT http://www.flickr.com/photos/funky64/3485138671/
http:
//w
ww
.flic
kr.c
om/p
hoto
s/kr
azyd
ad/6
0510
189
What about the thousands of other queries that run on my server?
http://www.flickr.com/photos/mattwright/244358275/
PerspectiveBetter
DMVs Provide a
Index UsageUnused IndexesExpensive To Maintain
Missing IndexesNo Query Information
Plan CacheQueryExecution PlanMissing Index Informationhttp://www.flickr.com/photos/danorbit/346563918/
Demo
http://www.flickr.com/photos/winterhalter/2883847843/
IntelligentMakeDecision
s
http://www.flickr.com/photos/belovedinc/4274873104/
Demo
http://www.flickr.com/photos/winterhalter/2883847843/
Review•Clustered Indexes•Unique, Narrow, Static, Increasing
•Non-Clustered Indexes•Cover Queries Not Covered By The Clustered Index•Use INCLUDE To Cover Non-Key Columns
•Use DMVs To Get A Better Perspective•Unused Indexes, Missing Indexes, Cached Plans
•Make Intelligent Decisions When Applying Indexes•Don’t Apply Indexes Based On Recommendations
http:
//w
ww
.flic
kr.c
om/p
hoto
s/tr
avel
inlib
raria
n/22
3839
049/
Contact InfoBlog
http://cybersql.blogspot.com/Email
[email protected] @KenSimmons
http://twitter.com/KenSimmonsLinkedIN
http://www.linkedin.com/in/kensimmons