SlideShare a Scribd company logo
INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM
5 SQL Server
Indexing Myths
INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM2
Introduction
Jason
Strate
e: jstrate@pragmaticworks.com
e: jasonstrate@gmail.com
b: www.jasonstrate.com
t: StrateSQL
Resources www.jasonstrate.com/go/indexing
INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM3
Unicorns aren’t real!
INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM4
I want to
believe!
INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM5
But husky
rhinos are!
INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM6
Primary Keys Are Always Clustered
INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM7
Primary Keys Are Always Clustered
Primary keys are clustered by default
Common point of confusion
Often the desired behavior
Is the primary key a good clustered index?
Static and stable
Ever increasing
INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM
Primary Keys Are Always Clustered
Demo
INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM9
Index Column Order Doesn’t Matter
INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM10
Index Column Order Doesn’t Matter
Using and seeking an index are not the same
Read execution plans carefully
Validate scans versus seeks
Indexes are sorted left to right
All columns are not required
Scans aren’t necessarily bad
INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM11
Index Column Order Doesn’t Matter
Col1 Col2
A 1
A 2
A 3
B 1
B 2
B 3
C 1
C 2
C 3
A 1
INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM
Index Column Order Doesn’t Matter
Demo
INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM13
Clustered Indexes Are Physically Ordered
INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM14
Clustered Indexes Are Physically Ordered
Clustered indexes sort data within the index
Accurately find specific values
A before B, B before C
Physical sorted at the tree level
Path data access directly to the required page
Logically sorted at the page level
Minimize page rewrites on DML
INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM
Clustered Indexes Are Physically Ordered
Demo
INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM16
Fill Factor Affects Insert Operations
INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM17
Fill Factor Affects Insert Operations
Fill factor leaves space on data pages
Why do we do this?
Leave space for DML operations
Mitigate page splits during DML operations
Provides a buffer for data variability
INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM18
Fill Factor Affects Insert Operations
INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM19
Fill Factor Affects Insert Operations
INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM
Fill Factor Affects Insert Operations
Demo
INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM21
Every Table Should Have a Heap/Clustered Index
INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM22
Every Table Should Have a XXX Index
Blanket statements suck
Doesn’t account for all situations
Or even most situations
Not 50/50
Not 90/10
Is there a safe answer?
INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM23
Heap / Clustered Indexes
Heap
• Non-selective access
• Bulk Loaded tables
• Fragmentation prone
with high inserts
• Staging tables
Clustered Index
• Highly modified data
• Singleton access
• Range scans
• Key ordered results
INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM
5 SQL Server
Indexing Myths
Questions?
Products
Improve the quality,
productivity, and performance
of your SQL Server and BI
solutions.
Services
Speed development through
training and rapid
development services from
Pragmatic Works.
Foundation
Helping those who don’t have
the means to get into
information technology and to
achieve their dreams.
Name: Jason Strate
Email: jstrate@pragmaticworks.com
Blog: www.jasonstrate.com
Resource: www.jasonstrate.com/go/indexing
Need Help? jasonstrate.com/go/vmdba

More Related Content

What's hot

How to Build a Data-Driven Company: From Infrastructure to Insights
How to Build a Data-Driven Company: From Infrastructure to InsightsHow to Build a Data-Driven Company: From Infrastructure to Insights
How to Build a Data-Driven Company: From Infrastructure to Insights
Janessa Lantz
 
Building the Artificially Intelligent Enterprise
Building the Artificially Intelligent EnterpriseBuilding the Artificially Intelligent Enterprise
Building the Artificially Intelligent Enterprise
Databricks
 
Code Once Use Often with Declarative Data Pipelines
Code Once Use Often with Declarative Data PipelinesCode Once Use Often with Declarative Data Pipelines
Code Once Use Often with Declarative Data Pipelines
Databricks
 
