SlideShare une entreprise Scribd logo
1  sur  55
Intro to Query Store
By Tracy Boggiano
Tracy Boggiano
SQL Server DBA for 20+
years
@TracyBoggiano
databasesuperhero.com
tracyboggiano
speakingmentors.com
• What It Can Do For Us?
• Setup
• How It Works
• Reports
• Usage Scenarios
• 2017 Features
• Troubleshooting
• Best Practices
Agenda
WHAT IT CAN DO FOR US?
What Query Store Can Do For Us?
• Regressed Queries
• Identify Top Consuming Queries
• Audit the history of query plans
• Identify Resource Consumption Patterns
What Query Store Can Do For Us?
• In 2017
• Wait Stats
• Automatic plan correction
• Show more statistics
• In 2019
• Show even more statistics
SETUP
Query Store Setup
• Run one simple command:
• ALTER DATABASE [DatabaseName]
SET QUERY_STORE = ON;
Query Store Options 2016+
• Operation Mode
• Data Flush Interval (Minutes)
• Statistics Collection Interval
• Max Size (MB)
• Query Store Capture Mode
• Size Based Cleanup Mode
• Stale Query Threshold (Days)
Query Store Options 2017
• Waits Statistics Capture
• Max Plans Per Query
Query Store Options 2019
• Query Store Capture Mode = CUSTOM
 Stale Capture Policy Threshold
 Execution Count
 Total Compile CPU Time MS
 Total Execution CPU Time MS
Query Store Setup
• PRIMARY filegroup
• https://feedback.azure.com/forums/90803
5-sql-server/suggestions/32902072-
option-to-store-query-store-data-in-a-
filegroup-ot
Query Store Setup
• Per Database
• Nice to have Central Repository
• https://feedback.azure.com/forums/9
08035-sql-
server/suggestions/33815995-create-
central-repository-for-query-store
Query Store Trace Flags
• 7745 - Forces Query Store to not flush
data to disk on database shutdown.
• 7752 - Enables asynchronous loading of
database
GUI
• Right click the
database, the
click on
properties,
then Query
Store
dbatools
• Get-DbaQueryStoreOptions
• Set-DbaQueryStoreOptions
• Copy-DbaQueryStoreOptions
Query Store Setup Summary
• Set your options especially size
• PRIMARY filegroup
• Per database
• Use CUSTOM if you have ad-hoc quereies
and are on 2019
HOW IT WORKS
How Query Store Collects
Information
• Query processed by Algebrizer and
sends it to the Query Optimizer
• Checks for forced plan or out pops
a new Execution Plan
• Query Plan is put into Plan Cache
• Async collects data into Query
Store Memory
• Async writes to disk
Where Query Store Collects Information
• Plan Store – query plan, query text, last execution time,
compile time
• Runtime Stats Store – all runtime stats for plans, cpu,
logical reads, logical writes, physical reads, memory,
tempdb, duration, execution count
• Wait Stats Store – wait categories per plan
Database Superhero 2018
REPORTS
Ways to Stabilize Perfomance
• Change code and/or schema
• Add RECOMPILE
• Manually get the best plan in the cache
• Use a plan guide
• Force a plan using query store
Regressed Queries
• Identify queries that have degraded in
performance
• See if there is plan that can be forced
easily
• Force the previous plan from the history
Regressed Queries
Regressed Queries
Check Status of Forced Queries
• Query = is_forced_plan = 1
• Look at report in SSMS
• Extended event
Overall Resource Consumption
Top Consuming Resources
• Look at forcing a plan because of regression
• Missing indexes
• Make sure that the statistics are up-to-date
• Make sure that indexes used by the query are
defragmented
• Consider rewriting expensive query
Queries with High Variation
Query Wait Statistics
Queries with Force Plans
REPORTS
DEMO
USAGE SCENARIOS
Forcing Query Plans Manually
• Using reports you can easily find queries
with multiple plans and force a plan
• They are not schema-bound
• Should monitor for failures with Extended
Events
• When manually forced the plan is used
even when it is no longer optimal
A/B Testing
• Rolling out new application version
• Adding new hardware to the server
• Creating missing indexes for expensive
queries
Upgrade SQL Server
Summary of Usage Scenarios
• Forcing Query Plans Manually
• A/B testing
• Upgrade SQL Server
Database Superhero 2018
2017 FEATURES
Wait Stats
• New DMV sys.query_store_wait_stats
• 23 categories
• Tracks by category of wait stats such as
CPU or MEMORY
Automatic Plan Correction
• Recommendations surfaced via
sys.dm_db_tuning_recommendations
• Can automatically switch to last known good
plan
• Data is in DMV even if you don’t have the
option turned on
• Data is lost on reboot of SQL Server
Automatic Plan Correction Setup
ALTER DATABASE CURRENT
SET AUTOMATIC_TUNING
(FORCE_LAST_GOOD_PLAN = ON);
Monitoring Automatic Plan Correction
• Create an Extended Events session that captures
automatic tuning events
• automatic_tuning_error
• automatic_tuning_plan_regression_detec
tion_check_completed
• automatic_tuning_plan_regression_verif
ication_check_completed
• automatic_tuning_recommendation_expire
d
Summary of 2017 Features
• Automatic Plan Correction
• Wait Stats
Auto Tuning
sp_BlitzQueryStore
DEMOS
TROUBLESHOOTING
Perfmon Counters
• Query Store CPU usage
• Query Store logical reads
• Query Store logical writes
• Query Store physical reads
Wait Stats
• Ton of these, they all start with qds
• Three can be safely ignored:
• qds_async_queue
• qds_cleanup_stale_queries_task_main_loop_sleep
• qds_shutdown_queue
• Use Paul Randal’s script is the best way to look at wait
stats
Extended Events
• Over 50 events added
• Most can only be used by special trace
flags for Microsoft troubleshooting
• We will look at script for the important
ones
BEST PRACTICES
Best Practices
• Manage the size
• Set you Statistics Interval
• Make sure it is continuing to collect data
• Avoid using non-parameterized queries
• Avoid using drop/create process
• Avoid renaming databases
Using the Query Store with In-Memory
OLTP
• Turn on runtime statistics collection with
sys.sp_xtp_control_query_exec_stats
• Need to reset on server restart or if you
clear Query Store
• Memory grants metrics are not kept
Things of Note
• Forced plans can fail
• Drop an index
• Change the name of an index
• Remove columns from an index
• Forced plans for do work on the secondaries
of your AGs
• Forced plans don’t age out of Query Store
Resources
• Monitoring Performance By Using the Query Store - https://docs.microsoft.com/en-
us/sql/relational-databases/performance/monitoring-performance-by-using-the-query-
store
• Best Practice with the Query Store - https://msdn.microsoft.com/en-
us/library/mt604821.aspx
• Wait Stats - https://docs.microsoft.com/en-us/sql/relational-databases/system-catalog-
views/sys-query-store-wait-stats-transact-sql
• Automatic plan correction in SQL Server 2017 -
https://blogs.msdn.microsoft.com/sqlserverstorageengine/2017/05/17/automatic-plan-
correction-in-sql-server-2017/
• T-SQL Tuesday #124 Summary - https://tracyboggiano.com/archive/2020/03/t-sql-
tuesday-124-query-store-summary/
• Erin Stellato’s Blog - https://www.sqlskills.com/blogs/erin/category/query-store/
• Grant Fritchey’s Blog - https://www.scarydba.com/?s=query+store
Contact Info
EMAIL
tracy@tracyboggiano.com
TWITTER
@TracyBoggiano
MY WEBSITE
databasesuperhero.com
Thank you!

