SlideShare a Scribd company logo
Polish SQL Server User Group
Using Tools to
Analyze Query Performance
CHAPTER 14
Polish SQL Server User Group
About the Author
Marek Maśko
• Principal Database Analyst at Sabre
• Working with SQL Server since 2010
• SQL DBA, Dev & Architect
• MCP since 2012
• Contact Information:
Email: marek.masko@gmail.com
LinkedIn: https://pl.linkedin.com/in/marekmasko
Twitter: @MarekMasko
Polish SQL Server User Group
Agenda
• Query Optimizer
• SQL Trace
• SQL Server Profiler
• SQL Server Extended Events
• SET Session Options
• Dynamic Management Objects
• Execution Plans
Polish SQL Server User Group
QUERY OPTIMIZER
Polish SQL Server User Group
Query Performance
• Time
• CPU
• Memory
• I/O
Polish SQL Server User Group
Query Optimization
Relational Engine
T-SQL
Statement Parser Algebrizer
Query
Optimizer
Storage Engine
Query
Parsing
Parse
Tree
Normalization
and Binding
Query
Processor
Tree
Query
Optimization
Execution
Plan
Polish SQL Server User Group
Query Optimizer
• Cost based
• Cardinality Estimation
Polish SQL Server User Group
SQL TRACE &
SQL SERVER PROFILER
Polish SQL Server User Group
SQL Trace & Profiler
https://msdn.microsoft.com/en-us/library/hh245121.aspx
Polish SQL Server User Group
Benefits and drawbacks
• Easy to use
• Produces overhead:
–Local resources
–Network
• Results grid can consume a lot of memory
• Deprecated!
Polish SQL Server User Group
SQL SERVER EXTENDED EVENTS
Polish SQL Server User Group
Extended Events Engine
https://technet.microsoft.com/en-us/library/dd822788(v=sql.100).aspx
Polish SQL Server User Group
Extended Events Engine
https://technet.microsoft.com/en-us/library/dd822788(v=sql.100).aspx
Polish SQL Server User Group
SET SESSION OPTIONS
Polish SQL Server User Group
SET Session Options
• SET STATISTICS IO
• SET STATISTICS TIME
Polish SQL Server User Group
DYNAMIC MANAGEMENT OBJECTS
Polish SQL Server User Group
DMO
• System views and functions
• More than 130
• Exist in sys system schema
• Names start with dm_
• Shows current state or
data cumulated from instance start
Polish SQL Server User Group
DMO
• SQLOS related
• Execution related
• Index related
Polish SQL Server User Group
Most Important DMOs
• dm_exec_requests
• dm_exec_sessions
• dm_exec_sql_text()
• dm_exec_query_stats
• dm_os_wait_stats
• dm_os_waiting_tasks
• dm_db_missing_index_details
• dm_db_missing_index_columns
• dm_db_missing_index_groups
• dm_db_missing_index_group_stats
Polish SQL Server User Group
EXECUTION PLANS
Polish SQL Server User Group
Estimated and Actual Execution Plans
Estimated execution plan
• Output from the Optimizer
• Query doesn’t have to be executed
• Tells you what SQL Server would most likely do
• Stored in the plan cache
Actual execution plan
• Output from the actual query execution
• Tells you exactly what SQL Server did
Polish SQL Server User Group
Execution Plan Formats
• Graphical Plans
• Text Plans
• XML Plans
Polish SQL Server User Group
Graphical Plan
Polish SQL Server User Group
Text Plan
Polish SQL Server User Group
XML Plan
Polish SQL Server User Group
SET Session Options
• Text plans
–SET SHOWPLAN_TEXT and SET SHOWPLAN_ALL for
estimated plans
–SET STATISTICS PROFILE for actual plans
• XML plans
–SET SHOWPLAN_XML for estimated plans
–SET STATISTICS XML for actual plans
Polish SQL Server User Group
THANK YOU!
Polish SQL Server User Group
Resources
• Book: Training Kit Exam 70-461
• Scripts for Training Kit
Ad

More Related Content

What's hot (20)

