SlideShare a Scribd company logo
Query Performance Tuning
in the Cloud
Start Grant Fritchey
Goals
Explain the importance of query tuning within the
Azure SQL Database environment.
Show how the hybrid tool set can be used to
identify poor performance.
Demonstrate the additional functionality available
within the Database Management Portal interface.
Get in touch
Grant Fritchey
scarydba.com
grant@scarydba.com
@gfritchey
Why Tune Queries?
You have no control over:
» Where your queries run
» How many resources your query uses
» How many CPUs/Disks are dedicated to you
» When the server is just going to go away
Most performance problems are code or
structure related
One query runs many places
Then Why Use SQL Database?
Speed of delivery
Extremely low
management cost
Cheap prices Expandable capacity
What’s Old is New
Transactions as short as possible
Only move the data you need to move
Only move the data when you need to move
it
Tune the queries
Checking on Throttling
Throttling
Master Database
» Sys.event_log
» Sys.database_connection_stats
Tools for Query Tuning
Query Tuning Tools
SQL Server Management Studio
SQL Database Management Portal
Dynamic Management Objects
Connectivity required
SQL Server Management Studio
Object Explorer
Query window
» And not much else
Statistics Time
Execution Plans
Statistics IO
Monitor
Query window Execution Plan
Statistics Time
SQL Database Management Portal
Statistics IO
Portal: Monitor
Connection Activity
» Including throttled connections
Cache dependent
Query Performance
» Aggregation
» Details
Execution plans
» Actual
» Estimated
Roughly same as SSMS query window
» No drag & drop for object names
» No code completion
Portal: Query Window
No properties
» SET STATISTICS IO/TIME ON/OFF
Graphical
Can be saved
Highlighting
Properties
Portal: Execution Plans
Reset on database move
» Not reboot, restart, attach, detach, etc.
Operating system information is gone
DMO Differences
No clickable execution plans
Expected wait types
» RESOURCE_SEMAPHORE
» *IO_LATCH
» SOS_SCHEDULER_YIELD
Special wait types
» SE_REPL_SLOW_SECONDARY_THROTTLE
» SE_REPL_COMMIT_ACK
sys.dm_exec_requests does show waits
sys.dm_db_wait_stats
Wait State Monitoring
Sys.dm_exec_requests
Sys.dm_exec_query_stats
Query DMOs
Sys.dm_exec_sql_text
Sys.dm_exec_query_plan
Sys.dm_exec_query_plan_text
Sys.dm_db_index_operational_stats
Sys.dm_db_index_physical_stats
Sys.dm_db_index_usage_stats
Index DMO
Goals
Explain the importance of query tuning within the
Azure SQL Database environment.
Show how the hybrid tool set can be used to
identify poor performance.
Demonstrate the additional functionality available
within the Database Management Portal interface.
Scarydba.com/resources
Resources
SQL Server 2012 Query Performance Tuning
by Grant Fritchey
Performance Tuning with SQL Server Dynamic
Management Views by Louis Davidson and Tim Ford
Windows Azure SQL Database and SQL Server –
Performance and Scalability Compared and Contrasted
Get in touch
Grant Fritchey
scarydba.com
grant@scarydba.com
@gfritchey

More Related Content

What's hot (20)

PDF
Deliver Your Modern Data Warehouse (Microsoft Tech Summit Oslo 2018)
Cathrine Wilhelmsen
 
PPTX
Microsoft Data Integration Pipelines: Azure Data Factory and SSIS
Mark Kromer
 
PPTX
ETL in the Cloud With Microsoft Azure
Mark Kromer
 
PPTX
Five ways database modernization simplifies your data life
SingleStore
 
PPTX
Curriculum Associates Strata NYC 2017
Kristi Lewandowski
 
PPTX
PowerStream Demo
SingleStore
 
PDF
Real-Time Forecasting at Scale using Delta Lake and Delta Caching
Databricks
 
PDF
Azure saturday pn 2018
Marco Pozzan
 
PDF
5 Amazing Reasons DBAs Need to Love Extended Events
Jason Strate
 
