SlideShare a Scribd company logo
1 of 12
Inside
SQL Server Optimizer
By Hamid Jabarpour Fard
 Hamid Jabarpour Fard
 Consultant / Author / Trainer / Speaker
 Data Platform Specialist, Fard Solutions Sdn. Bhd.
 Email: Hamid@Fard-Solutions.com
 Website: http://www.Fard-Solutions.com
Agenda
 Optimizer Limitations with Filtered Indexes
 Forcing a Parallel Query Execution Plan
 Statistics on Ascending Columns
 Questions and Answers
 15 Minutes Break
Optimizer Limitations with Filtered Indexes
Demo
Optimizer Limitations with Filtered Indexes
 Conclusion
 Redundant join predicates can be necessary to match
filtered indexes.
 Filtered unique indexes do not provide uniqueness
information to the optimizer.
 In some cases it may be practical to simply add the
redundant predicates to every query.
Forcing a Parallel Query Execution Plan
Demo
Forcing a Parallel Query Execution Plan
 Conclusion
 Below actions make serial plan in SQL Server
 Table variable’s content modification.
 Any T-SQL scalar function.
 CLR scalar functions marked as performing data access.
 Random intrinsic functions including
OBJECT_NAME, ENCRYPTBYCERT and IDENT_CURRENT.
 System table access. (e.g. sys.tables)
 TOP
 Sequence Project (e.g. ROW_NUMBER, RANK)
 Recursive CTEs
Forcing a Parallel Query Execution Plan (Cont.)
 Conclusion
 Even experts with decades of SQL Server experience and
detailed internal knowledge will want to be careful with
trace 8649 flag.
Statistics on Ascending Columns
Demo
Statistics on Ascending Columns
 Conclusion
 This is just an alternative way to fix a problem that is seen
with large tables with ascending columns.
 The best solution is to update statistics periodically.
 Trace flag 2389 will work only for columns branded as
ascending.
 Trace flag 2390 does not make sense to do so because it
will stop working when the column turns out to be
ascending.
Questions and Answers
Thanks For Attending
This Event.

More Related Content

What's hot

SQL Server 2008 R2 - Implementing High Availabilitty
SQL Server 2008 R2 - Implementing High AvailabilittySQL Server 2008 R2 - Implementing High Availabilitty
SQL Server 2008 R2 - Implementing High AvailabilittyRishu Mehra
 
Database backup and recovery
Database backup and recoveryDatabase backup and recovery
Database backup and recoveryAnne Lee
 
Bi Capacity Planning
Bi Capacity PlanningBi Capacity Planning
Bi Capacity Planningmstmike
 
Database Administrator: Job Description, Salary and Future Scope
Database Administrator: Job Description, Salary and Future ScopeDatabase Administrator: Job Description, Salary and Future Scope
Database Administrator: Job Description, Salary and Future ScopeHR Krutika Meheta
 
It best practices
It best practicesIt best practices
It best practicesShivendoo
 
Online Reporting Architectures Behind Load Balancers
Online Reporting Architectures Behind Load BalancersOnline Reporting Architectures Behind Load Balancers
Online Reporting Architectures Behind Load BalancersCrystal Foor Manson
 
Database administrator: job description, salary and future scope
Database administrator: job description, salary and future scopeDatabase administrator: job description, salary and future scope
Database administrator: job description, salary and future scopeHR Krutika Meheta
 

What's hot (7)

SQL Server 2008 R2 - Implementing High Availabilitty
SQL Server 2008 R2 - Implementing High AvailabilittySQL Server 2008 R2 - Implementing High Availabilitty
SQL Server 2008 R2 - Implementing High Availabilitty
 
Database backup and recovery
Database backup and recoveryDatabase backup and recovery
Database backup and recovery
 
Bi Capacity Planning
Bi Capacity PlanningBi Capacity Planning
Bi Capacity Planning
 