Contenu connexe

Tendances

eBay Experimentation Platform on Hadoop
eBay Experimentation Platform on HadoopeBay Experimentation Platform on Hadoop
eBay Experimentation Platform on HadoopTony Ng
 
Sybase BAM Overview
Sybase BAM OverviewSybase BAM Overview
Sybase BAM OverviewXu Jiang
 
Oct 2011 CHADNUG Presentation on Hadoop
Oct 2011 CHADNUG Presentation on HadoopOct 2011 CHADNUG Presentation on Hadoop
Oct 2011 CHADNUG Presentation on HadoopJosh Patterson
 
Data Warehouse Modernization - Big Data in the Cloud Success with Qubole on O...
Data Warehouse Modernization - Big Data in the Cloud Success with Qubole on O...Data Warehouse Modernization - Big Data in the Cloud Success with Qubole on O...
Data Warehouse Modernization - Big Data in the Cloud Success with Qubole on O...Qubole
 
Work with hundred of hot terabytes in JVMs
Work with hundred of hot terabytes in JVMsWork with hundred of hot terabytes in JVMs
Work with hundred of hot terabytes in JVMsMalin Weiss
 
Keynote – From MapReduce to Spark: An Ecosystem Evolves by Doug Cutting, Chie...
Keynote – From MapReduce to Spark: An Ecosystem Evolves by Doug Cutting, Chie...Keynote – From MapReduce to Spark: An Ecosystem Evolves by Doug Cutting, Chie...
Keynote – From MapReduce to Spark: An Ecosystem Evolves by Doug Cutting, Chie...Cloudera, Inc.
 
Configuration Driven Reporting On Large Dataset Using Apache Spark
Configuration Driven Reporting On Large Dataset Using Apache SparkConfiguration Driven Reporting On Large Dataset Using Apache Spark
Configuration Driven Reporting On Large Dataset Using Apache SparkDatabricks
 
eBay Cloud CMS based on NOSQL
eBay Cloud CMS based on NOSQLeBay Cloud CMS based on NOSQL
eBay Cloud CMS based on NOSQLXu Jiang
 
What SharePoint Admins need to know about SQL-Cinncinati
What SharePoint Admins need to know about SQL-CinncinatiWhat SharePoint Admins need to know about SQL-Cinncinati
What SharePoint Admins need to know about SQL-CinncinatiJ.D. Wade
 
LeanXcale for Monitoring
LeanXcale for MonitoringLeanXcale for Monitoring
LeanXcale for MonitoringLeanXcale
 
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 SharePointJ.D. Wade
 
Google Cloud Data Platform - Why Google for Data Analysis?
Google Cloud Data Platform - Why Google for Data Analysis?Google Cloud Data Platform - Why Google for Data Analysis?
Google Cloud Data Platform - Why Google for Data Analysis?Andreas Raible
 
How to optimize asp dot-net application
How to optimize asp dot-net applicationHow to optimize asp dot-net application
How to optimize asp dot-net applicationsonia merchant
 
How Adobe uses Structured Streaming at Scale
How Adobe uses Structured Streaming at ScaleHow Adobe uses Structured Streaming at Scale
How Adobe uses Structured Streaming at ScaleDatabricks
 
#GeodeSummit - Where Does Geode Fit in Modern System Architectures
#GeodeSummit - Where Does Geode Fit in Modern System Architectures#GeodeSummit - Where Does Geode Fit in Modern System Architectures
#GeodeSummit - Where Does Geode Fit in Modern System ArchitecturesPivotalOpenSourceHub
 