PDF
Solving your Backup Needs - Ben Cefalo mdbe18
MongoDB
 
PDF
Statistis, Row Counts, Execution Plans and Query Tuning
Grant Fritchey
 
PPTX
Splunk What's New - Nov 2014
Hal Rottenberg
 
PPTX
Azure Data Factory for Redmond SQL PASS UG Sept 2018
Mark Kromer
 
PDF
Tools and Tips For Data Warehouse Developers (SQLGLA)
Cathrine Wilhelmsen
 
PPTX
Data & Analytics Forum: Moving Telcos to Real Time
SingleStore
 
PDF
Real-Time Analytics with Confluent and MemSQL
SingleStore
 
PPTX
Geek Sync I Learn to Troubleshoot Query Performance in Analysis Services
IDERA Software
 
PDF
Leveraging Cloud for the Modern SQL Developer
Jason Strate
 
PPTX
Microsoft Build 2018 Analytic Solutions with Azure Data Factory and Azure SQL...
Mark Kromer
 
PDF
ADF Mapping Data Flow Private Preview Migration
Mark Kromer
 
Deliver Your Modern Data Warehouse (Microsoft Tech Summit Oslo 2018)
Cathrine Wilhelmsen
 
Microsoft Data Integration Pipelines: Azure Data Factory and SSIS
Mark Kromer
 
ETL in the Cloud With Microsoft Azure
Mark Kromer
 
Five ways database modernization simplifies your data life
SingleStore
 
Curriculum Associates Strata NYC 2017
Kristi Lewandowski
 
PowerStream Demo
SingleStore
 
Real-Time Forecasting at Scale using Delta Lake and Delta Caching
Databricks
 
Azure saturday pn 2018
Marco Pozzan
 
5 Amazing Reasons DBAs Need to Love Extended Events
Jason Strate
 
Solving your Backup Needs - Ben Cefalo mdbe18
MongoDB
 
Statistis, Row Counts, Execution Plans and Query Tuning
Grant Fritchey
 
Splunk What's New - Nov 2014
Hal Rottenberg
 
Azure Data Factory for Redmond SQL PASS UG Sept 2018
Mark Kromer
 
Tools and Tips For Data Warehouse Developers (SQLGLA)
Cathrine Wilhelmsen
 
Data & Analytics Forum: Moving Telcos to Real Time
SingleStore
 
Real-Time Analytics with Confluent and MemSQL
SingleStore
 
Geek Sync I Learn to Troubleshoot Query Performance in Analysis Services
IDERA Software
 
Leveraging Cloud for the Modern SQL Developer
Jason Strate
 
Microsoft Build 2018 Analytic Solutions with Azure Data Factory and Azure SQL...
Mark Kromer
 
ADF Mapping Data Flow Private Preview Migration
Mark Kromer
 

Similar to Grant Fritchey - Query Tuning In Azure SQL Database (20)

PDF
Query Tuning Azure SQL Databases
Grant Fritchey
 
PDF
Performance Tuning Azure SQL Database
Grant Fritchey
 
PDF
SQL Server Tools for Query Tuning
Grant Fritchey
 
PPTX
Monitorando performance no Azure SQL Database
Vitor Fava
 
PPTX
05_DP_300T00A_Optimize.pptx
KareemBullard1
 
PDF
SQL Server Query Tuning Tips - Get it Right the First Time
Dean Richards
 
PDF
SQL_Tuning_Oracle_10g.pdf
NareshKumar729083
 
PDF
Redgate Community Circle: Tools For SQL Server Performance Tuning
Grant Fritchey
 
PDF
SQL Database Performance Tuning for Developers
BRIJESH KUMAR
 
PDF
SQL Server 2017 Enhancements You Need To Know
Quest
 
PPTX
SQL TUNING 101
Alex Zaballa
 
PDF
Monitor and tune for performance
Steve Xu
 
PPTX
SQL Tuning 101
Carlos Sierra
 
PDF
sqltuning101-170419021007-2.pdf
TricantinoLopezPerez
 
