SlideShare a Scribd company logo
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 architecture
Naveen 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 Performance
Vinod Kumar
 
Understanding System Performance
Understanding System PerformanceUnderstanding System Performance
Understanding System Performance
Teradata
 
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
Brij Mishra
 
SQL Database Performance Tuning for Developers
SQL Database Performance Tuning for DevelopersSQL Database Performance Tuning for Developers
SQL Database Performance Tuning for Developers
BRIJESH KUMAR
 
Query Optimization in SQL Server
Query Optimization in SQL ServerQuery Optimization in SQL Server
Query Optimization in SQL Server
Rajesh Gunasundaram
 
Tuning ETL's for Better BI
Tuning ETL's for Better BITuning ETL's for Better BI
Tuning ETL's for Better BI
Datavail
 
(ATS6-PLAT06) Maximizing AEP Performance
(ATS6-PLAT06) Maximizing AEP Performance(ATS6-PLAT06) Maximizing AEP Performance
(ATS6-PLAT06) Maximizing AEP Performance
BIOVIA
 
(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
BIOVIA
 
Apache Apex Meetup at Cask
Apache Apex Meetup at CaskApache Apex Meetup at Cask
Apache Apex Meetup at Cask
Apache 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 know
Kevin Kline
 
Performance tuning in sql server
Performance tuning in sql serverPerformance tuning in sql server
Performance tuning in sql server
Antonios Chatzipavlis
 
Apache Apex Introduction with PubMatic
Apache Apex Introduction with PubMaticApache Apex Introduction with PubMatic
Apache Apex Introduction with PubMatic
Apache 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 Warehouse
Marcel Franke
 
Database performance tuning and query optimization
Database performance tuning and query optimizationDatabase performance tuning and query optimization
Database performance tuning and query optimization
Dhani Ahmad
 
Sql Server Performance Tuning
Sql Server Performance TuningSql Server Performance Tuning
Sql Server Performance Tuning
Bala 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 Apex
Apache 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 Apex
Yahoo 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

Cross media - YouTube
Cross media - YouTubeCross media - YouTube
Cross media - YouTube
António Teixeira
 
Senior sem Essay Task 1
Senior sem  Essay Task 1Senior sem  Essay Task 1
Senior sem Essay Task 1stpornmint
 
Mapa mental aqui se come bien
Mapa mental aqui se come bienMapa mental aqui se come bien
Mapa mental aqui se come bien
Guadalinfo Bailén
 
Up to 8
Up to 8Up to 8
Up to 8
emiliomerayo
 
Web 2.0 leidy collazos
Web 2.0 leidy collazosWeb 2.0 leidy collazos
Web 2.0 leidy collazos
leidycollazos
 
Planeta web 2
Planeta web 2Planeta web 2
Planeta web 2
Gema Cortez
 
Natureza maria ines-maio
Natureza maria ines-maioNatureza maria ines-maio
Natureza maria ines-maio
L Fernando F Pinto
 
Alvarezbeltran ERE
Alvarezbeltran EREAlvarezbeltran ERE
Alvarezbeltran ERE
Jose Carlos Perandones
 
Etiqueta natal
Etiqueta natalEtiqueta natal
Etiqueta natal
camilinha_alb
 
Mi power
Mi powerMi power
Mi power
jyekla
 
Caminaculida
CaminaculidaCaminaculida
Caminaculida
unesp
 
Sopa de numeros
Sopa de numerosSopa de numeros
Sopa de numeros
mile_3027
 
Insilvis STORM, magazine rack
Insilvis STORM, magazine rackInsilvis STORM, magazine rack
Insilvis STORM, magazine rack
insilvis
 
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
Paulo André Colucci Kawasaki
 
L&vS
L&vSL&vS
L&vS
dannymeurkens
 
Restobar hebrew lunch menu dec11
Restobar hebrew lunch menu dec11Restobar hebrew lunch menu dec11
Restobar hebrew lunch menu dec11weiss2001
 
Leaflet
LeafletLeaflet
Leaflet
skkutubuddin
 

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 2014
Antonios 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 edition
Bob 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 Faster
Bob Ward
 
SQL Server 2016 novelties
SQL Server 2016 noveltiesSQL Server 2016 novelties
SQL Server 2016 novelties
MSDEVMTL
 
Tempdb3
Tempdb3Tempdb3
Teradata sql-tuning-top-10
Teradata sql-tuning-top-10Teradata sql-tuning-top-10
Teradata sql-tuning-top-10
Roland Wenzlofsky
 
KoprowskiT_SQLRelay2014#2_Southampton_MaintenancePlansForBeginners
KoprowskiT_SQLRelay2014#2_Southampton_MaintenancePlansForBeginnersKoprowskiT_SQLRelay2014#2_Southampton_MaintenancePlansForBeginners
KoprowskiT_SQLRelay2014#2_Southampton_MaintenancePlansForBeginners
Tobias Koprowski
 
SQL Server 2019 CTP 2.5
SQL Server 2019 CTP 2.5SQL Server 2019 CTP 2.5
SQL Server 2019 CTP 2.5
Gianluca Hotz
 
In-memory ColumnStore Index
In-memory ColumnStore IndexIn-memory ColumnStore Index
In-memory ColumnStore Index
SolidQ
 
Tempdb, More permanent than you think
Tempdb, More permanent than you thinkTempdb, More permanent than you think
Tempdb, More permanent than you think
Paresh Motiwala, PMP®
 
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
SnapLogic
 
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
Antonios 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 v2
ukdpe
 
Novidades do SQL Server 2016
Novidades do SQL Server 2016Novidades do SQL Server 2016
Novidades do SQL Server 2016
Marcos Freccia
 
Chapter 12 Trigger
Chapter 12 TriggerChapter 12 Trigger
Chapter 12 Trigger
AlokSrivastava141
 
Sql Server
Sql ServerSql Server
Sql Server
SandyShin
 
Optimize TempDB
Optimize TempDB Optimize TempDB
Optimize TempDB
Ravish Ranjan
 
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
Antonios 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

Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
Public CyberSecurity Awareness Presentation 2024.pptx
Public CyberSecurity Awareness Presentation 2024.pptxPublic CyberSecurity Awareness Presentation 2024.pptx
Public CyberSecurity Awareness Presentation 2024.pptx
marufrahmanstratejm
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
Data Hops
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Tatiana Kojar
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
Dinusha Kumarasiri
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
Edge AI and Vision Alliance
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
ScyllaDB
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Precisely
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 

Recently uploaded (20)

Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
Public CyberSecurity Awareness Presentation 2024.pptx
Public CyberSecurity Awareness Presentation 2024.pptxPublic CyberSecurity Awareness Presentation 2024.pptx
Public CyberSecurity Awareness Presentation 2024.pptx
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 

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/