SharePoint Performance: Best Practices from the Field
SharePoint Performance: Best Practices from the FieldSharePoint Performance: Best Practices from the Field
SharePoint Performance: Best Practices from the Field
Jason Himmelstein
 
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
SPTechCon
 
SharePoint Saturday St. Louis 2014: What SharePoint Admins need to know about...
SharePoint Saturday St. Louis 2014: What SharePoint Admins need to know about...SharePoint Saturday St. Louis 2014: What SharePoint Admins need to know about...
SharePoint Saturday St. Louis 2014: What SharePoint Admins need to know about...
J.D. Wade
 
Infrastructure Best Practices for SharePoint On-Premises presented by Michael...
Infrastructure Best Practices for SharePoint On-Premises presented by Michael...Infrastructure Best Practices for SharePoint On-Premises presented by Michael...
Infrastructure Best Practices for SharePoint On-Premises presented by Michael...
European SharePoint Conference
 
Boost the Performance of SharePoint Today!
Boost the Performance of SharePoint Today!Boost the Performance of SharePoint Today!
Boost the Performance of SharePoint Today!
Brian Culver
 
Scaling SharePoint 2016 Farms with MinRole & Other Tools
Scaling SharePoint 2016 Farms with MinRole & Other ToolsScaling SharePoint 2016 Farms with MinRole & Other Tools
Scaling SharePoint 2016 Farms with MinRole & Other Tools
SPC Adriatics
 
Connected at the hip for MS BI: SharePoint and SQL
Connected at the hip for MS BI: SharePoint and SQLConnected at the hip for MS BI: SharePoint and SQL
Connected at the hip for MS BI: SharePoint and SQL
J.D. Wade
 
What's new in SharePoint 2010 for Backup and Recovery - SP Saturday Copenhagen
What's new in SharePoint 2010 for Backup and Recovery - SP Saturday CopenhagenWhat's new in SharePoint 2010 for Backup and Recovery - SP Saturday Copenhagen
What's new in SharePoint 2010 for Backup and Recovery - SP Saturday Copenhagen
Ilia Sotnikov
 
SPS Kansas City: What SharePoint Admin need to know about SQL
SPS Kansas City: What SharePoint Admin need to know about SQLSPS Kansas City: What SharePoint Admin need to know about SQL
SPS Kansas City: What SharePoint Admin need to know about SQL
J.D. Wade
 
SharePoint 2016 Adoption - Lessons Learned and Advanced Troubleshooting
SharePoint 2016 Adoption - Lessons Learned and Advanced TroubleshootingSharePoint 2016 Adoption - Lessons Learned and Advanced Troubleshooting
SharePoint 2016 Adoption - Lessons Learned and Advanced Troubleshooting
John Calvert
 
Gabriel Gayhart - XML Pointer File Example
Gabriel Gayhart - XML Pointer File ExampleGabriel Gayhart - XML Pointer File Example
Gabriel Gayhart - XML Pointer File Example
linkedinsys
 
What SQL DBA's need to know about SharePoint
What SQL DBA's need to know about SharePointWhat SQL DBA's need to know about SharePoint
What SQL DBA's need to know about SharePoint
J.D. Wade
 
SharePoint 2013 Performance Enhancements
SharePoint 2013 Performance EnhancementsSharePoint 2013 Performance Enhancements
SharePoint 2013 Performance Enhancements
Eric Shupps
 
Maximizing sql 2012 performance for share point 2013 final
Maximizing sql 2012 performance for share point 2013 finalMaximizing sql 2012 performance for share point 2013 final
Maximizing sql 2012 performance for share point 2013 final
Vinh Nguyen
 
Practical SharePoint 2013 Development Environment
Practical SharePoint 2013  Development EnvironmentPractical SharePoint 2013  Development Environment
Practical SharePoint 2013 Development Environment
Netwoven Inc.
 
Asp Net Advance Topics
Asp Net Advance TopicsAsp Net Advance Topics
Asp Net Advance Topics
Ali Taki
 
SharePoint On-Premises Nirvana
SharePoint On-Premises NirvanaSharePoint On-Premises Nirvana
SharePoint On-Premises Nirvana
John Calvert
 