Brokering Data: Accelerating Data Evaluation with Databricks White Label
Brokering Data: Accelerating Data Evaluation with Databricks White LabelBrokering Data: Accelerating Data Evaluation with Databricks White Label
Brokering Data: Accelerating Data Evaluation with Databricks White Label
Databricks
 
Strategies for SQL Server Index Analysis
Strategies for SQL Server Index AnalysisStrategies for SQL Server Index Analysis
Strategies for SQL Server Index Analysis
Jason Strate
 
Stored Procedure Superpowers: A Developer’s Guide
Stored Procedure Superpowers: A Developer’s GuideStored Procedure Superpowers: A Developer’s Guide
Stored Procedure Superpowers: A Developer’s Guide
VoltDB
 
A2B Data™ Brochure
A2B Data™ BrochureA2B Data™ Brochure
A2B Data™ Brochure
Sherri Sheriff
 
Model Monitoring at Scale with Apache Spark and Verta
Model Monitoring at Scale with Apache Spark and VertaModel Monitoring at Scale with Apache Spark and Verta
Model Monitoring at Scale with Apache Spark and Verta
Databricks
 
2016 09 measurecamp - event data modeling
2016 09 measurecamp - event data modeling2016 09 measurecamp - event data modeling
2016 09 measurecamp - event data modeling
yalisassoon
 
Embedding Data & Analytics With Looker
Embedding Data & Analytics With LookerEmbedding Data & Analytics With Looker
Embedding Data & Analytics With Looker
Looker
 
FlorenceAI: Reinventing Data Science at Humana
FlorenceAI: Reinventing Data Science at HumanaFlorenceAI: Reinventing Data Science at Humana
FlorenceAI: Reinventing Data Science at Humana
Databricks
 
Tableau API
Tableau APITableau API
Tableau API
Dmitry Anoshin
 
A taste of Snowplow Analytics data
A taste of Snowplow Analytics dataA taste of Snowplow Analytics data
A taste of Snowplow Analytics data
Robert Kingston
 
Beyond Data Discovery: The Value Unlocked by Modern Data Modeling
Beyond Data Discovery: The Value Unlocked by Modern Data ModelingBeyond Data Discovery: The Value Unlocked by Modern Data Modeling
Beyond Data Discovery: The Value Unlocked by Modern Data Modeling
Looker
 
Democratizing Data Quality Through a Centralized Platform
Democratizing Data Quality Through a Centralized PlatformDemocratizing Data Quality Through a Centralized Platform
Democratizing Data Quality Through a Centralized Platform
Databricks
 
Portable Scalable Data Visualization Techniques for Apache Spark and Python N...
Portable Scalable Data Visualization Techniques for Apache Spark and Python N...Portable Scalable Data Visualization Techniques for Apache Spark and Python N...
Portable Scalable Data Visualization Techniques for Apache Spark and Python N...
Databricks
 
When and Where to Embed Business Intelligence
When and Where to Embed Business IntelligenceWhen and Where to Embed Business Intelligence
When and Where to Embed Business Intelligence
Looker
 
Tableau Customer Presentation
Tableau Customer PresentationTableau Customer Presentation
Tableau Customer Presentation
Splunk
 
Data modeling trends for Analytics
Data modeling trends for AnalyticsData modeling trends for Analytics
Data modeling trends for Analytics
Ike Ellis
 
Understanding event data
Understanding event dataUnderstanding event data
Understanding event data
yalisassoon
 

What's hot (20)

How to Build a Data-Driven Company: From Infrastructure to Insights
How to Build a Data-Driven Company: From Infrastructure to InsightsHow to Build a Data-Driven Company: From Infrastructure to Insights
How to Build a Data-Driven Company: From Infrastructure to Insights
 
Building the Artificially Intelligent Enterprise
Building the Artificially Intelligent EnterpriseBuilding the Artificially Intelligent Enterprise
Building the Artificially Intelligent Enterprise
 
