SlideShare a Scribd company logo
1 of 11
12 Trace Flags
In 12-ish Minutes
Matt Slocum
Matt Slocum – Who am I?
 DBA manager with a passion for SQL Server
 Experience with SQL Server v6.5-2014
 Specialize in replication and performance tuning
 MCITP: DBA SQL 2005 & 2008
 MCSE: SQL 2012 Data Platform
 Leader of Rochester PASS SSUG
 Established SQL Saturday Rochester
 5th annual event was in May 2016
11/17/201612 Trace Flags in 12-ish Minutes2 |
How To Use Trace Flags
 Ad-hoc Enable
 DBCC TRACEON (####, -1)
 #### = Trace Flag
 -1 (optional) = Server vs. Query level
 Ad-hoc Disable
 DBCC TRACEOFF (####, -1)
 Status
 DBCC TRACESTATUS
 Startup Parameter - SQL Server Configuration Manager
 -T####
 Query option
 OPTION (QUERYTRACEON ####)
3 | 11/17/201612 Trace Flags in 12-ish Minutes
High IO Databases (TempDB & User)
 TF 1117 (Server level)
 Grow all data files on a database when one data file
needs to grow
 Keeps data files consistently sized
 Use: On all instances that have DBs with > 1 data file
 TF 1118 (Server level)
 Reserve an entire Extent in the data cache when one
new page is allocated
 Reduces overhead of allocating additional pages
 Use: On every instance everywhere
4 | 11/17/201612 Trace Flags in 12-ish Minutes
SQL 2014/2016 Cardinality Estimator
 TF 9481 (Server or Session/Query level)
 Use emulated SQL 2012 Cardinality Estimator
 Use: SQL 2014 plans are not as optimal as 2012
 TF 2312 (Session/Query level)
 Forces SQL 2014 Native Cardinality Estimator
 Only need to use when 9481 is set at the server level
 Use: When 9481 is set on the server and you have
queries that perform better with the SQL 2014 CE
5 | 11/17/201612 Trace Flags in 12-ish Minutes
Statistics Auto Updates/Estimations
 TF 2371 (Server level)
 Reduce percentage of change required before
automatically updating statistics on large tables
 Use: Everywhere (SQL 2008 R2+)
 TF 2389/2390 (Server level)
 Affects statistics on ascending columns
 Query optimizer will query the highest value from the
column so that it can create accurate estimates
 Use: When you experience bad estimates when
querying columns with ascending values
6 | 11/17/201612 Trace Flags in 12-ish Minutes
Tune Query Plan Generation
 TF 6498 (Server level)
 Enables multiple simultaneous large query
compilations in SQL 2014
 Use: SQL 2014 when you experience this wait:
RESOURCE_SEMAPHORE_QUERY_COMPILE
 TF 4136 (Server or Session/Query level)
 Disables parameter sniffing
 Causes reduced performance on skewed datasets
 Use: Query level preferred when parameter sniffing
causes poor performance.
7 | 11/17/201612 Trace Flags in 12-ish Minutes
Optimize CPU utilization
 TF 8008 (Server level)
 Cause the scheduler to evaluate which NUMA/soft-
NUMA node to execute a query on
 Prevents one CPU/NUMA node from running hot
while the others are much less utilized
 Use: If you see CPU contention on one NUMA node
 TF 8048 (Server level)
 Optimizes how the scheduler assigns work to NUMA
nodes with > 8 logical CPUs.
 SQL 2008 - 2014 SP1 (soft-NUMA in 2014 SP2)
 Use: Run queries in MS article to determine if needed
8 | 11/17/201612 Trace Flags in 12-ish Minutes
Suppress Successful Backup Logs
 TF 3226
 Successful backups are not logged to the
ERRORLOG
 Keeps your ERRORLOG cleaner
 Use: All instances of SQL Server
9 | 11/17/201612 Trace Flags in 12-ish Minutes
Conclusion
 Test, test, TEST
 Official MS recommendations
 https://support.microsoft.com/en-us/kb/2964518
 Do your homework and see what works
 If you don’t need it, don’t use it
 SQL 2016 enables a lot automatically:
 https://www.brentozar.com/archive/2016/03/sq
l-server-2016-death-trace-flag/
10 | 11/17/201612 Trace Flags in 12-ish Minutes
Thank you!
 Blog: www.sqlmatt.com
 Twitter: @SlocumMatt
 Rochester PASS Website:
http://rochesterpass.sqlpass.org/
11 | 11/17/201612 Trace Flags in 12-ish Minutes

More Related Content

What's hot

Microsoft sql server architecture
Microsoft sql server architectureMicrosoft sql server architecture
Microsoft sql server architectureNaveen Boda
 
SQL Server Query Optimization, Execution and Debugging Query Performance
SQL Server Query Optimization, Execution and Debugging Query PerformanceSQL Server Query Optimization, Execution and Debugging Query Performance
SQL Server Query Optimization, Execution and Debugging Query PerformanceVinod Kumar
 
Understanding System Performance
Understanding System PerformanceUnderstanding System Performance
Understanding System PerformanceTeradata
 
Exciting Features for SQL Devs in SQL 2012
Exciting Features for SQL Devs in SQL 2012Exciting Features for SQL Devs in SQL 2012
Exciting Features for SQL Devs in SQL 2012Brij Mishra
 
SQL Database Performance Tuning for Developers
SQL Database Performance Tuning for DevelopersSQL Database Performance Tuning for Developers
SQL Database Performance Tuning for DevelopersBRIJESH KUMAR
 
Query Optimization in SQL Server
Query Optimization in SQL ServerQuery Optimization in SQL Server
Query Optimization in SQL ServerRajesh Gunasundaram
 
Tuning ETL's for Better BI
Tuning ETL's for Better BITuning ETL's for Better BI
Tuning ETL's for Better BIDatavail
 
(ATS6-PLAT06) Maximizing AEP Performance
(ATS6-PLAT06) Maximizing AEP Performance(ATS6-PLAT06) Maximizing AEP Performance
(ATS6-PLAT06) Maximizing AEP PerformanceBIOVIA
 
(ATS6-PLAT03) What's behind Discngine collections
(ATS6-PLAT03) What's behind Discngine collections(ATS6-PLAT03) What's behind Discngine collections
(ATS6-PLAT03) What's behind Discngine collectionsBIOVIA
 
Apache Apex Meetup at Cask
Apache Apex Meetup at CaskApache Apex Meetup at Cask
Apache Apex Meetup at CaskApache Apex
 
Ten query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should knowTen query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should knowKevin Kline
 
Apache Apex Introduction with PubMatic
Apache Apex Introduction with PubMaticApache Apex Introduction with PubMatic
Apache Apex Introduction with PubMaticApache Apex
 
Designing High Performance ETL for Data Warehouse
Designing High Performance ETL for Data WarehouseDesigning High Performance ETL for Data Warehouse
Designing High Performance ETL for Data WarehouseMarcel Franke
 
Database performance tuning and query optimization
Database performance tuning and query optimizationDatabase performance tuning and query optimization
Database performance tuning and query optimizationDhani Ahmad
 
Sql Server Performance Tuning
Sql Server Performance TuningSql Server Performance Tuning
Sql Server Performance TuningBala Subra
 
Fault Tolerance and Processing Semantics in Apache Apex
Fault Tolerance and Processing Semantics in Apache ApexFault Tolerance and Processing Semantics in Apache Apex
Fault Tolerance and Processing Semantics in Apache ApexApache Apex Organizer
 
February 2017 HUG: Slow, Stuck, or Runaway Apps? Learn How to Quickly Fix Pro...
February 2017 HUG: Slow, Stuck, or Runaway Apps? Learn How to Quickly Fix Pro...February 2017 HUG: Slow, Stuck, or Runaway Apps? Learn How to Quickly Fix Pro...
February 2017 HUG: Slow, Stuck, or Runaway Apps? Learn How to Quickly Fix Pro...Yahoo Developer Network
 
Database Performance Tuning
Database Performance Tuning Database Performance Tuning
Database Performance Tuning Arno Huetter
 
February 2017 HUG: Exactly-once end-to-end processing with Apache Apex
February 2017 HUG: Exactly-once end-to-end processing with Apache ApexFebruary 2017 HUG: Exactly-once end-to-end processing with Apache Apex
February 2017 HUG: Exactly-once end-to-end processing with Apache ApexYahoo Developer Network
 

What's hot (20)

Microsoft sql server architecture
Microsoft sql server architectureMicrosoft sql server architecture
Microsoft sql server architecture
 
SQL Server Query Optimization, Execution and Debugging Query Performance
SQL Server Query Optimization, Execution and Debugging Query PerformanceSQL Server Query Optimization, Execution and Debugging Query Performance
SQL Server Query Optimization, Execution and Debugging Query Performance
 
Understanding System Performance
Understanding System PerformanceUnderstanding System Performance
Understanding System Performance
 
Exciting Features for SQL Devs in SQL 2012
Exciting Features for SQL Devs in SQL 2012Exciting Features for SQL Devs in SQL 2012
Exciting Features for SQL Devs in SQL 2012
 
SQL Database Performance Tuning for Developers
SQL Database Performance Tuning for DevelopersSQL Database Performance Tuning for Developers
SQL Database Performance Tuning for Developers
 
Query Optimization in SQL Server
Query Optimization in SQL ServerQuery Optimization in SQL Server
Query Optimization in SQL Server
 
Tuning ETL's for Better BI
Tuning ETL's for Better BITuning ETL's for Better BI
Tuning ETL's for Better BI
 
(ATS6-PLAT06) Maximizing AEP Performance
(ATS6-PLAT06) Maximizing AEP Performance(ATS6-PLAT06) Maximizing AEP Performance
(ATS6-PLAT06) Maximizing AEP Performance
 
(ATS6-PLAT03) What's behind Discngine collections
(ATS6-PLAT03) What's behind Discngine collections(ATS6-PLAT03) What's behind Discngine collections
(ATS6-PLAT03) What's behind Discngine collections
 
Apache Apex Meetup at Cask
Apache Apex Meetup at CaskApache Apex Meetup at Cask
Apache Apex Meetup at Cask
 
Ten query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should knowTen query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should know
 
Performance tuning in sql server
Performance tuning in sql serverPerformance tuning in sql server
Performance tuning in sql server
 
Apache Apex Introduction with PubMatic
Apache Apex Introduction with PubMaticApache Apex Introduction with PubMatic
Apache Apex Introduction with PubMatic
 
Designing High Performance ETL for Data Warehouse
Designing High Performance ETL for Data WarehouseDesigning High Performance ETL for Data Warehouse
Designing High Performance ETL for Data Warehouse
 
Database performance tuning and query optimization
Database performance tuning and query optimizationDatabase performance tuning and query optimization
Database performance tuning and query optimization
 
Sql Server Performance Tuning
Sql Server Performance TuningSql Server Performance Tuning
Sql Server Performance Tuning
 
Fault Tolerance and Processing Semantics in Apache Apex
Fault Tolerance and Processing Semantics in Apache ApexFault Tolerance and Processing Semantics in Apache Apex
Fault Tolerance and Processing Semantics in Apache Apex
 
February 2017 HUG: Slow, Stuck, or Runaway Apps? Learn How to Quickly Fix Pro...
February 2017 HUG: Slow, Stuck, or Runaway Apps? Learn How to Quickly Fix Pro...February 2017 HUG: Slow, Stuck, or Runaway Apps? Learn How to Quickly Fix Pro...
February 2017 HUG: Slow, Stuck, or Runaway Apps? Learn How to Quickly Fix Pro...
 
Database Performance Tuning
Database Performance Tuning Database Performance Tuning
Database Performance Tuning
 
February 2017 HUG: Exactly-once end-to-end processing with Apache Apex
February 2017 HUG: Exactly-once end-to-end processing with Apache ApexFebruary 2017 HUG: Exactly-once end-to-end processing with Apache Apex
February 2017 HUG: Exactly-once end-to-end processing with Apache Apex
 

Viewers also liked (20)

Cross media - YouTube
Cross media - YouTubeCross media - YouTube
Cross media - YouTube
 
Senior sem Essay Task 1
Senior sem  Essay Task 1Senior sem  Essay Task 1
Senior sem Essay Task 1
 
Carta
CartaCarta
Carta
 
Mapa mental aqui se come bien
Mapa mental aqui se come bienMapa mental aqui se come bien
Mapa mental aqui se come bien
 
Up to 8
Up to 8Up to 8
Up to 8
 
Web 2.0 leidy collazos
Web 2.0 leidy collazosWeb 2.0 leidy collazos
Web 2.0 leidy collazos
 
114
114114
114
 
Planeta web 2
Planeta web 2Planeta web 2
Planeta web 2
 
Natureza maria ines-maio
Natureza maria ines-maioNatureza maria ines-maio
Natureza maria ines-maio
 
Alvarezbeltran ERE
Alvarezbeltran EREAlvarezbeltran ERE
Alvarezbeltran ERE
 
Etiqueta natal
Etiqueta natalEtiqueta natal
Etiqueta natal
 
Prese1
Prese1Prese1
Prese1
 
Mi power
Mi powerMi power
Mi power
 
Caminaculida
CaminaculidaCaminaculida
Caminaculida
 
Sopa de numeros
Sopa de numerosSopa de numeros
Sopa de numeros
 
Insilvis STORM, magazine rack
Insilvis STORM, magazine rackInsilvis STORM, magazine rack
Insilvis STORM, magazine rack
 
Clipping cnc 18112015 versão de impressão
Clipping cnc 18112015   versão de impressãoClipping cnc 18112015   versão de impressão
Clipping cnc 18112015 versão de impressão
 
L&vS
L&vSL&vS
L&vS
 
Restobar hebrew lunch menu dec11
Restobar hebrew lunch menu dec11Restobar hebrew lunch menu dec11
Restobar hebrew lunch menu dec11
 
Leaflet
LeafletLeaflet
Leaflet
 

Similar to SQL Saturday - Twelve Trace Flags In Twelve Minutes

Configuring sql server - SQL Saturday, Athens Oct 2014
Configuring sql server - SQL Saturday, Athens Oct 2014Configuring sql server - SQL Saturday, Athens Oct 2014
Configuring sql server - SQL Saturday, Athens Oct 2014Antonios Chatzipavlis
 
Sql server 2016 it just runs faster sql bits 2017 edition
Sql server 2016 it just runs faster   sql bits 2017 editionSql server 2016 it just runs faster   sql bits 2017 edition
Sql server 2016 it just runs faster sql bits 2017 editionBob Ward
 
SQL Server knowledge-session (SQL Server vs Oracle, and performance)
SQL Server knowledge-session (SQL Server vs Oracle, and performance)SQL Server knowledge-session (SQL Server vs Oracle, and performance)
SQL Server knowledge-session (SQL Server vs Oracle, and performance)Pierre van der Ven
 
SQL Server It Just Runs Faster
SQL Server It Just Runs FasterSQL Server It Just Runs Faster
SQL Server It Just Runs FasterBob Ward
 
SQL Server 2016 novelties
SQL Server 2016 noveltiesSQL Server 2016 novelties
SQL Server 2016 noveltiesMSDEVMTL
 
KoprowskiT_SQLRelay2014#2_Southampton_MaintenancePlansForBeginners
KoprowskiT_SQLRelay2014#2_Southampton_MaintenancePlansForBeginnersKoprowskiT_SQLRelay2014#2_Southampton_MaintenancePlansForBeginners
KoprowskiT_SQLRelay2014#2_Southampton_MaintenancePlansForBeginnersTobias Koprowski
 
SQL Server 2019 CTP 2.5
SQL Server 2019 CTP 2.5SQL Server 2019 CTP 2.5
SQL Server 2019 CTP 2.5Gianluca Hotz
 
In-memory ColumnStore Index
In-memory ColumnStore IndexIn-memory ColumnStore Index
In-memory ColumnStore IndexSolidQ
 
Best Practices for Supercharging Cloud Analytics on Amazon Redshift
Best Practices for Supercharging Cloud Analytics on Amazon RedshiftBest Practices for Supercharging Cloud Analytics on Amazon Redshift
Best Practices for Supercharging Cloud Analytics on Amazon RedshiftSnapLogic
 
Modernizing your database with SQL Server 2019
Modernizing your database with SQL Server 2019Modernizing your database with SQL Server 2019
Modernizing your database with SQL Server 2019Antonios Chatzipavlis
 
OOW16 - Getting Optimal Performance from Oracle E-Business Suite [CON6711]
OOW16 - Getting Optimal Performance from Oracle E-Business Suite [CON6711]OOW16 - Getting Optimal Performance from Oracle E-Business Suite [CON6711]
OOW16 - Getting Optimal Performance from Oracle E-Business Suite [CON6711]vasuballa
 
Data Aware Enterprise v2
Data Aware Enterprise v2Data Aware Enterprise v2
Data Aware Enterprise v2ukdpe
 
Novidades do SQL Server 2016
Novidades do SQL Server 2016Novidades do SQL Server 2016
Novidades do SQL Server 2016Marcos Freccia
 
Live Query Statistics & Query Store in SQL Server 2016
Live Query Statistics & Query Store in SQL Server 2016Live Query Statistics & Query Store in SQL Server 2016
Live Query Statistics & Query Store in SQL Server 2016Antonios Chatzipavlis
 

Similar to SQL Saturday - Twelve Trace Flags In Twelve Minutes (20)

Configuring sql server - SQL Saturday, Athens Oct 2014
Configuring sql server - SQL Saturday, Athens Oct 2014Configuring sql server - SQL Saturday, Athens Oct 2014
Configuring sql server - SQL Saturday, Athens Oct 2014
 
Sql server 2016 it just runs faster sql bits 2017 edition
Sql server 2016 it just runs faster   sql bits 2017 editionSql server 2016 it just runs faster   sql bits 2017 edition
Sql server 2016 it just runs faster sql bits 2017 edition
 
SQL Server knowledge-session (SQL Server vs Oracle, and performance)
SQL Server knowledge-session (SQL Server vs Oracle, and performance)SQL Server knowledge-session (SQL Server vs Oracle, and performance)
SQL Server knowledge-session (SQL Server vs Oracle, and performance)
 
SQL Server It Just Runs Faster
SQL Server It Just Runs FasterSQL Server It Just Runs Faster
SQL Server It Just Runs Faster
 
SQL Server 2016 novelties
SQL Server 2016 noveltiesSQL Server 2016 novelties
SQL Server 2016 novelties
 
Tempdb3
Tempdb3Tempdb3
Tempdb3
 
Teradata sql-tuning-top-10
Teradata sql-tuning-top-10Teradata sql-tuning-top-10
Teradata sql-tuning-top-10
 
KoprowskiT_SQLRelay2014#2_Southampton_MaintenancePlansForBeginners
KoprowskiT_SQLRelay2014#2_Southampton_MaintenancePlansForBeginnersKoprowskiT_SQLRelay2014#2_Southampton_MaintenancePlansForBeginners
KoprowskiT_SQLRelay2014#2_Southampton_MaintenancePlansForBeginners
 
SQL Server 2019 CTP 2.5
SQL Server 2019 CTP 2.5SQL Server 2019 CTP 2.5
SQL Server 2019 CTP 2.5
 
In-memory ColumnStore Index
In-memory ColumnStore IndexIn-memory ColumnStore Index
In-memory ColumnStore Index
 
Tempdb, More permanent than you think
Tempdb, More permanent than you thinkTempdb, More permanent than you think
Tempdb, More permanent than you think
 
Best Practices for Supercharging Cloud Analytics on Amazon Redshift
Best Practices for Supercharging Cloud Analytics on Amazon RedshiftBest Practices for Supercharging Cloud Analytics on Amazon Redshift
Best Practices for Supercharging Cloud Analytics on Amazon Redshift
 
Modernizing your database with SQL Server 2019
Modernizing your database with SQL Server 2019Modernizing your database with SQL Server 2019
Modernizing your database with SQL Server 2019
 
OOW16 - Getting Optimal Performance from Oracle E-Business Suite [CON6711]
OOW16 - Getting Optimal Performance from Oracle E-Business Suite [CON6711]OOW16 - Getting Optimal Performance from Oracle E-Business Suite [CON6711]
OOW16 - Getting Optimal Performance from Oracle E-Business Suite [CON6711]
 
Data Aware Enterprise v2
Data Aware Enterprise v2Data Aware Enterprise v2
Data Aware Enterprise v2
 
Novidades do SQL Server 2016
Novidades do SQL Server 2016Novidades do SQL Server 2016
Novidades do SQL Server 2016
 
Chapter 12 Trigger
Chapter 12 TriggerChapter 12 Trigger
Chapter 12 Trigger
 
Sql Server
Sql ServerSql Server
Sql Server
 
Optimize TempDB
Optimize TempDB Optimize TempDB
Optimize TempDB
 
Live Query Statistics & Query Store in SQL Server 2016
Live Query Statistics & Query Store in SQL Server 2016Live Query Statistics & Query Store in SQL Server 2016
Live Query Statistics & Query Store in SQL Server 2016
 

Recently uploaded

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
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
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
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
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM 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
 
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
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
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
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 

Recently uploaded (20)

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
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
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
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
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
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...
 
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?
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
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
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 

SQL Saturday - Twelve Trace Flags In Twelve Minutes

  • 1. 12 Trace Flags In 12-ish Minutes Matt Slocum
  • 2. Matt Slocum – Who am I?  DBA manager with a passion for SQL Server  Experience with SQL Server v6.5-2014  Specialize in replication and performance tuning  MCITP: DBA SQL 2005 & 2008  MCSE: SQL 2012 Data Platform  Leader of Rochester PASS SSUG  Established SQL Saturday Rochester  5th annual event was in May 2016 11/17/201612 Trace Flags in 12-ish Minutes2 |
  • 3. How To Use Trace Flags  Ad-hoc Enable  DBCC TRACEON (####, -1)  #### = Trace Flag  -1 (optional) = Server vs. Query level  Ad-hoc Disable  DBCC TRACEOFF (####, -1)  Status  DBCC TRACESTATUS  Startup Parameter - SQL Server Configuration Manager  -T####  Query option  OPTION (QUERYTRACEON ####) 3 | 11/17/201612 Trace Flags in 12-ish Minutes
  • 4. High IO Databases (TempDB & User)  TF 1117 (Server level)  Grow all data files on a database when one data file needs to grow  Keeps data files consistently sized  Use: On all instances that have DBs with > 1 data file  TF 1118 (Server level)  Reserve an entire Extent in the data cache when one new page is allocated  Reduces overhead of allocating additional pages  Use: On every instance everywhere 4 | 11/17/201612 Trace Flags in 12-ish Minutes
  • 5. SQL 2014/2016 Cardinality Estimator  TF 9481 (Server or Session/Query level)  Use emulated SQL 2012 Cardinality Estimator  Use: SQL 2014 plans are not as optimal as 2012  TF 2312 (Session/Query level)  Forces SQL 2014 Native Cardinality Estimator  Only need to use when 9481 is set at the server level  Use: When 9481 is set on the server and you have queries that perform better with the SQL 2014 CE 5 | 11/17/201612 Trace Flags in 12-ish Minutes
  • 6. Statistics Auto Updates/Estimations  TF 2371 (Server level)  Reduce percentage of change required before automatically updating statistics on large tables  Use: Everywhere (SQL 2008 R2+)  TF 2389/2390 (Server level)  Affects statistics on ascending columns  Query optimizer will query the highest value from the column so that it can create accurate estimates  Use: When you experience bad estimates when querying columns with ascending values 6 | 11/17/201612 Trace Flags in 12-ish Minutes
  • 7. Tune Query Plan Generation  TF 6498 (Server level)  Enables multiple simultaneous large query compilations in SQL 2014  Use: SQL 2014 when you experience this wait: RESOURCE_SEMAPHORE_QUERY_COMPILE  TF 4136 (Server or Session/Query level)  Disables parameter sniffing  Causes reduced performance on skewed datasets  Use: Query level preferred when parameter sniffing causes poor performance. 7 | 11/17/201612 Trace Flags in 12-ish Minutes
  • 8. Optimize CPU utilization  TF 8008 (Server level)  Cause the scheduler to evaluate which NUMA/soft- NUMA node to execute a query on  Prevents one CPU/NUMA node from running hot while the others are much less utilized  Use: If you see CPU contention on one NUMA node  TF 8048 (Server level)  Optimizes how the scheduler assigns work to NUMA nodes with > 8 logical CPUs.  SQL 2008 - 2014 SP1 (soft-NUMA in 2014 SP2)  Use: Run queries in MS article to determine if needed 8 | 11/17/201612 Trace Flags in 12-ish Minutes
  • 9. Suppress Successful Backup Logs  TF 3226  Successful backups are not logged to the ERRORLOG  Keeps your ERRORLOG cleaner  Use: All instances of SQL Server 9 | 11/17/201612 Trace Flags in 12-ish Minutes
  • 10. Conclusion  Test, test, TEST  Official MS recommendations  https://support.microsoft.com/en-us/kb/2964518  Do your homework and see what works  If you don’t need it, don’t use it  SQL 2016 enables a lot automatically:  https://www.brentozar.com/archive/2016/03/sq l-server-2016-death-trace-flag/ 10 | 11/17/201612 Trace Flags in 12-ish Minutes
  • 11. Thank you!  Blog: www.sqlmatt.com  Twitter: @SlocumMatt  Rochester PASS Website: http://rochesterpass.sqlpass.org/ 11 | 11/17/201612 Trace Flags in 12-ish Minutes

Editor's Notes

  1. http://www.sqlskills.com/blogs/paul/misconceptions-around-tf-1118/ https://www.brentozar.com/archive/2014/06/trace-flags-1117-1118-tempdb-configuration/ https://blogs.msdn.microsoft.com/psssql/2016/03/15/sql-2016-it-just-runs-faster-t1117-and-t1118-changes-for-tempdb-and-user-databases/
  2. https://blogs.msdn.microsoft.com/saponsqlserver/2011/09/07/changes-to-automatic-update-statistics-in-sql-server-traceflag-2371/ http://www.benjaminnevarez.com/2013/02/statistics-on-ascending-keys/
  3. 6498 - https://support.microsoft.com/en-us/kb/3024815 4136 - https://www.mssqltips.com/sqlservertip/3320/enabling-sql-server-trace-flag-for-a-poor-performing-query-using-querytraceon/ https://support.microsoft.com/en-us/kb/2801413
  4. 8008 - https://blogs.msdn.microsoft.com/psssql/2013/08/13/how-it-works-sql-server-2012-database-engine-task-scheduling/ 8048 - https://blogs.msdn.microsoft.com/psssql/2015/03/02/running-sql-server-on-machines-with-more-than-8-cpus-per-numa-node-may-need-trace-flag-8048/