Expert summit SQL Server 2016
Expert summit   SQL Server 2016Expert summit   SQL Server 2016
Expert summit SQL Server 2016Łukasz Grala
 
Azure Data Factory Data Flow Performance Tuning 101
Azure Data Factory Data Flow Performance Tuning 101Azure Data Factory Data Flow Performance Tuning 101
Azure Data Factory Data Flow Performance Tuning 101Mark Kromer
 
Monitorando performance no Azure SQL Database
Monitorando performance no Azure SQL DatabaseMonitorando performance no Azure SQL Database
Monitorando performance no Azure SQL DatabaseVitor Fava
 
Our Journey from Cassandra to Scylla
Our Journey from Cassandra to ScyllaOur Journey from Cassandra to Scylla
Our Journey from Cassandra to ScyllaScyllaDB
 

Tendances (20)

eBay Experimentation Platform on Hadoop
eBay Experimentation Platform on HadoopeBay Experimentation Platform on Hadoop
eBay Experimentation Platform on Hadoop
 
Sybase BAM Overview
Sybase BAM OverviewSybase BAM Overview
Sybase BAM Overview
 
Oct 2011 CHADNUG Presentation on Hadoop
Oct 2011 CHADNUG Presentation on HadoopOct 2011 CHADNUG Presentation on Hadoop
Oct 2011 CHADNUG Presentation on Hadoop
 
Data Warehouse Modernization - Big Data in the Cloud Success with Qubole on O...
Data Warehouse Modernization - Big Data in the Cloud Success with Qubole on O...Data Warehouse Modernization - Big Data in the Cloud Success with Qubole on O...
Data Warehouse Modernization - Big Data in the Cloud Success with Qubole on O...
 
Google cloud certification data engineer
Google cloud certification data engineerGoogle cloud certification data engineer
Google cloud certification data engineer
 
Work with hundred of hot terabytes in JVMs
Work with hundred of hot terabytes in JVMsWork with hundred of hot terabytes in JVMs
Work with hundred of hot terabytes in JVMs
 
Keynote – From MapReduce to Spark: An Ecosystem Evolves by Doug Cutting, Chie...
Keynote – From MapReduce to Spark: An Ecosystem Evolves by Doug Cutting, Chie...Keynote – From MapReduce to Spark: An Ecosystem Evolves by Doug Cutting, Chie...
Keynote – From MapReduce to Spark: An Ecosystem Evolves by Doug Cutting, Chie...
 
Configuration Driven Reporting On Large Dataset Using Apache Spark
Configuration Driven Reporting On Large Dataset Using Apache SparkConfiguration Driven Reporting On Large Dataset Using Apache Spark
Configuration Driven Reporting On Large Dataset Using Apache Spark
 
eBay Cloud CMS based on NOSQL
eBay Cloud CMS based on NOSQLeBay Cloud CMS based on NOSQL
eBay Cloud CMS based on NOSQL
 
What SharePoint Admins need to know about SQL-Cinncinati
What SharePoint Admins need to know about SQL-CinncinatiWhat SharePoint Admins need to know about SQL-Cinncinati
What SharePoint Admins need to know about SQL-Cinncinati
 
LeanXcale for Monitoring
LeanXcale for MonitoringLeanXcale for Monitoring
LeanXcale for Monitoring
 
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
 
Google Cloud Data Platform - Why Google for Data Analysis?
Google Cloud Data Platform - Why Google for Data Analysis?Google Cloud Data Platform - Why Google for Data Analysis?
Google Cloud Data Platform - Why Google for Data Analysis?
 
How to optimize asp dot-net application
How to optimize asp dot-net applicationHow to optimize asp dot-net application
How to optimize asp dot-net application
 
How Adobe uses Structured Streaming at Scale
How Adobe uses Structured Streaming at ScaleHow Adobe uses Structured Streaming at Scale
How Adobe uses Structured Streaming at Scale
 
#GeodeSummit - Where Does Geode Fit in Modern System Architectures
#GeodeSummit - Where Does Geode Fit in Modern System Architectures#GeodeSummit - Where Does Geode Fit in Modern System Architectures
#GeodeSummit - Where Does Geode Fit in Modern System Architectures
 
Expert summit SQL Server 2016
Expert summit   SQL Server 2016Expert summit   SQL Server 2016
Expert summit SQL Server 2016
 
Azure Data Factory Data Flow Performance Tuning 101
Azure Data Factory Data Flow Performance Tuning 101Azure Data Factory Data Flow Performance Tuning 101
Azure Data Factory Data Flow Performance Tuning 101
 
Monitorando performance no Azure SQL Database
Monitorando performance no Azure SQL DatabaseMonitorando performance no Azure SQL Database
Monitorando performance no Azure SQL Database
 
Our Journey from Cassandra to Scylla
Our Journey from Cassandra to ScyllaOur Journey from Cassandra to Scylla
Our Journey from Cassandra to Scylla
 

Similaire à Geek Sync | Intro to Query Store

Using Query Store to Understand and Control Query Performance
Using Query Store to Understand and Control Query PerformanceUsing Query Store to Understand and Control Query Performance
Using Query Store to Understand and Control Query PerformanceGrant Fritchey
 
Welcome To The 2016 Query Store!
Welcome To The 2016 Query Store!Welcome To The 2016 Query Store!
Welcome To The 2016 Query Store!SolarWinds
 
Optimising Queries - Series 1 Query Optimiser Architecture
Optimising Queries - Series 1 Query Optimiser ArchitectureOptimising Queries - Series 1 Query Optimiser Architecture
Optimising Queries - Series 1 Query Optimiser ArchitectureDAGEOP LTD
 