Code Once Use Often with Declarative Data Pipelines
Code Once Use Often with Declarative Data PipelinesCode Once Use Often with Declarative Data Pipelines
Code Once Use Often with Declarative Data Pipelines
 
Brokering Data: Accelerating Data Evaluation with Databricks White Label
Brokering Data: Accelerating Data Evaluation with Databricks White LabelBrokering Data: Accelerating Data Evaluation with Databricks White Label
Brokering Data: Accelerating Data Evaluation with Databricks White Label
 
Strategies for SQL Server Index Analysis
Strategies for SQL Server Index AnalysisStrategies for SQL Server Index Analysis
Strategies for SQL Server Index Analysis
 
Stored Procedure Superpowers: A Developer’s Guide
Stored Procedure Superpowers: A Developer’s GuideStored Procedure Superpowers: A Developer’s Guide
Stored Procedure Superpowers: A Developer’s Guide
 
A2B Data™ Brochure
A2B Data™ BrochureA2B Data™ Brochure
A2B Data™ Brochure
 
Model Monitoring at Scale with Apache Spark and Verta
Model Monitoring at Scale with Apache Spark and VertaModel Monitoring at Scale with Apache Spark and Verta
Model Monitoring at Scale with Apache Spark and Verta
 
2016 09 measurecamp - event data modeling
2016 09 measurecamp - event data modeling2016 09 measurecamp - event data modeling
2016 09 measurecamp - event data modeling
 
Embedding Data & Analytics With Looker
Embedding Data & Analytics With LookerEmbedding Data & Analytics With Looker
Embedding Data & Analytics With Looker
 
FlorenceAI: Reinventing Data Science at Humana
FlorenceAI: Reinventing Data Science at HumanaFlorenceAI: Reinventing Data Science at Humana
FlorenceAI: Reinventing Data Science at Humana
 
Tableau API
Tableau APITableau API
Tableau API
 
A taste of Snowplow Analytics data
A taste of Snowplow Analytics dataA taste of Snowplow Analytics data
A taste of Snowplow Analytics data
 
Beyond Data Discovery: The Value Unlocked by Modern Data Modeling
Beyond Data Discovery: The Value Unlocked by Modern Data ModelingBeyond Data Discovery: The Value Unlocked by Modern Data Modeling
Beyond Data Discovery: The Value Unlocked by Modern Data Modeling
 
Democratizing Data Quality Through a Centralized Platform
Democratizing Data Quality Through a Centralized PlatformDemocratizing Data Quality Through a Centralized Platform
Democratizing Data Quality Through a Centralized Platform
 
Portable Scalable Data Visualization Techniques for Apache Spark and Python N...
Portable Scalable Data Visualization Techniques for Apache Spark and Python N...Portable Scalable Data Visualization Techniques for Apache Spark and Python N...
Portable Scalable Data Visualization Techniques for Apache Spark and Python N...
 
When and Where to Embed Business Intelligence
When and Where to Embed Business IntelligenceWhen and Where to Embed Business Intelligence
When and Where to Embed Business Intelligence
 
Tableau Customer Presentation
Tableau Customer PresentationTableau Customer Presentation
Tableau Customer Presentation
 
Data modeling trends for Analytics
Data modeling trends for AnalyticsData modeling trends for Analytics
Data modeling trends for Analytics
 
Understanding event data
Understanding event dataUnderstanding event data
Understanding event data
 

Viewers also liked

Geek Sync | SQL Server Indexing Basics
Geek Sync | SQL Server Indexing BasicsGeek Sync | SQL Server Indexing Basics
Geek Sync | SQL Server Indexing Basics
IDERA Software
 
Writing optimal queries
Writing optimal queriesWriting optimal queries
Writing optimal queries
Sourabh Agarwal
 
Slideshare Directions
Slideshare DirectionsSlideshare Directions
Slideshare Directions
wmsbierer
 