Database Administrator: Job Description, Salary and Future Scope
Database Administrator: Job Description, Salary and Future ScopeDatabase Administrator: Job Description, Salary and Future Scope
Database Administrator: Job Description, Salary and Future Scope
 
It best practices
It best practicesIt best practices
It best practices
 
Online Reporting Architectures Behind Load Balancers
Online Reporting Architectures Behind Load BalancersOnline Reporting Architectures Behind Load Balancers
Online Reporting Architectures Behind Load Balancers
 
Database administrator: job description, salary and future scope
Database administrator: job description, salary and future scopeDatabase administrator: job description, salary and future scope
Database administrator: job description, salary and future scope
 

Similar to SQL Server - Inside Optimizer Engine

Challenges of Building a First Class SQL-on-Hadoop Engine
Challenges of Building a First Class SQL-on-Hadoop EngineChallenges of Building a First Class SQL-on-Hadoop Engine
Challenges of Building a First Class SQL-on-Hadoop EngineNicolas Morales
 
Fix My Functions: TSQL User Defined Functions in SQL Server
Fix My Functions: TSQL User Defined Functions in SQL ServerFix My Functions: TSQL User Defined Functions in SQL Server
Fix My Functions: TSQL User Defined Functions in SQL ServerKendra Little
 
SAP ABAP Online Training Institute in Hyderabad - C-Point
SAP ABAP Online Training Institute in Hyderabad - C-PointSAP ABAP Online Training Institute in Hyderabad - C-Point
SAP ABAP Online Training Institute in Hyderabad - C-Pointcpointss
 
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
 
oracle_soultion_oracledataintegrator_goldengate_2021
oracle_soultion_oracledataintegrator_goldengate_2021oracle_soultion_oracledataintegrator_goldengate_2021
oracle_soultion_oracledataintegrator_goldengate_2021ssuser8ccb5a
 
CERN_DIS_ODI_OGG_final_oracle_golde.pptx
CERN_DIS_ODI_OGG_final_oracle_golde.pptxCERN_DIS_ODI_OGG_final_oracle_golde.pptx
CERN_DIS_ODI_OGG_final_oracle_golde.pptxcamyla81
 
Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...
Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...
Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...Databricks
 
1 extreme performance - part i
1   extreme performance - part i1   extreme performance - part i
1 extreme performance - part isqlserver.co.il
 
Challenges of Implementing an Advanced SQL Engine on Hadoop
Challenges of Implementing an Advanced SQL Engine on HadoopChallenges of Implementing an Advanced SQL Engine on Hadoop
Challenges of Implementing an Advanced SQL Engine on HadoopDataWorks Summit
 
DB2 Real-Time Analytics Meeting Wayne, PA 2015 - IDAA & DB2 Tools Update
DB2 Real-Time Analytics Meeting Wayne, PA 2015 - IDAA & DB2 Tools UpdateDB2 Real-Time Analytics Meeting Wayne, PA 2015 - IDAA & DB2 Tools Update
DB2 Real-Time Analytics Meeting Wayne, PA 2015 - IDAA & DB2 Tools UpdateBaha Majid
 
Reliability and performance with ibm db2 analytics accelerator
Reliability and performance with ibm db2 analytics acceleratorReliability and performance with ibm db2 analytics accelerator
Reliability and performance with ibm db2 analytics acceleratorbupbechanhgmail
 
Evolutionary db development
Evolutionary db development Evolutionary db development
Evolutionary db development Open Party
 
FAST for SharePoint Deep Dive
FAST for SharePoint Deep DiveFAST for SharePoint Deep Dive
FAST for SharePoint Deep Diveneil_richards
 
Taking a look under the hood of Apache Flink's relational APIs.
Taking a look under the hood of Apache Flink's relational APIs.Taking a look under the hood of Apache Flink's relational APIs.
Taking a look under the hood of Apache Flink's relational APIs.Fabian Hueske
 