Unbreakable Sharepoint 2016 With SQL Server 2016 availability groups
Unbreakable Sharepoint 2016 With SQL Server 2016 availability groupsUnbreakable Sharepoint 2016 With SQL Server 2016 availability groups
Unbreakable Sharepoint 2016 With SQL Server 2016 availability groups
Isabelle Van Campenhoudt
 
The RDBMS You Should Be Using
The RDBMS You Should Be UsingThe RDBMS You Should Be Using
The RDBMS You Should Be Using
ColdFusionConference
 
ECS19 - Patrick Curran, Eric Shupps - SHAREPOINT 24X7X365: ARCHITECTING FOR H...
ECS19 - Patrick Curran, Eric Shupps - SHAREPOINT 24X7X365: ARCHITECTING FOR H...ECS19 - Patrick Curran, Eric Shupps - SHAREPOINT 24X7X365: ARCHITECTING FOR H...
ECS19 - Patrick Curran, Eric Shupps - SHAREPOINT 24X7X365: ARCHITECTING FOR H...
European Collaboration Summit
 
SharePoint Performance: Best Practices from the Field
SharePoint Performance: Best Practices from the FieldSharePoint Performance: Best Practices from the Field
SharePoint Performance: Best Practices from the Field
Jason Himmelstein
 
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
SPTechCon
 
SharePoint Saturday St. Louis 2014: What SharePoint Admins need to know about...
SharePoint Saturday St. Louis 2014: What SharePoint Admins need to know about...SharePoint Saturday St. Louis 2014: What SharePoint Admins need to know about...
SharePoint Saturday St. Louis 2014: What SharePoint Admins need to know about...
J.D. Wade
 
Infrastructure Best Practices for SharePoint On-Premises presented by Michael...
Infrastructure Best Practices for SharePoint On-Premises presented by Michael...Infrastructure Best Practices for SharePoint On-Premises presented by Michael...
Infrastructure Best Practices for SharePoint On-Premises presented by Michael...
European SharePoint Conference
 
Boost the Performance of SharePoint Today!
Boost the Performance of SharePoint Today!Boost the Performance of SharePoint Today!
Boost the Performance of SharePoint Today!
Brian Culver
 
Scaling SharePoint 2016 Farms with MinRole & Other Tools
Scaling SharePoint 2016 Farms with MinRole & Other ToolsScaling SharePoint 2016 Farms with MinRole & Other Tools
Scaling SharePoint 2016 Farms with MinRole & Other Tools
SPC Adriatics
 
Connected at the hip for MS BI: SharePoint and SQL
Connected at the hip for MS BI: SharePoint and SQLConnected at the hip for MS BI: SharePoint and SQL
Connected at the hip for MS BI: SharePoint and SQL
J.D. Wade
 
What's new in SharePoint 2010 for Backup and Recovery - SP Saturday Copenhagen
What's new in SharePoint 2010 for Backup and Recovery - SP Saturday CopenhagenWhat's new in SharePoint 2010 for Backup and Recovery - SP Saturday Copenhagen
What's new in SharePoint 2010 for Backup and Recovery - SP Saturday Copenhagen
Ilia Sotnikov
 
SPS Kansas City: What SharePoint Admin need to know about SQL
SPS Kansas City: What SharePoint Admin need to know about SQLSPS Kansas City: What SharePoint Admin need to know about SQL
SPS Kansas City: What SharePoint Admin need to know about SQL
J.D. Wade
 
SharePoint 2016 Adoption - Lessons Learned and Advanced Troubleshooting
SharePoint 2016 Adoption - Lessons Learned and Advanced TroubleshootingSharePoint 2016 Adoption - Lessons Learned and Advanced Troubleshooting
SharePoint 2016 Adoption - Lessons Learned and Advanced Troubleshooting
John Calvert
 
Gabriel Gayhart - XML Pointer File Example
Gabriel Gayhart - XML Pointer File ExampleGabriel Gayhart - XML Pointer File Example
Gabriel Gayhart - XML Pointer File Example
linkedinsys
 