SQL Server 2017 - Adaptive Query Processing and Automatic Query Tuning
SQL Server 2017 - Adaptive Query Processing and Automatic Query TuningSQL Server 2017 - Adaptive Query Processing and Automatic Query Tuning
SQL Server 2017 - Adaptive Query Processing and Automatic Query TuningJavier Villegas
 
Sql server 2016 rc 3 query store overview and architecture
Sql server 2016 rc 3  query store overview and architectureSql server 2016 rc 3  query store overview and architecture
Sql server 2016 rc 3 query store overview and architectureAhsan Kabir
 
SQL Server 2017 Enhancements You Need To Know
SQL Server 2017 Enhancements You Need To KnowSQL Server 2017 Enhancements You Need To Know
SQL Server 2017 Enhancements You Need To KnowQuest
 
Oracle Enteprise Manager Cloud Control 12c - Setting Up Metrics and Monitorin...
Oracle Enteprise Manager Cloud Control 12c - Setting Up Metrics and Monitorin...Oracle Enteprise Manager Cloud Control 12c - Setting Up Metrics and Monitorin...
Oracle Enteprise Manager Cloud Control 12c - Setting Up Metrics and Monitorin...Leighton Nelson
 
Get the most out of your AWS Redshift investment while keeping cost down
Get the most out of your AWS Redshift investment while keeping cost downGet the most out of your AWS Redshift investment while keeping cost down
Get the most out of your AWS Redshift investment while keeping cost downAgilisium Consulting
 
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
 
Webinar - Macy’s: Why Your Database Decision Directly Impacts Customer Experi...
Webinar - Macy’s: Why Your Database Decision Directly Impacts Customer Experi...Webinar - Macy’s: Why Your Database Decision Directly Impacts Customer Experi...
Webinar - Macy’s: Why Your Database Decision Directly Impacts Customer Experi...DataStax
 
KoprowskiT_SQLSaturdayManchester_2AMaDisasterJustbegan
KoprowskiT_SQLSaturdayManchester_2AMaDisasterJustbeganKoprowskiT_SQLSaturdayManchester_2AMaDisasterJustbegan
KoprowskiT_SQLSaturdayManchester_2AMaDisasterJustbeganTobias Koprowski
 
Choosing the Right Business Intelligence Tools for Your Data and Architectura...
Choosing the Right Business Intelligence Tools for Your Data and Architectura...Choosing the Right Business Intelligence Tools for Your Data and Architectura...
Choosing the Right Business Intelligence Tools for Your Data and Architectura...Victor Holman
 
Bdf16 big-data-warehouse-case-study-data kitchen
Bdf16 big-data-warehouse-case-study-data kitchenBdf16 big-data-warehouse-case-study-data kitchen
Bdf16 big-data-warehouse-case-study-data kitchenChristopher Bergh
 
Remote DBA Experts SQL Server 2008 New Features
Remote DBA Experts SQL Server 2008 New FeaturesRemote DBA Experts SQL Server 2008 New Features
Remote DBA Experts SQL Server 2008 New FeaturesRemote DBA Experts
 
Common SQL Server Mistakes and How to Avoid Them with Tim Radney
Common SQL Server Mistakes and How to Avoid Them with Tim RadneyCommon SQL Server Mistakes and How to Avoid Them with Tim Radney
Common SQL Server Mistakes and How to Avoid Them with Tim RadneyEmbarcadero Technologies
 
Oracle Performance Tuning Training | Oracle Performance Tuning
Oracle Performance Tuning Training | Oracle Performance TuningOracle Performance Tuning Training | Oracle Performance Tuning
Oracle Performance Tuning Training | Oracle Performance TuningOracleTrainings
 
Pre and post tips to installing sql server correctly
Pre and post tips to installing sql server correctlyPre and post tips to installing sql server correctly
Pre and post tips to installing sql server correctlyAntonios Chatzipavlis
 
MySQL: Know more about open Source Database
MySQL: Know more about open Source DatabaseMySQL: Know more about open Source Database
MySQL: Know more about open Source DatabaseMahesh Salaria
 
071410 sun a_1515_feldman_stephen
071410 sun a_1515_feldman_stephen071410 sun a_1515_feldman_stephen
071410 sun a_1515_feldman_stephenSteve Feldman
 

Similaire à Geek Sync | Intro to Query Store (20)

Using Query Store to Understand and Control Query Performance
Using Query Store to Understand and Control Query PerformanceUsing Query Store to Understand and Control Query Performance
Using Query Store to Understand and Control Query Performance
 
Welcome To The 2016 Query Store!
Welcome To The 2016 Query Store!Welcome To The 2016 Query Store!
Welcome To The 2016 Query Store!
 
Optimising Queries - Series 1 Query Optimiser Architecture
Optimising Queries - Series 1 Query Optimiser ArchitectureOptimising Queries - Series 1 Query Optimiser Architecture
Optimising Queries - Series 1 Query Optimiser Architecture
 
SQL Server 2017 - Adaptive Query Processing and Automatic Query Tuning
SQL Server 2017 - Adaptive Query Processing and Automatic Query TuningSQL Server 2017 - Adaptive Query Processing and Automatic Query Tuning
SQL Server 2017 - Adaptive Query Processing and Automatic Query Tuning
 
Sql server 2016 rc 3 query store overview and architecture
Sql server 2016 rc 3  query store overview and architectureSql server 2016 rc 3  query store overview and architecture
Sql server 2016 rc 3 query store overview and architecture
 
