Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chris Shaw CShaw@Xtivia.com @SQLShaw Index Feng Shui Chris Shaw CShaw@Xtivia.com @SQLShaw.

Similar presentations


Presentation on theme: "Chris Shaw CShaw@Xtivia.com @SQLShaw Index Feng Shui Chris Shaw CShaw@Xtivia.com @SQLShaw."— Presentation transcript:

1 Chris Shaw CShaw@Xtivia.com @SQLShaw
Index Feng Shui Chris Shaw @SQLShaw

2 Rules of the Dojo Stop me and ask questions.
If it takes to long we may need to take it to a side bar. Feel free to me Scripts can be downloaded from my blog.

3 Sensei (About) CShaw@Xtivia.com 6 SQL Server MVP Awards
@SQLShaw 6 SQL Server MVP Awards 17 years of experience

4 Expectations Use this session as a launching pad. There is a lot of information in here, and we don’t have time to cover all of it.

5 What is an index Think of a book, if you are looking for Brain Surgery in a Medical book, where do you find the information you need? Could the page numbers be considered an index? Is the table of contents in the front of the book considered an index? What if there wasn’t an index or a TOC? How long would that take? Think about your MP3 player, is that an index?

6 B-tree Root Intermediate Leaf

7 Primary Index Types Heap Clustered Indexes Non-Clustered Indexes
A Table without a clustered index Clustered Indexes All the data in sorted in the Leaf Node Non-Clustered Indexes Contains rows identified in the index other data is retrieved by a lookup.

8 Leaf Node Heap Clustered Indexes Non-Clustered Indexes

9 Leaf Node Heap Clustered Indexes Non-Clustered Indexes

10 Index Types and Strategies
Column Store New in 2012 Modified in 2014 Covering All the data you need is in the index Filtered Ability to remove rows that are not needed

11 Column Store Ideal for OLAP databases
New Index type in SQL Server 2012 Enterprise Edition Non-Updateable SQL Server 2014 Updateable

12 Column Store Data is stored by column not by row Data is non-clustered
Data is non-Unique

13 Covering Indexes Most often used to match specific Queries.
Select [Name], [City], [State], [Cell], [ ] From Customers Allows the index to return all required data without additional I/O Big increase in performance Easy to overuse

14 Covering Indexes

15 Filtered Indexes Allow indexing of only relevant data.
ex. Index only non-null data Improves Maintenance Performance Improved Storage Improved Query Plans

16 Additional Index Terms
Selectivity The unique quality of data in a row Fill Factors The percentage of data on a page 80% fill factor leaves 20% free space 0 and 100 % are the same or are they? Page Splits Seeks Optimal use of the index Scans (RBAR) Analyzing each row.

17 Common Indexing Issues
Not being maintained - Index is there just fragmented As a table grows the search's slow Demo - Fragmented Indexes To much maintenance Not enough Indexes Slow Searches Demo - Missing Indexes To Many Indexes - When indexes hurt. Slow Insert Statements Demo - Demo Index Usage Indexes that get you only half way there. Book Mark Lookups

18 Entering the Zen Best decisions are made with complete information. Gather information using: DMV's Query Plans Performance Monitor Statistics IO Showplan_All

19 Demo

20 Maintenance Maintenance Plans
Difference between rebuild and re-organize?

21 Index FAQ Is the PK required to be clustered? What about Statistics?
How Often should I re-index. What about online re-indexing?

22 Thank You Questions @SQLShaw


Download ppt "Chris Shaw CShaw@Xtivia.com @SQLShaw Index Feng Shui Chris Shaw CShaw@Xtivia.com @SQLShaw."

Similar presentations


Ads by Google