Fabian Hueske - Taking a look under the hood of Apache Flink’s relational APIs
Fabian Hueske - Taking a look under the hood of Apache Flink’s relational APIsFabian Hueske - Taking a look under the hood of Apache Flink’s relational APIs
Fabian Hueske - Taking a look under the hood of Apache Flink’s relational APIsFlink Forward
 
C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2Hammad Rajjoub
 
C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2Hammad Rajjoub
 
Query Tuning Azure SQL Databases
Query Tuning Azure SQL DatabasesQuery Tuning Azure SQL Databases
Query Tuning Azure SQL DatabasesGrant Fritchey
 
Anatomy of Data Frame API : A deep dive into Spark Data Frame API
Anatomy of Data Frame API :  A deep dive into Spark Data Frame APIAnatomy of Data Frame API :  A deep dive into Spark Data Frame API
Anatomy of Data Frame API : A deep dive into Spark Data Frame APIdatamantra
 

Similar to SQL Server - Inside Optimizer Engine (20)

Challenges of Building a First Class SQL-on-Hadoop Engine
Challenges of Building a First Class SQL-on-Hadoop EngineChallenges of Building a First Class SQL-on-Hadoop Engine
Challenges of Building a First Class SQL-on-Hadoop Engine
 
Fix My Functions: TSQL User Defined Functions in SQL Server
Fix My Functions: TSQL User Defined Functions in SQL ServerFix My Functions: TSQL User Defined Functions in SQL Server
Fix My Functions: TSQL User Defined Functions in SQL Server
 
SAP ABAP Online Training Institute in Hyderabad - C-Point
SAP ABAP Online Training Institute in Hyderabad - C-PointSAP ABAP Online Training Institute in Hyderabad - C-Point
SAP ABAP Online Training Institute in Hyderabad - C-Point
 
Discovering the plan cache (sql sat175)
Discovering the plan cache (sql sat175)Discovering the plan cache (sql sat175)
Discovering the plan cache (sql sat175)
 
oracle_soultion_oracledataintegrator_goldengate_2021
oracle_soultion_oracledataintegrator_goldengate_2021oracle_soultion_oracledataintegrator_goldengate_2021
oracle_soultion_oracledataintegrator_goldengate_2021
 
CERN_DIS_ODI_OGG_final_oracle_golde.pptx
CERN_DIS_ODI_OGG_final_oracle_golde.pptxCERN_DIS_ODI_OGG_final_oracle_golde.pptx
CERN_DIS_ODI_OGG_final_oracle_golde.pptx
 
Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...
Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...
Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...
 
1 extreme performance - part i
1   extreme performance - part i1   extreme performance - part i
1 extreme performance - part i
 
Challenges of Implementing an Advanced SQL Engine on Hadoop
Challenges of Implementing an Advanced SQL Engine on HadoopChallenges of Implementing an Advanced SQL Engine on Hadoop
Challenges of Implementing an Advanced SQL Engine on Hadoop
 
Spark sql meetup
Spark sql meetupSpark sql meetup
Spark sql meetup
 
DB2 Real-Time Analytics Meeting Wayne, PA 2015 - IDAA & DB2 Tools Update
DB2 Real-Time Analytics Meeting Wayne, PA 2015 - IDAA & DB2 Tools UpdateDB2 Real-Time Analytics Meeting Wayne, PA 2015 - IDAA & DB2 Tools Update
DB2 Real-Time Analytics Meeting Wayne, PA 2015 - IDAA & DB2 Tools Update
 
Reliability and performance with ibm db2 analytics accelerator
Reliability and performance with ibm db2 analytics acceleratorReliability and performance with ibm db2 analytics accelerator
Reliability and performance with ibm db2 analytics accelerator
 
Evolutionary db development
Evolutionary db development Evolutionary db development
Evolutionary db development
 
FAST for SharePoint Deep Dive
FAST for SharePoint Deep DiveFAST for SharePoint Deep Dive
FAST for SharePoint Deep Dive
 