What SQL DBA's need to know about SharePoint
What SQL DBA's need to know about SharePointWhat SQL DBA's need to know about SharePoint
What SQL DBA's need to know about SharePoint
J.D. Wade
 
SharePoint 2013 Performance Enhancements
SharePoint 2013 Performance EnhancementsSharePoint 2013 Performance Enhancements
SharePoint 2013 Performance Enhancements
Eric Shupps
 
Maximizing sql 2012 performance for share point 2013 final
Maximizing sql 2012 performance for share point 2013 finalMaximizing sql 2012 performance for share point 2013 final
Maximizing sql 2012 performance for share point 2013 final
Vinh Nguyen
 
Practical SharePoint 2013 Development Environment
Practical SharePoint 2013  Development EnvironmentPractical SharePoint 2013  Development Environment
Practical SharePoint 2013 Development Environment
Netwoven Inc.
 
Asp Net Advance Topics
Asp Net Advance TopicsAsp Net Advance Topics
Asp Net Advance Topics
Ali Taki
 
SharePoint On-Premises Nirvana
SharePoint On-Premises NirvanaSharePoint On-Premises Nirvana
SharePoint On-Premises Nirvana
John Calvert
 
Unbreakable Sharepoint 2016 With SQL Server 2016 availability groups
Unbreakable Sharepoint 2016 With SQL Server 2016 availability groupsUnbreakable Sharepoint 2016 With SQL Server 2016 availability groups
Unbreakable Sharepoint 2016 With SQL Server 2016 availability groups
Isabelle Van Campenhoudt
 
ECS19 - Patrick Curran, Eric Shupps - SHAREPOINT 24X7X365: ARCHITECTING FOR H...
ECS19 - Patrick Curran, Eric Shupps - SHAREPOINT 24X7X365: ARCHITECTING FOR H...ECS19 - Patrick Curran, Eric Shupps - SHAREPOINT 24X7X365: ARCHITECTING FOR H...
ECS19 - Patrick Curran, Eric Shupps - SHAREPOINT 24X7X365: ARCHITECTING FOR H...
European Collaboration Summit
 

Viewers also liked (20)

SQL Server - Querying and Managing XML Data
SQL Server - Querying and Managing XML DataSQL Server - Querying and Managing XML Data
SQL Server - Querying and Managing XML Data
Marek Maśko
 
Performance Monitoring And Tuning In Sql Server 2008 Tsql
Performance Monitoring And Tuning In Sql Server 2008 TsqlPerformance Monitoring And Tuning In Sql Server 2008 Tsql
Performance Monitoring And Tuning In Sql Server 2008 Tsql
coolajju143
 
Паралельний імпорт: економіко-правові аспекти регулювання
Паралельний імпорт: економіко-правові аспекти регулюванняПаралельний імпорт: економіко-правові аспекти регулювання
Паралельний імпорт: економіко-правові аспекти регулювання
nadeh
 
Using grouping sets in sql server 2008 tech republic
Using grouping sets in sql server 2008   tech republicUsing grouping sets in sql server 2008   tech republic
Using grouping sets in sql server 2008 tech republic
Kaing Menglieng
 
MS SQL SERVER: Creating Views
MS SQL SERVER: Creating ViewsMS SQL SERVER: Creating Views
MS SQL SERVER: Creating Views
sqlserver content
 
Joins SQL Server
Joins SQL ServerJoins SQL Server
Joins SQL Server
baabtra.com - No. 1 supplier of quality freshers
 
Consultas en MS SQL Server 2012
Consultas en MS SQL Server 2012Consultas en MS SQL Server 2012
Consultas en MS SQL Server 2012
CarlosFloresRoman
 
Sql db optimization
Sql db optimizationSql db optimization
Sql db optimization
Nikhildas P C
 
Sql xp 04
Sql xp 04Sql xp 04
Sql xp 04
Niit Care
 
Sql tuning guideline
Sql tuning guidelineSql tuning guideline
Sql tuning guideline
Sidney Chen
 
Statistics
StatisticsStatistics
Statistics
Riteshkiit
 