PPTX
Geek Sync | Performance Tune Like an MVP
IDERA Software
 
PPT
Database performance tuning and query optimization
Usman Tariq
 
PPT
Sql server performance tuning
ngupt28
 
PPTX
SQL TUNING 101
Alex Zaballa
 
PDF
SQL Server 2017 - Adaptive Query Processing and Automatic Query Tuning
Javier Villegas
 
PDF
Gems to help you troubleshoot query performance
Pedro Lopes
 
Query Tuning Azure SQL Databases
Grant Fritchey
 
Performance Tuning Azure SQL Database
Grant Fritchey
 
SQL Server Tools for Query Tuning
Grant Fritchey
 
Monitorando performance no Azure SQL Database
Vitor Fava
 
05_DP_300T00A_Optimize.pptx
KareemBullard1
 
SQL Server Query Tuning Tips - Get it Right the First Time
Dean Richards
 
SQL_Tuning_Oracle_10g.pdf
NareshKumar729083
 
Redgate Community Circle: Tools For SQL Server Performance Tuning
Grant Fritchey
 
SQL Database Performance Tuning for Developers
BRIJESH KUMAR
 
SQL Server 2017 Enhancements You Need To Know
Quest
 
SQL TUNING 101
Alex Zaballa
 
Monitor and tune for performance
Steve Xu
 
SQL Tuning 101
Carlos Sierra
 
sqltuning101-170419021007-2.pdf
TricantinoLopezPerez
 
Geek Sync | Performance Tune Like an MVP
IDERA Software
 
Database performance tuning and query optimization
Usman Tariq
 
Sql server performance tuning
ngupt28
 
SQL TUNING 101
Alex Zaballa
 
SQL Server 2017 - Adaptive Query Processing and Automatic Query Tuning
Javier Villegas
 
Gems to help you troubleshoot query performance
Pedro Lopes
 
Ad

More from Red Gate Software (20)

PDF
The future of DevOps: fully left-shifted deployments with version control and...
Red Gate Software
 
PDF
Embracing DevOps through database migrations with Flyway
Red Gate Software
 
PPTX
Database DevOps for Managed Service Providers
Red Gate Software
 
PDF
Mizuho Financial: Launching our Database DevOps journey
Red Gate Software
 
PDF
7 steps to effective SQL Server monitoring
Red Gate Software
 
PDF
Level up your deployments for SQL Source Control
Red Gate Software
 
PDF
Key findings from the 2020 state of database dev ops report
Red Gate Software
 
PPTX
Extend DevOps to Your SQL Server Databases
Red Gate Software
 
PDF
2019 year in review slides
Red Gate Software
 
PPTX
What we learned at PASS Summit in 2019
Red Gate Software
 
PPTX
Quality in Software Development: Anglia Ruskin University
Red Gate Software
 
PPTX
How SQL Change Automation helps you deliver value faster
Red Gate Software
 
PPTX
DevOps essentials from Abel Wang and Steve Jones
Red Gate Software
 
PPTX
Successfully migrating existing databases to Azure
Red Gate Software
 
PPTX
The Ultimate Guide to Choosing and Implementing the Right Monitoring Tool
Red Gate Software
 
PDF
Everything You Need to Know About the 2019 DORA Accelerate State of DevOps Re...
Red Gate Software
 
PDF
Using Redgate, AKS and Azure to bring DevOps to your database
Red Gate Software
 
PDF
Using Redgate, AKS and Azure to bring DevOps to your Database
Red Gate Software
 
PDF
How to Pitch a Software Development Initiative and Ignite Culture Change
Red Gate Software
 
PDF
Taming the Wild West
Red Gate Software
 
The future of DevOps: fully left-shifted deployments with version control and...
Red Gate Software
 
Embracing DevOps through database migrations with Flyway
Red Gate Software
 
Database DevOps for Managed Service Providers
Red Gate Software
 
Mizuho Financial: Launching our Database DevOps journey
Red Gate Software
 
7 steps to effective SQL Server monitoring
Red Gate Software
 
Level up your deployments for SQL Source Control
Red Gate Software
 