Taking a look under the hood of Apache Flink's relational APIs.
Taking a look under the hood of Apache Flink's relational APIs.Taking a look under the hood of Apache Flink's relational APIs.
Taking a look under the hood of Apache Flink's relational APIs.
 
Fabian Hueske - Taking a look under the hood of Apache Flink’s relational APIs
Fabian Hueske - Taking a look under the hood of Apache Flink’s relational APIsFabian Hueske - Taking a look under the hood of Apache Flink’s relational APIs
Fabian Hueske - Taking a look under the hood of Apache Flink’s relational APIs
 
C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2
 
C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2
 
Query Tuning Azure SQL Databases
Query Tuning Azure SQL DatabasesQuery Tuning Azure SQL Databases
Query Tuning Azure SQL Databases
 
Anatomy of Data Frame API : A deep dive into Spark Data Frame API
Anatomy of Data Frame API :  A deep dive into Spark Data Frame APIAnatomy of Data Frame API :  A deep dive into Spark Data Frame API
Anatomy of Data Frame API : A deep dive into Spark Data Frame API
 

More from Hamid J. Fard

Sql server backup internals
Sql server backup internalsSql server backup internals
Sql server backup internalsHamid J. Fard
 
SQL Server High Availability Solutions (Pros & Cons)
SQL Server High Availability Solutions (Pros & Cons)SQL Server High Availability Solutions (Pros & Cons)
SQL Server High Availability Solutions (Pros & Cons)Hamid J. Fard
 
SQL Server Memory Pressure
SQL Server Memory PressureSQL Server Memory Pressure
SQL Server Memory PressureHamid J. Fard
 
SQL Server In-Memory Internals and Performance Tips
SQL Server In-Memory Internals and Performance TipsSQL Server In-Memory Internals and Performance Tips
SQL Server In-Memory Internals and Performance TipsHamid J. Fard
 
Fard Solutions Sdn Bhd
Fard Solutions Sdn Bhd Fard Solutions Sdn Bhd
Fard Solutions Sdn Bhd Hamid J. Fard
 
Sql server enterprise edition awareness
Sql server enterprise edition awarenessSql server enterprise edition awareness
Sql server enterprise edition awarenessHamid J. Fard
 
Data Platform Overview
Data Platform OverviewData Platform Overview
Data Platform OverviewHamid J. Fard
 
SQL Server 2016 Everything built-in FULL deck
SQL Server 2016 Everything built-in FULL deckSQL Server 2016 Everything built-in FULL deck
SQL Server 2016 Everything built-in FULL deckHamid J. Fard
 
SQL Server Security And Encryption
SQL Server Security And EncryptionSQL Server Security And Encryption
SQL Server Security And EncryptionHamid J. Fard
 
SQL Server Index and Partition Strategy
SQL Server Index and Partition StrategySQL Server Index and Partition Strategy
SQL Server Index and Partition StrategyHamid J. Fard
 

More from Hamid J. Fard (11)

Sql server backup internals
Sql server backup internalsSql server backup internals
Sql server backup internals
 
SQL Server High Availability Solutions (Pros & Cons)
SQL Server High Availability Solutions (Pros & Cons)SQL Server High Availability Solutions (Pros & Cons)
SQL Server High Availability Solutions (Pros & Cons)
 
SQL Server Memory Pressure
SQL Server Memory PressureSQL Server Memory Pressure
SQL Server Memory Pressure
 
SQL Server In-Memory Internals and Performance Tips
SQL Server In-Memory Internals and Performance TipsSQL Server In-Memory Internals and Performance Tips
SQL Server In-Memory Internals and Performance Tips
 
Fard Solutions Sdn Bhd
Fard Solutions Sdn Bhd Fard Solutions Sdn Bhd
Fard Solutions Sdn Bhd
 
Sql server enterprise edition awareness
Sql server enterprise edition awarenessSql server enterprise edition awareness
Sql server enterprise edition awareness
 