Sub-queries,Groupby and having in SQL
Sub-queries,Groupby and having in SQLSub-queries,Groupby and having in SQL
Sub-queries,Groupby and having in SQL
Vikash Sharma
 
e computer notes - Subqueries
e computer notes - Subqueriese computer notes - Subqueries
e computer notes - Subqueries
ecomputernotes
 
Locking in SQL Server
Locking in SQL ServerLocking in SQL Server
Locking in SQL Server
Prashant Gogoi
 
Review of SQL
Review of SQLReview of SQL
Review of SQL
Information Technology
 
Triggers-Sequences-SQL
Triggers-Sequences-SQLTriggers-Sequences-SQL
Triggers-Sequences-SQL
Patrick Seery
 
"Using Indexes in SQL Server 2008" by Alexander Korotkiy, part 1
"Using Indexes in SQL Server 2008" by Alexander Korotkiy, part 1 "Using Indexes in SQL Server 2008" by Alexander Korotkiy, part 1
"Using Indexes in SQL Server 2008" by Alexander Korotkiy, part 1
Andriy Krayniy
 
SQL Server High Availability
SQL Server High AvailabilitySQL Server High Availability
SQL Server High Availability
Database Architechs
 
Lecture 4. MS SQL. DML Triggers
Lecture 4. MS SQL. DML TriggersLecture 4. MS SQL. DML Triggers
Lecture 4. MS SQL. DML Triggers
Alexey Furmanov
 
Locking And Concurrency
Locking And ConcurrencyLocking And Concurrency
Locking And Concurrency
sqlserver.co.il
 
SQL Server - Querying and Managing XML Data
SQL Server - Querying and Managing XML DataSQL Server - Querying and Managing XML Data
SQL Server - Querying and Managing XML Data
Marek Maśko
 
Performance Monitoring And Tuning In Sql Server 2008 Tsql
Performance Monitoring And Tuning In Sql Server 2008 TsqlPerformance Monitoring And Tuning In Sql Server 2008 Tsql
Performance Monitoring And Tuning In Sql Server 2008 Tsql
coolajju143
 
Паралельний імпорт: економіко-правові аспекти регулювання
Паралельний імпорт: економіко-правові аспекти регулюванняПаралельний імпорт: економіко-правові аспекти регулювання
Паралельний імпорт: економіко-правові аспекти регулювання
nadeh
 
Using grouping sets in sql server 2008 tech republic
Using grouping sets in sql server 2008   tech republicUsing grouping sets in sql server 2008   tech republic
Using grouping sets in sql server 2008 tech republic
Kaing Menglieng
 
MS SQL SERVER: Creating Views
MS SQL SERVER: Creating ViewsMS SQL SERVER: Creating Views
MS SQL SERVER: Creating Views
sqlserver content
 
Consultas en MS SQL Server 2012
Consultas en MS SQL Server 2012Consultas en MS SQL Server 2012
Consultas en MS SQL Server 2012
CarlosFloresRoman
 
Sql tuning guideline
Sql tuning guidelineSql tuning guideline
Sql tuning guideline
Sidney Chen
 
Sub-queries,Groupby and having in SQL
Sub-queries,Groupby and having in SQLSub-queries,Groupby and having in SQL
Sub-queries,Groupby and having in SQL
Vikash Sharma
 
e computer notes - Subqueries
e computer notes - Subqueriese computer notes - Subqueries
e computer notes - Subqueries
ecomputernotes
 
Triggers-Sequences-SQL
Triggers-Sequences-SQLTriggers-Sequences-SQL
Triggers-Sequences-SQL
Patrick Seery
 
"Using Indexes in SQL Server 2008" by Alexander Korotkiy, part 1
"Using Indexes in SQL Server 2008" by Alexander Korotkiy, part 1 "Using Indexes in SQL Server 2008" by Alexander Korotkiy, part 1
"Using Indexes in SQL Server 2008" by Alexander Korotkiy, part 1
Andriy Krayniy
 
Lecture 4. MS SQL. DML Triggers
Lecture 4. MS SQL. DML TriggersLecture 4. MS SQL. DML Triggers
Lecture 4. MS SQL. DML Triggers
Alexey Furmanov
 
