SlideShare une entreprise Scribd logo
1  sur  25
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

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
 

Tendances (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
 

En vedette

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
 

En vedette (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
 

Similaire à 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
 

Similaire à 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?
 

Plus 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
 

Plus 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
 

Dernier

Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
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 WorkerThousandEyes
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
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 2024Rafal Los
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 

Dernier (20)

Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
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
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
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
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 

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