Giving directions
Giving directionsGiving directions
Giving directions
IES LUIS VIVES / Leganés
 
Giving directions
Giving directionsGiving directions
Giving directions
Videoconferencias UTPL
 
Introduction of sql server indexing
Introduction of sql server indexingIntroduction of sql server indexing
Introduction of sql server indexing
Mahabubur Rahaman
 
Database index(sql server)
Database index(sql server)Database index(sql server)
Database index(sql server)
Aaron King
 
Direction and Bearings
Direction and BearingsDirection and Bearings
Direction and Bearings
Tim Bonnar
 
FOLLOWING DIRECTIONS
FOLLOWING DIRECTIONSFOLLOWING DIRECTIONS
FOLLOWING DIRECTIONS
diegovasquezz
 
Asking for and giving Directions
Asking for and giving DirectionsAsking for and giving Directions
Asking for and giving Directions
Silpakorn University
 
Bearings lesson
Bearings lessonBearings lesson
Bearings lesson
Adam Harbott
 
SQL Server 2016 SSRS and BI
SQL Server 2016 SSRS and BISQL Server 2016 SSRS and BI
SQL Server 2016 SSRS and BI
MSDEVMTL
 
Giving directions
Giving directionsGiving directions
Giving directions
RakelMM
 
Asking and giving directions
Asking and giving directionsAsking and giving directions
Asking and giving directions
Myriam Romero Godoy
 
Asking and giving directions
Asking and giving directionsAsking and giving directions
Asking and giving directions
nunog6
 
Asking and giving directions by ajarn wheng
Asking and giving directions by ajarn whengAsking and giving directions by ajarn wheng
Asking and giving directions by ajarn wheng
Rowena Wheng Rosalejos
 
Asking & giving directions
Asking & giving directionsAsking & giving directions
Asking & giving directions
Alejandra Riveros
 
Asking and giving direction
Asking and giving directionAsking and giving direction
Asking and giving direction
هاشم محمد
 
Asking giving directions
Asking giving directionsAsking giving directions
Asking giving directions
MargaRenedoGomez
 
Giving directions presentation_oseiasa_modelo
Giving directions presentation_oseiasa_modeloGiving directions presentation_oseiasa_modelo
Giving directions presentation_oseiasa_modelo
Oseias Alves
 

Viewers also liked (20)

Geek Sync | SQL Server Indexing Basics
Geek Sync | SQL Server Indexing BasicsGeek Sync | SQL Server Indexing Basics
Geek Sync | SQL Server Indexing Basics
 
Writing optimal queries
Writing optimal queriesWriting optimal queries
Writing optimal queries
 
Slideshare Directions
Slideshare DirectionsSlideshare Directions
Slideshare Directions
 
Giving directions
Giving directionsGiving directions
Giving directions
 
Giving directions
Giving directionsGiving directions
Giving directions
 
Introduction of sql server indexing
Introduction of sql server indexingIntroduction of sql server indexing
Introduction of sql server indexing
 
Database index(sql server)
Database index(sql server)Database index(sql server)
Database index(sql server)
 
Direction and Bearings
Direction and BearingsDirection and Bearings
Direction and Bearings
 
FOLLOWING DIRECTIONS
FOLLOWING DIRECTIONSFOLLOWING DIRECTIONS
FOLLOWING DIRECTIONS
 
Asking for and giving Directions
Asking for and giving DirectionsAsking for and giving Directions
Asking for and giving Directions
 
Bearings lesson
Bearings lessonBearings lesson
Bearings lesson
 
SQL Server 2016 SSRS and BI
SQL Server 2016 SSRS and BISQL Server 2016 SSRS and BI
SQL Server 2016 SSRS and BI
 
Giving directions
Giving directionsGiving directions
Giving directions
 
Asking and giving directions
Asking and giving directionsAsking and giving directions
Asking and giving directions
 