Ad

Similar to SQL Server - Using Tools to Analyze Query Performance (20)

PLSSUG - Troubleshoot SQL Server performance problems like a Microsoft Engineer
PLSSUG - Troubleshoot SQL Server performance problems like a Microsoft EngineerPLSSUG - Troubleshoot SQL Server performance problems like a Microsoft Engineer
PLSSUG - Troubleshoot SQL Server performance problems like a Microsoft Engineer
Marek Maśko
 
SQLSaturday 664 - Troubleshoot SQL Server performance problems like a Microso...
SQLSaturday 664 - Troubleshoot SQL Server performance problems like a Microso...SQLSaturday 664 - Troubleshoot SQL Server performance problems like a Microso...
SQLSaturday 664 - Troubleshoot SQL Server performance problems like a Microso...
Marek Maśko
 
ECMDay2015 - Kent Agerlund – Configuration Manager 2012 – A Site Review
ECMDay2015 - Kent Agerlund – Configuration Manager 2012 – A Site ReviewECMDay2015 - Kent Agerlund – Configuration Manager 2012 – A Site Review
ECMDay2015 - Kent Agerlund – Configuration Manager 2012 – A Site Review
Kenny Buntinx
 
ow.ppt
ow.pptow.ppt
ow.ppt
ssuser96a63c
 
ow.ppt
ow.pptow.ppt
ow.ppt
NalamalpuBhakthavats
 
kjdiakdnfdifjadsjkjklljlldasgjdjdljgfldjgldjgldjgl.ppt
kjdiakdnfdifjadsjkjklljlldasgjdjdljgfldjgldjgldjgl.pptkjdiakdnfdifjadsjkjklljlldasgjdjdljgfldjgldjgldjgl.ppt
kjdiakdnfdifjadsjkjklljlldasgjdjdljgfldjgldjgldjgl.ppt
Brahamam Veera
 
Ow
OwOw
Ow
AlbertoItzincab1
 
ow-123123123123123123123123123123123123123
ow-123123123123123123123123123123123123123ow-123123123123123123123123123123123123123
ow-123123123123123123123123123123123123123
DngHong855117
 
SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1
sqlserver.co.il
 
Nadzor sql a
Nadzor sql aNadzor sql a
Nadzor sql a
Igor Puhalo
 
Plantilla oracle
Plantilla oraclePlantilla oracle
Plantilla oracle
Uriel Barrales Garrido
 
Sql server 2012 dba online training
Sql server 2012 dba online trainingSql server 2012 dba online training
Sql server 2012 dba online training
sqlmasters
 
Exploring sql server 2016
Exploring sql server 2016Exploring sql server 2016
Exploring sql server 2016
Antonios Chatzipavlis
 
Sql dba 2008 r2 online training
Sql dba 2008 r2 online trainingSql dba 2008 r2 online training
Sql dba 2008 r2 online training
sssql
 
SQL Server 2019 Master Data Service
SQL Server 2019 Master Data ServiceSQL Server 2019 Master Data Service
SQL Server 2019 Master Data Service
Kenichiro Nakamura
 
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAsOracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Zohar Elkayam
 
Access Data from XPages with the Relational Controls
Access Data from XPages with the Relational ControlsAccess Data from XPages with the Relational Controls
Access Data from XPages with the Relational Controls
Teamstudio
 
A to z for sql azure databases
A to z for sql azure databasesA to z for sql azure databases
A to z for sql azure databases
Antonios Chatzipavlis
 
New features of sql server 2016 bi features
New features of sql server 2016 bi featuresNew features of sql server 2016 bi features
New features of sql server 2016 bi features
Chris Testa-O'Neill
 
Database Fundamental Concepts- Series 1 - Performance Analysis
Database Fundamental Concepts- Series 1 - Performance AnalysisDatabase Fundamental Concepts- Series 1 - Performance Analysis
Database Fundamental Concepts- Series 1 - Performance Analysis
DAGEOP LTD
 
