SlideShare una empresa de Scribd logo
1 de 32
Descargar para leer sin conexión
The Flavors of
Non-Clustered Indexes
Introduction
Jason
Strate

e: jstrate@pragmaticworks.com
e: jasonstrate@gmail.com
b: www.jasonstrate.com
t: StrateSQL

Resources

jasonstrate.com/go/indexing

MAKING BUSINESS INTELLIGENT

www.pragmaticworks.com
About Pragmatic Works

•
•
•
•
•
•
•

Industry leaders in Microsoft BI and SQL Server
Platform
SQL Server Professionals - PASS Board of Directors,
Speakers, Authors and MVP’s
National Sales Team Divided by Microsoft
Territories
National System Integrator (NSI)
Gold Certified in Business Intelligence and Data
Platform
Platform Modernization/Safe Passage
Premier Partner for PDW SI Partner Program
MS PDW Partner of Year FY13
Frontline Partnership Partner of the Year for Big Data
Executive sponsor - Andy Mouacdie, WW sales director
PDW

•
•

Over 7,200 customers worldwide
Over 186,000 people in PW database for demand
generation
MAKING BUSINESS INTELLIGENT

www.pragmaticworks.com
Caution

There will
be lots of
ice cream
pictures
Many Flavors
http://www.flickr.com/photos/rnljc/5334858173
http://www.flickr.com/photos/8566600@N07/2562797853
http://www.flickr.com/photos/amayu/5475537796
Non-Clustered Indexes
• Sorted key values
– One or more columns
– Key values only
– Pointers to Heap or
Clustered Index rows
– Non-LOB data

• Secondary data access
– Bridge to the data

• Operations
– Index scan
– Index seek
MAKING BUSINESS INTELLIGENT

www.pragmaticworks.com
Agenda

Vanilla

Sundae

Neapolitan

Rocky Road

Sugar Cone

Gelato

MAKING BUSINESS INTELLIGENT

www.pragmaticworks.com
VANILLA

http://www.flickr.com/photos/cowbite/3452599539/
Single Column Index
• Provides a secondary path to data
• Allows alternative paths for finding data
• One column is stored outside table
– Data is sorted by key
– Includes clustered index keys

• Focus on most used columns for filters
• Do not index every column

MAKING BUSINESS INTELLIGENT

www.pragmaticworks.com
Demo

SINGLE COLUMN

http://www.flickr.com/photos/cowbite/3452599539/
SUNDAE
Index Intersection
• Leverages multiple non-clustered indexes
• Filters on both indexes
• Returns the “intersection” of both indexes

Index
1
Index
2
MAKING BUSINESS INTELLIGENT

www.pragmaticworks.com
Demo

INDEX INTERSECTION
NEAPOLITAN
Multiple Column Index
• Two or more columns in the same index
• Index sorted from left to right
– Cannot skip columns to leverage sort

• Cover filters over multiple columns
– Or cover non-filtered columns

• Reduces number of indexes needed

MAKING BUSINESS INTELLIGENT

www.pragmaticworks.com
Demo

MULTIPLE COLUMN
ROCKY ROAD

http://www.flickr.com/photos/stuart_spivack/2069689027/
Included Columns
•
•
•
•
•

Additional columns needed for queries
Typically data not included in index
Included columns brings in data pages
Store specific columns unsorted with index
Don’t included all columns
– Or even most

• Be cautious of update rate of data
MAKING BUSINESS INTELLIGENT

www.pragmaticworks.com
Demo

INCLUDED COLUMN

http://www.flickr.com/photos/stuart_spivack/2069689027/
SUGAR CONE
Filtered Indexes
• Add a WHERE clause to your index
• Changes the contents of the index
– Reduction in pages
– Reduction in size
– Lessen impact of index scan

• Unmatched Index warning

MAKING BUSINESS INTELLIGENT

www.pragmaticworks.com
Demo

FILTERED INDEXES
GELATO
Foreign Key Indexes
• All foreign keys should be indexed
– Not an index property

•
•
•
•

Constraint leverages sorts on validation
Can reduce locking, blocking, and deadlocks
Common problem in many systems
Silent killer of the database

MAKING BUSINESS INTELLIGENT

www.pragmaticworks.com
FOREIGN KEYS
SUMMARY

MAKING BUSINESS INTELLIGENT

www.pragmaticworks.com
Summary
•
•
•
•

You can get by on “vanilla” indexes
Indexes can vary in flavors
These flavors help improve your databases
Filtered indexes, included columns, and
multiple columns

MAKING BUSINESS INTELLIGENT

www.pragmaticworks.com
Learn More About Indexes

MAKING BUSINESS INTELLIGENT

www.pragmaticworks.com
For more information…
Name: Jason Strate
Email: jstrate@pragmaticworks.com

Blog: www.jasonstrate.com
Resource: jasonstrate.com/go/indexing