Asking and giving directions
Asking and giving directionsAsking and giving directions
Asking and giving directions
 
Asking and giving directions by ajarn wheng
Asking and giving directions by ajarn whengAsking and giving directions by ajarn wheng
Asking and giving directions by ajarn wheng
 
Asking & giving directions
Asking & giving directionsAsking & giving directions
Asking & giving directions
 
Asking and giving direction
Asking and giving directionAsking and giving direction
Asking and giving direction
 
Asking giving directions
Asking giving directionsAsking giving directions
Asking giving directions
 
Giving directions presentation_oseiasa_modelo
Giving directions presentation_oseiasa_modeloGiving directions presentation_oseiasa_modelo
Giving directions presentation_oseiasa_modelo
 

Similar to 5 SQL Server Indexing Myths

7 Database Mistakes YOU Are Making -- Linuxfest Northwest 2019
7 Database Mistakes YOU Are Making -- Linuxfest Northwest 20197 Database Mistakes YOU Are Making -- Linuxfest Northwest 2019
7 Database Mistakes YOU Are Making -- Linuxfest Northwest 2019
Dave Stokes
 
Data Modeling, Normalization, and De-Normalization | PostgresOpen 2019 | Dimi...
Data Modeling, Normalization, and De-Normalization | PostgresOpen 2019 | Dimi...Data Modeling, Normalization, and De-Normalization | PostgresOpen 2019 | Dimi...
Data Modeling, Normalization, and De-Normalization | PostgresOpen 2019 | Dimi...
Citus Data
 
ADV Slides: 2021 Trends in Enterprise Analytics
ADV Slides: 2021 Trends in Enterprise AnalyticsADV Slides: 2021 Trends in Enterprise Analytics
ADV Slides: 2021 Trends in Enterprise Analytics
DATAVERSITY
 
Don't Drop ACID (July 2021)
Don't Drop ACID (July 2021)Don't Drop ACID (July 2021)
Don't Drop ACID (July 2021)
Matthew Groves
 
Old code doesn't stink - Detroit
Old code doesn't stink - DetroitOld code doesn't stink - Detroit
Old code doesn't stink - Detroit
Martin Gutenbrunner
 
Database Refactoring With Liquibase
Database Refactoring With LiquibaseDatabase Refactoring With Liquibase
Database Refactoring With Liquibase
IASA
 
Agile Database Development with Liquibase
Agile Database Development with LiquibaseAgile Database Development with Liquibase
Agile Database Development with Liquibase
Tim Berglund
 
Big Data - Big Pitfalls.
Big Data - Big Pitfalls.Big Data - Big Pitfalls.
Big Data - Big Pitfalls.
Roman Nikitchenko
 
Java/Scala Lab: Роман Никитченко - Big Data - Big Pitfalls.
Java/Scala Lab: Роман Никитченко - Big Data - Big Pitfalls.Java/Scala Lab: Роман Никитченко - Big Data - Big Pitfalls.
Java/Scala Lab: Роман Никитченко - Big Data - Big Pitfalls.
GeeksLab Odessa
 
Alchemy of Data Elements - Top Down Meets Bottom Up
Alchemy of Data Elements - Top Down Meets Bottom UpAlchemy of Data Elements - Top Down Meets Bottom Up
Alchemy of Data Elements - Top Down Meets Bottom Up
SIKM
 
Performance By Design
Performance By DesignPerformance By Design
Performance By Design
Guy Harrison
 
Top 100 .NET Interview Questions and Answers
Top 100 .NET Interview Questions and AnswersTop 100 .NET Interview Questions and Answers
Top 100 .NET Interview Questions and Answers
Tung Nguyen Thanh
 
Hybrid Transactional/Analytics Processing with Spark and IMDGs
Hybrid Transactional/Analytics Processing with Spark and IMDGsHybrid Transactional/Analytics Processing with Spark and IMDGs
Hybrid Transactional/Analytics Processing with Spark and IMDGs
Ali Hodroj
 
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
 