PLSSUG - Troubleshoot SQL Server performance problems like a Microsoft Engineer
PLSSUG - Troubleshoot SQL Server performance problems like a Microsoft EngineerPLSSUG - Troubleshoot SQL Server performance problems like a Microsoft Engineer
PLSSUG - Troubleshoot SQL Server performance problems like a Microsoft Engineer
Marek Maśko
 
SQLSaturday 664 - Troubleshoot SQL Server performance problems like a Microso...
SQLSaturday 664 - Troubleshoot SQL Server performance problems like a Microso...SQLSaturday 664 - Troubleshoot SQL Server performance problems like a Microso...
SQLSaturday 664 - Troubleshoot SQL Server performance problems like a Microso...
Marek Maśko
 
ECMDay2015 - Kent Agerlund – Configuration Manager 2012 – A Site Review
ECMDay2015 - Kent Agerlund – Configuration Manager 2012 – A Site ReviewECMDay2015 - Kent Agerlund – Configuration Manager 2012 – A Site Review
ECMDay2015 - Kent Agerlund – Configuration Manager 2012 – A Site Review
Kenny Buntinx
 
kjdiakdnfdifjadsjkjklljlldasgjdjdljgfldjgldjgldjgl.ppt
kjdiakdnfdifjadsjkjklljlldasgjdjdljgfldjgldjgldjgl.pptkjdiakdnfdifjadsjkjklljlldasgjdjdljgfldjgldjgldjgl.ppt
kjdiakdnfdifjadsjkjklljlldasgjdjdljgfldjgldjgldjgl.ppt
Brahamam Veera
 
ow-123123123123123123123123123123123123123
ow-123123123123123123123123123123123123123ow-123123123123123123123123123123123123123
ow-123123123123123123123123123123123123123
DngHong855117
 
SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1
sqlserver.co.il
 
Sql server 2012 dba online training
Sql server 2012 dba online trainingSql server 2012 dba online training
Sql server 2012 dba online training
sqlmasters
 
Sql dba 2008 r2 online training
Sql dba 2008 r2 online trainingSql dba 2008 r2 online training
Sql dba 2008 r2 online training
sssql
 
SQL Server 2019 Master Data Service
SQL Server 2019 Master Data ServiceSQL Server 2019 Master Data Service
SQL Server 2019 Master Data Service
Kenichiro Nakamura
 
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAsOracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Zohar Elkayam
 
Access Data from XPages with the Relational Controls
Access Data from XPages with the Relational ControlsAccess Data from XPages with the Relational Controls
Access Data from XPages with the Relational Controls
Teamstudio
 
New features of sql server 2016 bi features
New features of sql server 2016 bi featuresNew features of sql server 2016 bi features
New features of sql server 2016 bi features
Chris Testa-O'Neill
 
Database Fundamental Concepts- Series 1 - Performance Analysis
Database Fundamental Concepts- Series 1 - Performance AnalysisDatabase Fundamental Concepts- Series 1 - Performance Analysis
Database Fundamental Concepts- Series 1 - Performance Analysis
DAGEOP LTD
 
Ad

Recently uploaded (20)

Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Build 3D Animated Safety Induction - Tech EHS
Build 3D Animated Safety Induction - Tech EHSBuild 3D Animated Safety Induction - Tech EHS
Build 3D Animated Safety Induction - Tech EHS
TECH EHS Solution
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
MINDCTI revenue release Quarter 1 2025 PR
MINDCTI revenue release Quarter 1 2025 PRMINDCTI revenue release Quarter 1 2025 PR
MINDCTI revenue release Quarter 1 2025 PR
MIND CTI
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Build 3D Animated Safety Induction - Tech EHS
Build 3D Animated Safety Induction - Tech EHSBuild 3D Animated Safety Induction - Tech EHS
Build 3D Animated Safety Induction - Tech EHS
TECH EHS Solution
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
MINDCTI revenue release Quarter 1 2025 PR
MINDCTI revenue release Quarter 1 2025 PRMINDCTI revenue release Quarter 1 2025 PR
MINDCTI revenue release Quarter 1 2025 PR
MIND CTI
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 