Key findings from the 2020 state of database dev ops report
Red Gate Software
 
Extend DevOps to Your SQL Server Databases
Red Gate Software
 
2019 year in review slides
Red Gate Software
 
What we learned at PASS Summit in 2019
Red Gate Software
 
Quality in Software Development: Anglia Ruskin University
Red Gate Software
 
How SQL Change Automation helps you deliver value faster
Red Gate Software
 
DevOps essentials from Abel Wang and Steve Jones
Red Gate Software
 
Successfully migrating existing databases to Azure
Red Gate Software
 
The Ultimate Guide to Choosing and Implementing the Right Monitoring Tool
Red Gate Software
 
Everything You Need to Know About the 2019 DORA Accelerate State of DevOps Re...
Red Gate Software
 
Using Redgate, AKS and Azure to bring DevOps to your database
Red Gate Software
 
Using Redgate, AKS and Azure to bring DevOps to your Database
Red Gate Software
 
How to Pitch a Software Development Initiative and Ignite Culture Change
Red Gate Software
 
Taming the Wild West
Red Gate Software
 
Ad

Recently uploaded (20)

PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PPT
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
PPTX
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
PDF
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
Digital Circuits, important subject in CS
contactparinay1
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 

Grant Fritchey - Query Tuning In Azure SQL Database

Editor's Notes

  • #8: Sys.event_log: Event_type = throttling, throttling_long_transaction, deadlockEvent_subtype = actual reasonDescription Sys.database_connection_stats, aggregated connection info on 5 minute intervalsTwo levels of throttling, soft throttle on resources, killed connection both are in the details of sub-type40549 Session blocking system task for long period of time (20 seconds)40550 Session is consuming too many locks (1 million)40551 Session is consuming too much tempdb space (5gb)40552 Transaction consuming too much log space or active transaction preventing log truncation40553 Sessoin consuming memory (16mb) and there are memory waits (20 seconds)
  • #12: Just note objects available. Design and viewing & drag & drop from the Object Explorer to the query window
  • #13: Nothing magic, normal query window behavior including formatting & code coloring
  • #14: Again, normal stuff, note, execution times are for the server, not including latency
  • #15: Actual execution plan generated against SQL Database from SSMS
  • #16: SELECT operator from SQL Database. Point out information about memory & parallelism. Only real difference is NonParallelPlanReason. But that’s a difference that is reflected in SSMS.
  • #17: This is the property sheet from a SQL Server database SELECT operator.Note that for identical queries and identical data sets the operator cost estimates are different.
  • #19: Remember that the query performance is based on what’s in cache.
  • #20: Nothing exciting, but useful information. Note ability to modify time frame & layout
  • #21: Some customizable metrics. Most noteworthy for our purposes is the Throttled Connections
  • #22: Main management page. Queries are clickable. Columns are sortable.
  • #26: Note Save As, Open, etc. Syntax highlighting (of a sort).
  • #27: Works like tabs. You can look at more than one object or query and switch between them
  • #28: Query & results. No shocks
  • #29: In order to see the stats, must be run from the query. NOTE: You can include GO statements.
  • #35: Note that clicking on Actual Plan runs the query, not a toggle in this case.
  • #36: Mention that clicking on the icons in the lower left will hide the tool bar.
  • #39: Also sort by Merge, Hash, Sort, Scan, Seek, Warnings
  • #42: Se_repl_slow_secondary_throttle is due to secondary machines causing waits while information is transferred to them.Mention that when dealing with how to fix one of the three, cpu, io, memory; the solution is scale out with more hardware, but you have to deal with necessary changes to coding mechanisms.REPL is either a “Noisy neighbor” or you’re moving too much data. You’ll know you’re a noisy neighbor because you’ll be getting throttling alerts
  • #44: Just remember that there is ALWAYS memory pressure affecting the cache
  • #45: Be sure to mention that fragmented indexes leads to additional storage overhead and with limited options here, you pay for more, so defragmented indexes save the company money. Also more fragmentation can lead to longer running queries, so you may experience throttling.Operational stats is current activity