SQL Server 2017 Enhancements You Need To Know
SQL Server 2017 Enhancements You Need To KnowSQL Server 2017 Enhancements You Need To Know
SQL Server 2017 Enhancements You Need To Know
 
Oracle Enteprise Manager Cloud Control 12c - Setting Up Metrics and Monitorin...
Oracle Enteprise Manager Cloud Control 12c - Setting Up Metrics and Monitorin...Oracle Enteprise Manager Cloud Control 12c - Setting Up Metrics and Monitorin...
Oracle Enteprise Manager Cloud Control 12c - Setting Up Metrics and Monitorin...
 
SQLDay2013_MarcinSzeliga_StoredProcedures
SQLDay2013_MarcinSzeliga_StoredProceduresSQLDay2013_MarcinSzeliga_StoredProcedures
SQLDay2013_MarcinSzeliga_StoredProcedures
 
Get the most out of your AWS Redshift investment while keeping cost down
Get the most out of your AWS Redshift investment while keeping cost downGet the most out of your AWS Redshift investment while keeping cost down
Get the most out of your AWS Redshift investment while keeping cost down
 
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...
 
Webinar - Macy’s: Why Your Database Decision Directly Impacts Customer Experi...
Webinar - Macy’s: Why Your Database Decision Directly Impacts Customer Experi...Webinar - Macy’s: Why Your Database Decision Directly Impacts Customer Experi...
Webinar - Macy’s: Why Your Database Decision Directly Impacts Customer Experi...
 
KoprowskiT_SQLSaturdayManchester_2AMaDisasterJustbegan
KoprowskiT_SQLSaturdayManchester_2AMaDisasterJustbeganKoprowskiT_SQLSaturdayManchester_2AMaDisasterJustbegan
KoprowskiT_SQLSaturdayManchester_2AMaDisasterJustbegan
 
Choosing the Right Business Intelligence Tools for Your Data and Architectura...
Choosing the Right Business Intelligence Tools for Your Data and Architectura...Choosing the Right Business Intelligence Tools for Your Data and Architectura...
Choosing the Right Business Intelligence Tools for Your Data and Architectura...
 
Bdf16 big-data-warehouse-case-study-data kitchen
Bdf16 big-data-warehouse-case-study-data kitchenBdf16 big-data-warehouse-case-study-data kitchen
Bdf16 big-data-warehouse-case-study-data kitchen
 
Remote DBA Experts SQL Server 2008 New Features
Remote DBA Experts SQL Server 2008 New FeaturesRemote DBA Experts SQL Server 2008 New Features
Remote DBA Experts SQL Server 2008 New Features
 
Common SQL Server Mistakes and How to Avoid Them with Tim Radney
Common SQL Server Mistakes and How to Avoid Them with Tim RadneyCommon SQL Server Mistakes and How to Avoid Them with Tim Radney
Common SQL Server Mistakes and How to Avoid Them with Tim Radney
 
Oracle Performance Tuning Training | Oracle Performance Tuning
Oracle Performance Tuning Training | Oracle Performance TuningOracle Performance Tuning Training | Oracle Performance Tuning
Oracle Performance Tuning Training | Oracle Performance Tuning
 
Pre and post tips to installing sql server correctly
Pre and post tips to installing sql server correctlyPre and post tips to installing sql server correctly
Pre and post tips to installing sql server correctly
 
MySQL: Know more about open Source Database
MySQL: Know more about open Source DatabaseMySQL: Know more about open Source Database
MySQL: Know more about open Source Database
 
071410 sun a_1515_feldman_stephen
071410 sun a_1515_feldman_stephen071410 sun a_1515_feldman_stephen
071410 sun a_1515_feldman_stephen
 

Plus de IDERA Software

The role of the database administrator (DBA) in 2020: Changes, challenges, an...
The role of the database administrator (DBA) in 2020: Changes, challenges, an...The role of the database administrator (DBA) in 2020: Changes, challenges, an...
The role of the database administrator (DBA) in 2020: Changes, challenges, an...IDERA Software
 
Problems and solutions for migrating databases to the cloud
Problems and solutions for migrating databases to the cloudProblems and solutions for migrating databases to the cloud
Problems and solutions for migrating databases to the cloudIDERA Software
 
Public cloud uses and limitations
Public cloud uses and limitationsPublic cloud uses and limitations
Public cloud uses and limitationsIDERA Software
 
Optimize the performance, cost, and value of databases.pptx
Optimize the performance, cost, and value of databases.pptxOptimize the performance, cost, and value of databases.pptx
Optimize the performance, cost, and value of databases.pptxIDERA Software
 
Monitor cloud database with SQL Diagnostic Manager for SQL Server
Monitor cloud database with SQL Diagnostic Manager for SQL ServerMonitor cloud database with SQL Diagnostic Manager for SQL Server
Monitor cloud database with SQL Diagnostic Manager for SQL ServerIDERA Software
 
Database administrators (dbas) face increasing pressure to monitor databases
Database administrators (dbas) face increasing pressure to monitor databasesDatabase administrators (dbas) face increasing pressure to monitor databases
Database administrators (dbas) face increasing pressure to monitor databasesIDERA Software
 
Six tips for cutting sql server licensing costs
Six tips for cutting sql server licensing costsSix tips for cutting sql server licensing costs
Six tips for cutting sql server licensing costsIDERA Software
 
Idera live 2021: The Power of Abstraction by Steve Hoberman
Idera live 2021:  The Power of Abstraction by Steve HobermanIdera live 2021:  The Power of Abstraction by Steve Hoberman
Idera live 2021: The Power of Abstraction by Steve HobermanIDERA Software
 