Kill mysql-performance
Kill mysql-performanceKill mysql-performance
Kill mysql-performance
kriptonium
 
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
Jason Strate
 
Big Data: fall seven times, stand up eight!
Big Data: fall seven times, stand up eight!Big Data: fall seven times, stand up eight!
Big Data: fall seven times, stand up eight!
Roman Nikitchenko
 
Documenting serverless architectures could we do it better - o'reily sa con...
Documenting serverless architectures  could we do it better  - o'reily sa con...Documenting serverless architectures  could we do it better  - o'reily sa con...
Documenting serverless architectures could we do it better - o'reily sa con...
Asher Sterkin
 
Spark SQL Adaptive Execution Unleashes The Power of Cluster in Large Scale wi...
Spark SQL Adaptive Execution Unleashes The Power of Cluster in Large Scale wi...Spark SQL Adaptive Execution Unleashes The Power of Cluster in Large Scale wi...
Spark SQL Adaptive Execution Unleashes The Power of Cluster in Large Scale wi...
Databricks
 
Does it only have to be ML + AI?
Does it only have to be ML + AI?Does it only have to be ML + AI?
Does it only have to be ML + AI?
Harald Erb
 

Similar to 5 SQL Server Indexing Myths (20)

7 Database Mistakes YOU Are Making -- Linuxfest Northwest 2019
7 Database Mistakes YOU Are Making -- Linuxfest Northwest 20197 Database Mistakes YOU Are Making -- Linuxfest Northwest 2019
7 Database Mistakes YOU Are Making -- Linuxfest Northwest 2019
 
Data Modeling, Normalization, and De-Normalization | PostgresOpen 2019 | Dimi...
Data Modeling, Normalization, and De-Normalization | PostgresOpen 2019 | Dimi...Data Modeling, Normalization, and De-Normalization | PostgresOpen 2019 | Dimi...
Data Modeling, Normalization, and De-Normalization | PostgresOpen 2019 | Dimi...
 
ADV Slides: 2021 Trends in Enterprise Analytics
ADV Slides: 2021 Trends in Enterprise AnalyticsADV Slides: 2021 Trends in Enterprise Analytics
ADV Slides: 2021 Trends in Enterprise Analytics
 
Don't Drop ACID (July 2021)
Don't Drop ACID (July 2021)Don't Drop ACID (July 2021)
Don't Drop ACID (July 2021)
 
Old code doesn't stink - Detroit
Old code doesn't stink - DetroitOld code doesn't stink - Detroit
Old code doesn't stink - Detroit
 
Database Refactoring With Liquibase
Database Refactoring With LiquibaseDatabase Refactoring With Liquibase
Database Refactoring With Liquibase
 
Agile Database Development with Liquibase
Agile Database Development with LiquibaseAgile Database Development with Liquibase
Agile Database Development with Liquibase
 
Big Data - Big Pitfalls.
Big Data - Big Pitfalls.Big Data - Big Pitfalls.
Big Data - Big Pitfalls.
 
Java/Scala Lab: Роман Никитченко - Big Data - Big Pitfalls.
Java/Scala Lab: Роман Никитченко - Big Data - Big Pitfalls.Java/Scala Lab: Роман Никитченко - Big Data - Big Pitfalls.
Java/Scala Lab: Роман Никитченко - Big Data - Big Pitfalls.
 
Alchemy of Data Elements - Top Down Meets Bottom Up
Alchemy of Data Elements - Top Down Meets Bottom UpAlchemy of Data Elements - Top Down Meets Bottom Up
Alchemy of Data Elements - Top Down Meets Bottom Up
 
Performance By Design
Performance By DesignPerformance By Design
Performance By Design
 
Top 100 .NET Interview Questions and Answers
Top 100 .NET Interview Questions and AnswersTop 100 .NET Interview Questions and Answers
Top 100 .NET Interview Questions and Answers
 