Products
BI products to covert to a Microsoft BI
platform and simplify development on
the platform.

Services
Speed development through training, and
rapid development services from
Pragmatic Works.

Foundation
Helping those who do not have the
means to get into information technology
achieve their dreams.

Más contenido relacionado

Similar a The Flavors of Non-Clustered Indexes

5 ways to improve performance through indexing
5 ways to improve performance through indexing5 ways to improve performance through indexing
5 ways to improve performance through indexing
Jason Strate
 
web analysis document | web analysis document | web analysis document | web a...
web analysis document | web analysis document | web analysis document | web a...web analysis document | web analysis document | web analysis document | web a...
web analysis document | web analysis document | web analysis document | web a...
nazen2
 
Web Analytics, heartbeat for your Online Marketing
Web Analytics, heartbeat for your Online MarketingWeb Analytics, heartbeat for your Online Marketing
Web Analytics, heartbeat for your Online Marketing
Steve De Veirman
 

Similar a The Flavors of Non-Clustered Indexes (20)

Introduction to Columnstore Indexes
Introduction to Columnstore IndexesIntroduction to Columnstore Indexes
Introduction to Columnstore Indexes
 
Magento SEO - ThinkVis Sept 2012
Magento SEO - ThinkVis Sept 2012Magento SEO - ThinkVis Sept 2012
Magento SEO - ThinkVis Sept 2012
 
Philadelphia Area Sitecore User Group Meetup - October 2013
Philadelphia Area Sitecore User Group Meetup - October 2013Philadelphia Area Sitecore User Group Meetup - October 2013
Philadelphia Area Sitecore User Group Meetup - October 2013
 
5 ways to improve performance through indexing
5 ways to improve performance through indexing5 ways to improve performance through indexing
5 ways to improve performance through indexing
 
Google analytics cim ipswich bootcamp 15 nov12
Google analytics cim ipswich bootcamp 15 nov12Google analytics cim ipswich bootcamp 15 nov12
Google analytics cim ipswich bootcamp 15 nov12
 
Designing your SharePoint Internet site: The basics
Designing your SharePoint Internet site: The basicsDesigning your SharePoint Internet site: The basics
Designing your SharePoint Internet site: The basics
 
SPS Nashville - Build It and They Will Come SharePoint 2013 User Adoption
SPS Nashville - Build It and They Will Come SharePoint 2013 User AdoptionSPS Nashville - Build It and They Will Come SharePoint 2013 User Adoption
SPS Nashville - Build It and They Will Come SharePoint 2013 User Adoption
 
Practical Roadmap to High Performance Websites
Practical Roadmap to High Performance WebsitesPractical Roadmap to High Performance Websites
Practical Roadmap to High Performance Websites
 
Clase 03
Clase 03Clase 03
Clase 03
 
December 2020 Microsoft 365 Need to Know Webinar
December 2020 Microsoft 365 Need to Know WebinarDecember 2020 Microsoft 365 Need to Know Webinar
December 2020 Microsoft 365 Need to Know Webinar
 
web analysis document | web analysis document | web analysis document | web a...
web analysis document | web analysis document | web analysis document | web a...web analysis document | web analysis document | web analysis document | web a...
web analysis document | web analysis document | web analysis document | web a...
 
Sitecore Commerce Analytics
Sitecore Commerce AnalyticsSitecore Commerce Analytics
Sitecore Commerce Analytics
 
Sap business by design Cloud ERP System
Sap business by design Cloud ERP SystemSap business by design Cloud ERP System
Sap business by design Cloud ERP System
 
Web 2.0 Components for Business Websites
Web 2.0 Components for Business WebsitesWeb 2.0 Components for Business Websites
Web 2.0 Components for Business Websites
 
Web Analytics, heartbeat for your Online Marketing
Web Analytics, heartbeat for your Online MarketingWeb Analytics, heartbeat for your Online Marketing
Web Analytics, heartbeat for your Online Marketing
 
How We Localize & Mobilize WP Sites - Pubcon 2013
How We Localize & Mobilize WP Sites - Pubcon 2013How We Localize & Mobilize WP Sites - Pubcon 2013
How We Localize & Mobilize WP Sites - Pubcon 2013
 
Setting Yourself up for Success: Building an Analytics Schema and Data Dictio...
Setting Yourself up for Success: Building an Analytics Schema and Data Dictio...Setting Yourself up for Success: Building an Analytics Schema and Data Dictio...
Setting Yourself up for Success: Building an Analytics Schema and Data Dictio...
 
Faceted Navigation: (Almost) Everyone is Doing it Wrong
Faceted Navigation: (Almost) Everyone is Doing it WrongFaceted Navigation: (Almost) Everyone is Doing it Wrong
Faceted Navigation: (Almost) Everyone is Doing it Wrong
 
A taste of Snowplow Analytics data
A taste of Snowplow Analytics dataA taste of Snowplow Analytics data
A taste of Snowplow Analytics data
 