Idera live 2021: Why Data Lakes are Critical for AI, ML, and IoT By Brian Flug
Idera live 2021:  Why Data Lakes are Critical for AI, ML, and IoT  By Brian FlugIdera live 2021:  Why Data Lakes are Critical for AI, ML, and IoT  By Brian Flug
Idera live 2021: Why Data Lakes are Critical for AI, ML, and IoT By Brian FlugIDERA Software
 
Idera live 2021: Will Data Vault add Value to Your Data Warehouse? 3 Signs th...
Idera live 2021: Will Data Vault add Value to Your Data Warehouse? 3 Signs th...Idera live 2021: Will Data Vault add Value to Your Data Warehouse? 3 Signs th...
Idera live 2021: Will Data Vault add Value to Your Data Warehouse? 3 Signs th...IDERA Software
 
Idera live 2021: Managing Digital Transformation on a Budget by Bert Scalzo
Idera live 2021:  Managing Digital Transformation on a Budget by Bert ScalzoIdera live 2021:  Managing Digital Transformation on a Budget by Bert Scalzo
Idera live 2021: Managing Digital Transformation on a Budget by Bert ScalzoIDERA Software
 
Idera live 2021: Keynote Presentation The Future of Data is The Data Cloud b...
Idera live 2021:  Keynote Presentation The Future of Data is The Data Cloud b...Idera live 2021:  Keynote Presentation The Future of Data is The Data Cloud b...
Idera live 2021: Keynote Presentation The Future of Data is The Data Cloud b...IDERA Software
 
Idera live 2021: Managing Databases in the Cloud - the First Step, a Succes...
Idera live 2021:   Managing Databases in the Cloud - the First Step, a Succes...Idera live 2021:   Managing Databases in the Cloud - the First Step, a Succes...
Idera live 2021: Managing Databases in the Cloud - the First Step, a Succes...IDERA Software
 
Idera live 2021: Database Auditing - on-Premises and in the Cloud by Craig M...
Idera live 2021:  Database Auditing - on-Premises and in the Cloud by Craig M...Idera live 2021:  Database Auditing - on-Premises and in the Cloud by Craig M...
Idera live 2021: Database Auditing - on-Premises and in the Cloud by Craig M...IDERA Software
 
Idera live 2021: Performance Tuning Azure SQL Database by Monica Rathbun
Idera live 2021:  Performance Tuning Azure SQL Database by Monica RathbunIdera live 2021:  Performance Tuning Azure SQL Database by Monica Rathbun
Idera live 2021: Performance Tuning Azure SQL Database by Monica RathbunIDERA Software
 
Geek Sync | How to Be the DBA When You Don't Have a DBA - Eric Cobb | IDERA
Geek Sync | How to Be the DBA When You Don't Have a DBA - Eric Cobb | IDERAGeek Sync | How to Be the DBA When You Don't Have a DBA - Eric Cobb | IDERA
Geek Sync | How to Be the DBA When You Don't Have a DBA - Eric Cobb | IDERAIDERA Software
 
How Users of a Performance Monitoring Tool Can Benefit from an Inventory Mana...
How Users of a Performance Monitoring Tool Can Benefit from an Inventory Mana...How Users of a Performance Monitoring Tool Can Benefit from an Inventory Mana...
How Users of a Performance Monitoring Tool Can Benefit from an Inventory Mana...IDERA Software
 
Benefits of Third Party Tools for MySQL | IDERA
Benefits of Third Party Tools for MySQL | IDERABenefits of Third Party Tools for MySQL | IDERA
Benefits of Third Party Tools for MySQL | IDERAIDERA Software
 
Achieve More with Less Resources | IDERA
Achieve More with Less Resources | IDERAAchieve More with Less Resources | IDERA
Achieve More with Less Resources | IDERAIDERA Software
 
Benefits of SQL Server 2017 and 2019 | IDERA
Benefits of SQL Server 2017 and 2019 | IDERABenefits of SQL Server 2017 and 2019 | IDERA
Benefits of SQL Server 2017 and 2019 | IDERAIDERA Software
 

Plus de IDERA Software (20)

The role of the database administrator (DBA) in 2020: Changes, challenges, an...
The role of the database administrator (DBA) in 2020: Changes, challenges, an...The role of the database administrator (DBA) in 2020: Changes, challenges, an...
The role of the database administrator (DBA) in 2020: Changes, challenges, an...
 
Problems and solutions for migrating databases to the cloud
Problems and solutions for migrating databases to the cloudProblems and solutions for migrating databases to the cloud
Problems and solutions for migrating databases to the cloud
 
Public cloud uses and limitations
Public cloud uses and limitationsPublic cloud uses and limitations
Public cloud uses and limitations
 
Optimize the performance, cost, and value of databases.pptx
Optimize the performance, cost, and value of databases.pptxOptimize the performance, cost, and value of databases.pptx
Optimize the performance, cost, and value of databases.pptx
 
Monitor cloud database with SQL Diagnostic Manager for SQL Server
Monitor cloud database with SQL Diagnostic Manager for SQL ServerMonitor cloud database with SQL Diagnostic Manager for SQL Server
Monitor cloud database with SQL Diagnostic Manager for SQL Server
 
Database administrators (dbas) face increasing pressure to monitor databases
Database administrators (dbas) face increasing pressure to monitor databasesDatabase administrators (dbas) face increasing pressure to monitor databases
Database administrators (dbas) face increasing pressure to monitor databases
 
Six tips for cutting sql server licensing costs
Six tips for cutting sql server licensing costsSix tips for cutting sql server licensing costs
Six tips for cutting sql server licensing costs
 