Hybrid Transactional/Analytics Processing with Spark and IMDGs
Hybrid Transactional/Analytics Processing with Spark and IMDGsHybrid Transactional/Analytics Processing with Spark and IMDGs
Hybrid Transactional/Analytics Processing with Spark and IMDGs
 
Discovering the plan cache (sql sat175)
Discovering the plan cache (sql sat175)Discovering the plan cache (sql sat175)
Discovering the plan cache (sql sat175)
 
Kill mysql-performance
Kill mysql-performanceKill mysql-performance
Kill mysql-performance
 
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
 
Big Data: fall seven times, stand up eight!
Big Data: fall seven times, stand up eight!Big Data: fall seven times, stand up eight!
Big Data: fall seven times, stand up eight!
 
Documenting serverless architectures could we do it better - o'reily sa con...
Documenting serverless architectures  could we do it better  - o'reily sa con...Documenting serverless architectures  could we do it better  - o'reily sa con...
Documenting serverless architectures could we do it better - o'reily sa con...
 
Spark SQL Adaptive Execution Unleashes The Power of Cluster in Large Scale wi...
Spark SQL Adaptive Execution Unleashes The Power of Cluster in Large Scale wi...Spark SQL Adaptive Execution Unleashes The Power of Cluster in Large Scale wi...
Spark SQL Adaptive Execution Unleashes The Power of Cluster in Large Scale wi...
 
Does it only have to be ML + AI?
Does it only have to be ML + AI?Does it only have to be ML + AI?
Does it only have to be ML + AI?
 

More from Jason Strate

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
Jason Strate
 
Introduction to Columnstore Indexes
Introduction to Columnstore IndexesIntroduction to Columnstore Indexes
Introduction to Columnstore Indexes
Jason Strate
 
The Flavors of Non-Clustered Indexes
The Flavors of Non-Clustered IndexesThe Flavors of Non-Clustered Indexes
The Flavors of Non-Clustered Indexes
Jason Strate
 
Necessary Evils, Building Optimized CRUD Procedures
Necessary Evils, Building Optimized CRUD ProceduresNecessary Evils, Building Optimized CRUD Procedures
Necessary Evils, Building Optimized CRUD Procedures
Jason Strate
 
How Do Non-Clustered Indexes Improve Performance?
How Do Non-Clustered Indexes Improve Performance?How Do Non-Clustered Indexes Improve Performance?
How Do Non-Clustered Indexes Improve Performance?
Jason Strate
 
Choosing Your Clustered Index
Choosing Your Clustered IndexChoosing Your Clustered Index
Choosing Your Clustered Index
Jason Strate
 
BuildingSecurity Audits with Extended Events
BuildingSecurity Audits with Extended EventsBuildingSecurity Audits with Extended Events
BuildingSecurity Audits with Extended Events
Jason Strate
 
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
 
The Side Effect of NOLOCK
The Side Effect of NOLOCKThe Side Effect of NOLOCK
The Side Effect of NOLOCK
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
 

More from Jason Strate (15)

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
 
Introduction to Columnstore Indexes
Introduction to Columnstore IndexesIntroduction to Columnstore Indexes
Introduction to Columnstore Indexes
 
The Flavors of Non-Clustered Indexes
The Flavors of Non-Clustered IndexesThe Flavors of Non-Clustered Indexes
The Flavors of Non-Clustered Indexes
 
Necessary Evils, Building Optimized CRUD Procedures
Necessary Evils, Building Optimized CRUD ProceduresNecessary Evils, Building Optimized CRUD Procedures
Necessary Evils, Building Optimized CRUD Procedures
 
How Do Non-Clustered Indexes Improve Performance?
How Do Non-Clustered Indexes Improve Performance?How Do Non-Clustered Indexes Improve Performance?
How Do Non-Clustered Indexes Improve Performance?
 
