SlideShare una empresa de Scribd logo
1 de 25
Descargar para leer sin conexión
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

Más contenido relacionado

La actualidad más candente

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 InsightsJanessa Lantz
 
Building the Artificially Intelligent Enterprise
Building the Artificially Intelligent EnterpriseBuilding the Artificially Intelligent Enterprise
Building the Artificially Intelligent EnterpriseDatabricks
 
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 PipelinesDatabricks
 
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 LabelDatabricks
 
Strategies for SQL Server Index Analysis
Strategies for SQL Server Index AnalysisStrategies for SQL Server Index Analysis
Strategies for SQL Server Index AnalysisJason 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 GuideVoltDB
 
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 VertaDatabricks
 
2016 09 measurecamp - event data modeling
2016 09 measurecamp - event data modeling2016 09 measurecamp - event data modeling
2016 09 measurecamp - event data modelingyalisassoon
 
Embedding Data & Analytics With Looker
Embedding Data & Analytics With LookerEmbedding Data & Analytics With Looker
Embedding Data & Analytics With LookerLooker
 
FlorenceAI: Reinventing Data Science at Humana
FlorenceAI: Reinventing Data Science at HumanaFlorenceAI: Reinventing Data Science at Humana
FlorenceAI: Reinventing Data Science at HumanaDatabricks
 
A taste of Snowplow Analytics data
A taste of Snowplow Analytics dataA taste of Snowplow Analytics data
A taste of Snowplow Analytics dataRobert 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 ModelingLooker
 
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 PlatformDatabricks
 
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 IntelligenceLooker
 
Tableau Customer Presentation
Tableau Customer PresentationTableau Customer Presentation
Tableau Customer PresentationSplunk
 
Data modeling trends for Analytics
Data modeling trends for AnalyticsData modeling trends for Analytics
Data modeling trends for AnalyticsIke Ellis
 
Understanding event data
Understanding event dataUnderstanding event data
Understanding event datayalisassoon
 

La actualidad más candente (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
 

Destacado

Geek Sync | SQL Server Indexing Basics
Geek Sync | SQL Server Indexing BasicsGeek Sync | SQL Server Indexing Basics
Geek Sync | SQL Server Indexing BasicsIDERA Software
 
Slideshare Directions
Slideshare DirectionsSlideshare Directions
Slideshare Directionswmsbierer
 
Introduction of sql server indexing
Introduction of sql server indexingIntroduction of sql server indexing
Introduction of sql server indexingMahabubur 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 BearingsTim Bonnar
 
FOLLOWING DIRECTIONS
FOLLOWING DIRECTIONSFOLLOWING DIRECTIONS
FOLLOWING DIRECTIONSdiegovasquezz
 
SQL Server 2016 SSRS and BI
SQL Server 2016 SSRS and BISQL Server 2016 SSRS and BI
SQL Server 2016 SSRS and BIMSDEVMTL
 
Giving directions
Giving directionsGiving directions
Giving directionsRakelMM
 
Asking and giving directions
Asking and giving directionsAsking and giving directions
Asking and giving directionsnunog6
 
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 whengRowena Wheng Rosalejos
 
Giving directions presentation_oseiasa_modelo
Giving directions presentation_oseiasa_modeloGiving directions presentation_oseiasa_modelo
Giving directions presentation_oseiasa_modeloOseias Alves
 

Destacado (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 a 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 2019Dave 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 AnalyticsDATAVERSITY
 
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 - DetroitMartin Gutenbrunner
 
Database Refactoring With Liquibase
Database Refactoring With LiquibaseDatabase Refactoring With Liquibase
Database Refactoring With LiquibaseIASA
 
Agile Database Development with Liquibase
Agile Database Development with LiquibaseAgile Database Development with Liquibase
Agile Database Development with LiquibaseTim Berglund
 
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 UpSIKM
 
Performance By Design
Performance By DesignPerformance By Design
Performance By DesignGuy 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 AnswersTung 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 IMDGsAli 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-performancekriptonium
 
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 EventsJason 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 a 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
 
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.
 
Big Data - Big Pitfalls.
Big Data - Big Pitfalls.Big Data - Big Pitfalls.
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?
 

Más de 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 passJason Strate
 
Introduction to Columnstore Indexes
Introduction to Columnstore IndexesIntroduction to Columnstore Indexes
Introduction to Columnstore IndexesJason Strate
 
The Flavors of Non-Clustered Indexes
The Flavors of Non-Clustered IndexesThe Flavors of Non-Clustered Indexes
The Flavors of Non-Clustered IndexesJason Strate
 
Necessary Evils, Building Optimized CRUD Procedures
Necessary Evils, Building Optimized CRUD ProceduresNecessary Evils, Building Optimized CRUD Procedures
Necessary Evils, Building Optimized CRUD ProceduresJason 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 IndexJason Strate
 
BuildingSecurity Audits with Extended Events
BuildingSecurity Audits with Extended EventsBuildingSecurity Audits with Extended Events
BuildingSecurity Audits with Extended EventsJason 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 indexingJason Strate
 
The Side Effect of NOLOCK
The Side Effect of NOLOCKThe Side Effect of NOLOCK
The Side Effect of NOLOCKJason Strate
 
Introduction to SQL Server Security
Introduction to SQL Server SecurityIntroduction to SQL Server Security
Introduction to SQL Server SecurityJason 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 FunctionJason Strate
 
What are you waiting for
What are you waiting forWhat are you waiting for
What are you waiting forJason Strate
 

Más de 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
 

Último

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 

Último (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 

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