Idera live 2021: The Power of Abstraction by Steve Hoberman
Idera live 2021:  The Power of Abstraction by Steve HobermanIdera live 2021:  The Power of Abstraction by Steve Hoberman
Idera live 2021: The Power of Abstraction by Steve Hoberman
 
Idera live 2021: Why Data Lakes are Critical for AI, ML, and IoT By Brian Flug
Idera live 2021:  Why Data Lakes are Critical for AI, ML, and IoT  By Brian FlugIdera live 2021:  Why Data Lakes are Critical for AI, ML, and IoT  By Brian Flug
Idera live 2021: Why Data Lakes are Critical for AI, ML, and IoT By Brian Flug
 
Idera live 2021: Will Data Vault add Value to Your Data Warehouse? 3 Signs th...
Idera live 2021: Will Data Vault add Value to Your Data Warehouse? 3 Signs th...Idera live 2021: Will Data Vault add Value to Your Data Warehouse? 3 Signs th...
Idera live 2021: Will Data Vault add Value to Your Data Warehouse? 3 Signs th...
 
Idera live 2021: Managing Digital Transformation on a Budget by Bert Scalzo
Idera live 2021:  Managing Digital Transformation on a Budget by Bert ScalzoIdera live 2021:  Managing Digital Transformation on a Budget by Bert Scalzo
Idera live 2021: Managing Digital Transformation on a Budget by Bert Scalzo
 
Idera live 2021: Keynote Presentation The Future of Data is The Data Cloud b...
Idera live 2021:  Keynote Presentation The Future of Data is The Data Cloud b...Idera live 2021:  Keynote Presentation The Future of Data is The Data Cloud b...
Idera live 2021: Keynote Presentation The Future of Data is The Data Cloud b...
 
Idera live 2021: Managing Databases in the Cloud - the First Step, a Succes...
Idera live 2021:   Managing Databases in the Cloud - the First Step, a Succes...Idera live 2021:   Managing Databases in the Cloud - the First Step, a Succes...
Idera live 2021: Managing Databases in the Cloud - the First Step, a Succes...
 
Idera live 2021: Database Auditing - on-Premises and in the Cloud by Craig M...
Idera live 2021:  Database Auditing - on-Premises and in the Cloud by Craig M...Idera live 2021:  Database Auditing - on-Premises and in the Cloud by Craig M...
Idera live 2021: Database Auditing - on-Premises and in the Cloud by Craig M...
 
Idera live 2021: Performance Tuning Azure SQL Database by Monica Rathbun
Idera live 2021:  Performance Tuning Azure SQL Database by Monica RathbunIdera live 2021:  Performance Tuning Azure SQL Database by Monica Rathbun
Idera live 2021: Performance Tuning Azure SQL Database by Monica Rathbun
 
Geek Sync | How to Be the DBA When You Don't Have a DBA - Eric Cobb | IDERA
Geek Sync | How to Be the DBA When You Don't Have a DBA - Eric Cobb | IDERAGeek Sync | How to Be the DBA When You Don't Have a DBA - Eric Cobb | IDERA
Geek Sync | How to Be the DBA When You Don't Have a DBA - Eric Cobb | IDERA
 
How Users of a Performance Monitoring Tool Can Benefit from an Inventory Mana...
How Users of a Performance Monitoring Tool Can Benefit from an Inventory Mana...How Users of a Performance Monitoring Tool Can Benefit from an Inventory Mana...
How Users of a Performance Monitoring Tool Can Benefit from an Inventory Mana...
 
Benefits of Third Party Tools for MySQL | IDERA
Benefits of Third Party Tools for MySQL | IDERABenefits of Third Party Tools for MySQL | IDERA
Benefits of Third Party Tools for MySQL | IDERA
 
Achieve More with Less Resources | IDERA
Achieve More with Less Resources | IDERAAchieve More with Less Resources | IDERA
Achieve More with Less Resources | IDERA
 
Benefits of SQL Server 2017 and 2019 | IDERA
Benefits of SQL Server 2017 and 2019 | IDERABenefits of SQL Server 2017 and 2019 | IDERA
Benefits of SQL Server 2017 and 2019 | IDERA
 

Dernier

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 