Choosing Your Clustered Index
Choosing Your Clustered IndexChoosing Your Clustered Index
Choosing Your Clustered Index
 
BuildingSecurity Audits with Extended Events
BuildingSecurity Audits with Extended EventsBuildingSecurity Audits with Extended Events
BuildingSecurity Audits with Extended Events
 
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
 
The Side Effect of NOLOCK
The Side Effect of NOLOCKThe Side Effect of NOLOCK
The Side Effect of NOLOCK
 
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
 

Recently uploaded

A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Zilliz
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 

Recently uploaded (20)

A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 

5 SQL Server Indexing Myths

  • 1. INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM 5 SQL Server Indexing Myths
  • 2. INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM2 Introduction Jason Strate e: jstrate@pragmaticworks.com e: jasonstrate@gmail.com b: www.jasonstrate.com t: StrateSQL Resources www.jasonstrate.com/go/indexing
  • 3. INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM3 Unicorns aren’t real!
  • 4. INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM4 I want to believe!
  • 5. INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM5 But husky rhinos are!
  • 6. INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM6 Primary Keys Are Always Clustered
  • 7. INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM7 Primary Keys Are Always Clustered Primary keys are clustered by default Common point of confusion Often the desired behavior Is the primary key a good clustered index? Static and stable Ever increasing
  • 8. INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM Primary Keys Are Always Clustered Demo
  • 9. INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM9 Index Column Order Doesn’t Matter
  • 10. INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM10 Index Column Order Doesn’t Matter Using and seeking an index are not the same Read execution plans carefully Validate scans versus seeks Indexes are sorted left to right All columns are not required Scans aren’t necessarily bad
  • 11. INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM11 Index Column Order Doesn’t Matter Col1 Col2 A 1 A 2 A 3 B 1 B 2 B 3 C 1 C 2 C 3 A 1
  • 12. INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM Index Column Order Doesn’t Matter Demo
  • 13. INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM13 Clustered Indexes Are Physically Ordered
  • 14. INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM14 Clustered Indexes Are Physically Ordered Clustered indexes sort data within the index Accurately find specific values A before B, B before C Physical sorted at the tree level Path data access directly to the required page Logically sorted at the page level Minimize page rewrites on DML
  • 15. INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM Clustered Indexes Are Physically Ordered Demo
  • 16. INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM16 Fill Factor Affects Insert Operations
  • 17. INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM17 Fill Factor Affects Insert Operations Fill factor leaves space on data pages Why do we do this? Leave space for DML operations Mitigate page splits during DML operations Provides a buffer for data variability
  • 18. INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM18 Fill Factor Affects Insert Operations
  • 19. INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM19 Fill Factor Affects Insert Operations
  • 20. INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM Fill Factor Affects Insert Operations Demo
  • 21. INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM21 Every Table Should Have a Heap/Clustered Index
  • 22. INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM22 Every Table Should Have a XXX Index Blanket statements suck Doesn’t account for all situations Or even most situations Not 50/50 Not 90/10 Is there a safe answer?
  • 23. INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM23 Heap / Clustered Indexes Heap • Non-selective access • Bulk Loaded tables • Fragmentation prone with high inserts • Staging tables Clustered Index • Highly modified data • Singleton access • Range scans • Key ordered results
  • 24. INTELLIGENT DATA SOLUTIONS WWW.PRAGMATICWORKS.COM 5 SQL Server Indexing Myths Questions?
  • 25. Products Improve the quality, productivity, and performance of your SQL Server and BI solutions. Services Speed development through training and rapid development services from Pragmatic Works. Foundation Helping those who don’t have the means to get into information technology and to achieve their dreams. Name: Jason Strate Email: jstrate@pragmaticworks.com Blog: www.jasonstrate.com Resource: www.jasonstrate.com/go/indexing Need Help? jasonstrate.com/go/vmdba