Webanalytics with Microsoft BI
Webanalytics with Microsoft BIWebanalytics with Microsoft BI
Webanalytics with Microsoft BI
 

Más de Jason Strate

BuildingSecurity Audits with Extended Events
BuildingSecurity Audits with Extended EventsBuildingSecurity Audits with Extended Events
BuildingSecurity Audits with Extended Events
Jason Strate
 
Discovering the plan cache (sql sat175)
Discovering the plan cache (sql sat175)Discovering the plan cache (sql sat175)
Discovering the plan cache (sql sat175)
Jason Strate
 
Introduction to SQL Server Security
Introduction to SQL Server SecurityIntroduction to SQL Server Security
Introduction to SQL Server Security
Jason Strate
 
What are you waiting for? (#SQLSat211)
What are you waiting for? (#SQLSat211)What are you waiting for? (#SQLSat211)
What are you waiting for? (#SQLSat211)
Jason Strate
 
Discovering the plan cache (#SQLSat211)
Discovering the plan cache (#SQLSat211)Discovering the plan cache (#SQLSat211)
Discovering the plan cache (#SQLSat211)
Jason Strate
 
Discovering the Plan Cache (#SQLSat 206)
Discovering the Plan Cache (#SQLSat 206)Discovering the Plan Cache (#SQLSat 206)
Discovering the Plan Cache (#SQLSat 206)
Jason Strate
 
A Function by Any Other Name is a Function
A Function by Any Other Name is a FunctionA Function by Any Other Name is a Function
A Function by Any Other Name is a Function
Jason Strate
 
What are you waiting for
What are you waiting forWhat are you waiting for
What are you waiting for
Jason Strate
 

Más de Jason Strate (16)

Accelerating Business Intelligence Solutions with Microsoft Azure pass
Accelerating Business Intelligence Solutions with Microsoft Azure   passAccelerating Business Intelligence Solutions with Microsoft Azure   pass
Accelerating Business Intelligence Solutions with Microsoft Azure pass
 
The Plan Cache Whisperer - Performance Tuning SQL Server
The Plan Cache Whisperer - Performance Tuning SQL ServerThe Plan Cache Whisperer - Performance Tuning SQL Server
The Plan Cache Whisperer - Performance Tuning SQL Server
 
Strategies for SQL Server Index Analysis
Strategies for SQL Server Index AnalysisStrategies for SQL Server Index Analysis
Strategies for SQL Server Index Analysis
 
Leveraging Cloud for the Modern SQL Developer
Leveraging Cloud for the Modern SQL DeveloperLeveraging Cloud for the Modern SQL Developer
Leveraging Cloud for the Modern SQL Developer
 
Getting Started with Windows Azure and SQL Databases
Getting Started with Windows Azure and SQL DatabasesGetting Started with Windows Azure and SQL Databases
Getting Started with Windows Azure and SQL Databases
 
5 SQL Server Indexing Myths
5 SQL Server Indexing Myths5 SQL Server Indexing Myths
5 SQL Server Indexing Myths
 
BuildingSecurity Audits with Extended Events
BuildingSecurity Audits with Extended EventsBuildingSecurity Audits with Extended Events
BuildingSecurity Audits with Extended Events
 
5 Amazing Reasons DBAs Need to Love Extended Events
5 Amazing Reasons DBAs Need to Love Extended Events5 Amazing Reasons DBAs Need to Love Extended Events
5 Amazing Reasons DBAs Need to Love Extended Events
 
The Side Effect of NOLOCK
The Side Effect of NOLOCKThe Side Effect of NOLOCK
The Side Effect of NOLOCK
 
Discovering the plan cache (sql sat175)
Discovering the plan cache (sql sat175)Discovering the plan cache (sql sat175)
Discovering the plan cache (sql sat175)
 
Introduction to SQL Server Security
Introduction to SQL Server SecurityIntroduction to SQL Server Security
Introduction to SQL Server Security
 
What are you waiting for? (#SQLSat211)
What are you waiting for? (#SQLSat211)What are you waiting for? (#SQLSat211)
What are you waiting for? (#SQLSat211)
 
Discovering the plan cache (#SQLSat211)
Discovering the plan cache (#SQLSat211)Discovering the plan cache (#SQLSat211)
Discovering the plan cache (#SQLSat211)
 
Discovering the Plan Cache (#SQLSat 206)
Discovering the Plan Cache (#SQLSat 206)Discovering the Plan Cache (#SQLSat 206)
Discovering the Plan Cache (#SQLSat 206)
 
A Function by Any Other Name is a Function
A Function by Any Other Name is a FunctionA Function by Any Other Name is a Function
A Function by Any Other Name is a Function
 
What are you waiting for
What are you waiting forWhat are you waiting for
What are you waiting for
 

Último

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 

The Flavors of Non-Clustered Indexes