Dernier (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 

Geek Sync | Intro to Query Store

  • 1. Intro to Query Store By Tracy Boggiano
  • 2. Tracy Boggiano SQL Server DBA for 20+ years @TracyBoggiano databasesuperhero.com tracyboggiano speakingmentors.com
  • 3. • What It Can Do For Us? • Setup • How It Works • Reports • Usage Scenarios • 2017 Features • Troubleshooting • Best Practices Agenda
  • 4. WHAT IT CAN DO FOR US?
  • 5. What Query Store Can Do For Us? • Regressed Queries • Identify Top Consuming Queries • Audit the history of query plans • Identify Resource Consumption Patterns
  • 6. What Query Store Can Do For Us? • In 2017 • Wait Stats • Automatic plan correction • Show more statistics • In 2019 • Show even more statistics
  • 8. Query Store Setup • Run one simple command: • ALTER DATABASE [DatabaseName] SET QUERY_STORE = ON;
  • 9. Query Store Options 2016+ • Operation Mode • Data Flush Interval (Minutes) • Statistics Collection Interval • Max Size (MB) • Query Store Capture Mode • Size Based Cleanup Mode • Stale Query Threshold (Days)
  • 10. Query Store Options 2017 • Waits Statistics Capture • Max Plans Per Query
  • 11. Query Store Options 2019 • Query Store Capture Mode = CUSTOM  Stale Capture Policy Threshold  Execution Count  Total Compile CPU Time MS  Total Execution CPU Time MS
  • 12. Query Store Setup • PRIMARY filegroup • https://feedback.azure.com/forums/90803 5-sql-server/suggestions/32902072- option-to-store-query-store-data-in-a- filegroup-ot
  • 13. Query Store Setup • Per Database • Nice to have Central Repository • https://feedback.azure.com/forums/9 08035-sql- server/suggestions/33815995-create- central-repository-for-query-store
  • 14. Query Store Trace Flags • 7745 - Forces Query Store to not flush data to disk on database shutdown. • 7752 - Enables asynchronous loading of database
  • 15. GUI • Right click the database, the click on properties, then Query Store
  • 17. Query Store Setup Summary • Set your options especially size • PRIMARY filegroup • Per database • Use CUSTOM if you have ad-hoc quereies and are on 2019
  • 19. How Query Store Collects Information • Query processed by Algebrizer and sends it to the Query Optimizer • Checks for forced plan or out pops a new Execution Plan • Query Plan is put into Plan Cache • Async collects data into Query Store Memory • Async writes to disk
  • 20. Where Query Store Collects Information • Plan Store – query plan, query text, last execution time, compile time • Runtime Stats Store – all runtime stats for plans, cpu, logical reads, logical writes, physical reads, memory, tempdb, duration, execution count • Wait Stats Store – wait categories per plan
  • 22. Ways to Stabilize Perfomance • Change code and/or schema • Add RECOMPILE • Manually get the best plan in the cache • Use a plan guide • Force a plan using query store
  • 23. Regressed Queries • Identify queries that have degraded in performance • See if there is plan that can be forced easily • Force the previous plan from the history
  • 26. Check Status of Forced Queries • Query = is_forced_plan = 1 • Look at report in SSMS • Extended event
  • 28. Top Consuming Resources • Look at forcing a plan because of regression • Missing indexes • Make sure that the statistics are up-to-date • Make sure that indexes used by the query are defragmented • Consider rewriting expensive query
  • 29. Queries with High Variation
  • 34. Forcing Query Plans Manually • Using reports you can easily find queries with multiple plans and force a plan • They are not schema-bound • Should monitor for failures with Extended Events • When manually forced the plan is used even when it is no longer optimal
  • 35. A/B Testing • Rolling out new application version • Adding new hardware to the server • Creating missing indexes for expensive queries
  • 37. Summary of Usage Scenarios • Forcing Query Plans Manually • A/B testing • Upgrade SQL Server
  • 39. Wait Stats • New DMV sys.query_store_wait_stats • 23 categories • Tracks by category of wait stats such as CPU or MEMORY
  • 40. Automatic Plan Correction • Recommendations surfaced via sys.dm_db_tuning_recommendations • Can automatically switch to last known good plan • Data is in DMV even if you don’t have the option turned on • Data is lost on reboot of SQL Server
  • 41. Automatic Plan Correction Setup ALTER DATABASE CURRENT SET AUTOMATIC_TUNING (FORCE_LAST_GOOD_PLAN = ON);
  • 42. Monitoring Automatic Plan Correction • Create an Extended Events session that captures automatic tuning events • automatic_tuning_error • automatic_tuning_plan_regression_detec tion_check_completed • automatic_tuning_plan_regression_verif ication_check_completed • automatic_tuning_recommendation_expire d
  • 43. Summary of 2017 Features • Automatic Plan Correction • Wait Stats
  • 46. Perfmon Counters • Query Store CPU usage • Query Store logical reads • Query Store logical writes • Query Store physical reads
  • 47.
  • 48. Wait Stats • Ton of these, they all start with qds • Three can be safely ignored: • qds_async_queue • qds_cleanup_stale_queries_task_main_loop_sleep • qds_shutdown_queue • Use Paul Randal’s script is the best way to look at wait stats
  • 49. Extended Events • Over 50 events added • Most can only be used by special trace flags for Microsoft troubleshooting • We will look at script for the important ones
  • 51. Best Practices • Manage the size • Set you Statistics Interval • Make sure it is continuing to collect data • Avoid using non-parameterized queries • Avoid using drop/create process • Avoid renaming databases
  • 52. Using the Query Store with In-Memory OLTP • Turn on runtime statistics collection with sys.sp_xtp_control_query_exec_stats • Need to reset on server restart or if you clear Query Store • Memory grants metrics are not kept
  • 53. Things of Note • Forced plans can fail • Drop an index • Change the name of an index • Remove columns from an index • Forced plans for do work on the secondaries of your AGs • Forced plans don’t age out of Query Store
  • 54. Resources • Monitoring Performance By Using the Query Store - https://docs.microsoft.com/en- us/sql/relational-databases/performance/monitoring-performance-by-using-the-query- store • Best Practice with the Query Store - https://msdn.microsoft.com/en- us/library/mt604821.aspx • Wait Stats - https://docs.microsoft.com/en-us/sql/relational-databases/system-catalog- views/sys-query-store-wait-stats-transact-sql • Automatic plan correction in SQL Server 2017 - https://blogs.msdn.microsoft.com/sqlserverstorageengine/2017/05/17/automatic-plan- correction-in-sql-server-2017/ • T-SQL Tuesday #124 Summary - https://tracyboggiano.com/archive/2020/03/t-sql- tuesday-124-query-store-summary/ • Erin Stellato’s Blog - https://www.sqlskills.com/blogs/erin/category/query-store/ • Grant Fritchey’s Blog - https://www.scarydba.com/?s=query+store