SQL Server - Using Tools to Analyze Query Performance

  • 1. Polish SQL Server User Group Using Tools to Analyze Query Performance CHAPTER 14
  • 2. Polish SQL Server User Group About the Author Marek Maśko • Principal Database Analyst at Sabre • Working with SQL Server since 2010 • SQL DBA, Dev & Architect • MCP since 2012 • Contact Information: Email: [email protected] LinkedIn: https://pl.linkedin.com/in/marekmasko Twitter: @MarekMasko
  • 3. Polish SQL Server User Group Agenda • Query Optimizer • SQL Trace • SQL Server Profiler • SQL Server Extended Events • SET Session Options • Dynamic Management Objects • Execution Plans
  • 4. Polish SQL Server User Group QUERY OPTIMIZER
  • 5. Polish SQL Server User Group Query Performance • Time • CPU • Memory • I/O
  • 6. Polish SQL Server User Group Query Optimization Relational Engine T-SQL Statement Parser Algebrizer Query Optimizer Storage Engine Query Parsing Parse Tree Normalization and Binding Query Processor Tree Query Optimization Execution Plan
  • 7. Polish SQL Server User Group Query Optimizer • Cost based • Cardinality Estimation
  • 8. Polish SQL Server User Group SQL TRACE & SQL SERVER PROFILER
  • 9. Polish SQL Server User Group SQL Trace & Profiler https://msdn.microsoft.com/en-us/library/hh245121.aspx
  • 10. Polish SQL Server User Group Benefits and drawbacks • Easy to use • Produces overhead: –Local resources –Network • Results grid can consume a lot of memory • Deprecated!
  • 11. Polish SQL Server User Group SQL SERVER EXTENDED EVENTS
  • 12. Polish SQL Server User Group Extended Events Engine https://technet.microsoft.com/en-us/library/dd822788(v=sql.100).aspx
  • 13. Polish SQL Server User Group Extended Events Engine https://technet.microsoft.com/en-us/library/dd822788(v=sql.100).aspx
  • 14. Polish SQL Server User Group SET SESSION OPTIONS
  • 15. Polish SQL Server User Group SET Session Options • SET STATISTICS IO • SET STATISTICS TIME
  • 16. Polish SQL Server User Group DYNAMIC MANAGEMENT OBJECTS
  • 17. Polish SQL Server User Group DMO • System views and functions • More than 130 • Exist in sys system schema • Names start with dm_ • Shows current state or data cumulated from instance start
  • 18. Polish SQL Server User Group DMO • SQLOS related • Execution related • Index related
  • 19. Polish SQL Server User Group Most Important DMOs • dm_exec_requests • dm_exec_sessions • dm_exec_sql_text() • dm_exec_query_stats • dm_os_wait_stats • dm_os_waiting_tasks • dm_db_missing_index_details • dm_db_missing_index_columns • dm_db_missing_index_groups • dm_db_missing_index_group_stats
  • 20. Polish SQL Server User Group EXECUTION PLANS
  • 21. Polish SQL Server User Group Estimated and Actual Execution Plans Estimated execution plan • Output from the Optimizer • Query doesn’t have to be executed • Tells you what SQL Server would most likely do • Stored in the plan cache Actual execution plan • Output from the actual query execution • Tells you exactly what SQL Server did
  • 22. Polish SQL Server User Group Execution Plan Formats • Graphical Plans • Text Plans • XML Plans
  • 23. Polish SQL Server User Group Graphical Plan
  • 24. Polish SQL Server User Group Text Plan
  • 25. Polish SQL Server User Group XML Plan
  • 26. Polish SQL Server User Group SET Session Options • Text plans –SET SHOWPLAN_TEXT and SET SHOWPLAN_ALL for estimated plans –SET STATISTICS PROFILE for actual plans • XML plans –SET SHOWPLAN_XML for estimated plans –SET STATISTICS XML for actual plans
  • 27. Polish SQL Server User Group THANK YOU!
  • 28. Polish SQL Server User Group Resources • Book: Training Kit Exam 70-461 • Scripts for Training Kit