Data Platform Overview
Data Platform OverviewData Platform Overview
Data Platform Overview
 
SQL Server 2016 Everything built-in FULL deck
SQL Server 2016 Everything built-in FULL deckSQL Server 2016 Everything built-in FULL deck
SQL Server 2016 Everything built-in FULL deck
 
SQL Server Security And Encryption
SQL Server Security And EncryptionSQL Server Security And Encryption
SQL Server Security And Encryption
 
SQL Server Index and Partition Strategy
SQL Server Index and Partition StrategySQL Server Index and Partition Strategy
SQL Server Index and Partition Strategy
 
SQL Saturday #438
SQL Saturday #438SQL Saturday #438
SQL Saturday #438
 

Recently uploaded

BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxolyaivanovalion
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFxolyaivanovalion
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Smarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxSmarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxolyaivanovalion
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxolyaivanovalion
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxolyaivanovalion
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptxAnupama Kate
 
Capstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics ProgramCapstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics ProgramMoniSankarHazra
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusTimothy Spann
 
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779Delhi Call girls
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Callshivangimorya083
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionfulawalesam
 
Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxIntroduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxfirstjob4
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...amitlee9823
 
Carero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxCarero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxolyaivanovalion
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxBPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxMohammedJunaid861692
 

Recently uploaded (20)

BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptx
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFx
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Smarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxSmarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptx
 
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in  KishangarhDelhi 99530 vip 56974 Genuine Escort Service Call Girls in  Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptx
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFx
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx
 
Capstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics ProgramCapstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics Program
 
Sampling (random) method and Non random.ppt
Sampling (random) method and Non random.pptSampling (random) method and Non random.ppt
Sampling (random) method and Non random.ppt
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and Milvus
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
 
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interaction
 
Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxIntroduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptx
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
Carero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxCarero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptx
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxBPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
 

SQL Server - Inside Optimizer Engine

  • 1. Inside SQL Server Optimizer By Hamid Jabarpour Fard
  • 2.  Hamid Jabarpour Fard  Consultant / Author / Trainer / Speaker  Data Platform Specialist, Fard Solutions Sdn. Bhd.  Email: Hamid@Fard-Solutions.com  Website: http://www.Fard-Solutions.com
  • 3. Agenda  Optimizer Limitations with Filtered Indexes  Forcing a Parallel Query Execution Plan  Statistics on Ascending Columns  Questions and Answers  15 Minutes Break
  • 4. Optimizer Limitations with Filtered Indexes Demo
  • 5. Optimizer Limitations with Filtered Indexes  Conclusion  Redundant join predicates can be necessary to match filtered indexes.  Filtered unique indexes do not provide uniqueness information to the optimizer.  In some cases it may be practical to simply add the redundant predicates to every query.
  • 6. Forcing a Parallel Query Execution Plan Demo
  • 7. Forcing a Parallel Query Execution Plan  Conclusion  Below actions make serial plan in SQL Server  Table variable’s content modification.  Any T-SQL scalar function.  CLR scalar functions marked as performing data access.  Random intrinsic functions including OBJECT_NAME, ENCRYPTBYCERT and IDENT_CURRENT.  System table access. (e.g. sys.tables)  TOP  Sequence Project (e.g. ROW_NUMBER, RANK)  Recursive CTEs
  • 8. Forcing a Parallel Query Execution Plan (Cont.)  Conclusion  Even experts with decades of SQL Server experience and detailed internal knowledge will want to be careful with trace 8649 flag.
  • 9. Statistics on Ascending Columns Demo
  • 10. Statistics on Ascending Columns  Conclusion  This is just an alternative way to fix a problem that is seen with large tables with ascending columns.  The best solution is to update statistics periodically.  Trace flag 2389 will work only for columns branded as ascending.  Trace flag 2390 does not make sense to do so because it will stop working when the column turns out to be ascending.