SlideShare une entreprise Scribd logo
1  sur  39
Télécharger pour lire hors ligne
SQL Server 2016
Live Query Statistics
& Query Store
PresenterInfo
1976 Born. The world is now a safer place to be :P
1987 My first computer was a Sinclair ZX Spectrum
1995 I started my professional career in computers
industry as an all-around-all-weather IT-guy while
studying.
Later that year I got introduced to SQL Server 6.5
2000
.
.
.
Microsoft Certified Professional and MCT on 2005.
Staff happening…
I got older and wiser while still educating myself on
SQL Server and other staff that made me what I am
today
2007 I became father to a wonderful boy! 
.
.
.
Staff happening…
2016 Here we are now looking at me saying about
myself (recursion-alert)
Vassilis IOANNIDIS a.k.a. “Bull”
SQL Server Geek
MCT, MCSD, MCDBA, MCSA, MCTS, MCPS
SQLschool.gr
Team
Antonios Chatzipavlis
SQL Server Evangelist • Trainer
Vassilis Ioannidis
SQL Server Expert • Trainer
Fivi Panopoulou
System Engineer • Speaker
Sotiris Karras
System Engineer • Speaker
Followus
insocialmedia
@sqltattoo / @sqlschool
fb/sqlschoolgr
yt/c/SqlschoolGr
SQL School Greece group
Helpneeded?
help@sqlschool.gr
Presentation
Content
 Live Query Statistics
 Query Store
Live Query Statistics
 Let’s lay the basis
 Say hello world to Query Optimizer!
 High-level bits of the engine running, under the hood of SQL Server
 Procedure Cache
 Buffer Pool
 Execution Plans
 Live Query Statistics (LQS)
 Definition and aim
 When and why
 Meanwhile, behind the scenes…
 Limitations and permissions
 Demo
 Summary
 Say hello world to Query Optimizer!
The Query Optimizer of SQL Server is a cost-based optimizer. Its work is to
analyze candidate execution plans, and based on the cost each one produce, to
choose the one with lowest estimated cost. It is part of the Query Processor which
one of the two main components of the Relational Engine of SQL Server, with the
other one being the Storage Engine.
LQS: Let’s lay the basis
 Say hello world to Query Optimizer! (cont.)
….This means that this tiny part of the engine holds a gigantic affect on the
performance of your instance!
So keep it happy and feed it regularly! With what??
Statistics of course!
LQS: Let’s lay the basis
When the Jr. DBA tells me he fixed the parameter sniffing issue by setting up a
job to update statistics every 2 hours. (HT @SQLsoldier)
Bonus slide!
 High-level bits of the engine running under the hood
 Procedure cache
A place in memory, where all your execution plans reside. Well, at least one for
each query.
To clear the plan cache use: DBCC FREEPROCCACHE
Governed by the Query Processor.
 Buffer pool
A place in memory, also, where the cached data resides, and is first checked before
hitting on the disk and producing physical I/O.
To clear the buffer pool use: DBCC DROPCLEANBUFFERS
Governed by the Storage Engine.
LQS: Let’s lay the basis
 High-level bits of the engine running under the hood (cont.)
 Execution Plans
Two kinds of executions plans: Estimated and Actual
Even in Actual plans, exists estimate numbers based on …statistics 
Tip: Try not to have the following iterator: lookup, hash, sort, spool, nested (serial) loop and
scans …maybe.
LQS: Let’s lay the basis
Live Query Statistics, are a brand new feature of the latest
SQL Server Management Studio namely “2016”, which
allows you to witness the live execution of the plan chosen
by the Query Optimizer for the running query!
Sounds awesome, right? …right!
LQS: Definition and aim
Warning! This feature is primarily intended for troubleshooting purposes. Using this feature can moderately slow the overall query performance.
You’ve been warned! 
So, LQS is great for troubleshooting and debugging mainly long running queries or queries
that are never ending or overflowing the poor old-tempdb! Timeout issues could be also a
thingy to investigate with QLS.
…or it you could just run it because you like to see data flow around from operator to
operator and fancy yourself as the almighty “data whisperer”.
LQS: When, Why, How
LQS: When, Why, How (cont.)
 Can be activated in one of 3 ways:
Tada…. enters sys.dm_exec_query_profiles DMV!
So, what we see as Live Query Statistics is a very nice and visual interpretation of the
sys.dm_exec_query_profiles DMV
Nonetheless you gotta love the easiness it provides for quick execution insight!
Just love it! Debug-debug-debug! New tools under your belt! Use them wisely!
LQS: Meanwhile, behindthe scenes…
LQS: Meanwhile, behindthe scenes…
 Limitations
 The live windows will not show up if the query:
 is using column store indexes
 Is using memory optimized tables
 Native Stored Procedures are not supported
 The good thing is that you can utilize it from SQL Server 2014 SP1 and onwards by
installing the latest SSMS, which now is not included in the initial setup of SQL
Server.
 Permissions
 Requires the database level SHOWPLAN permission to populate the Live Query
Statistics results page, the server level VIEW SERVER STATE permission to see the
live statistics, and requires any permissions necessary to execute the query.
Live Query Statistics in Action
Live Query Statistics
 View CPU/memory usage, execution time, query progress, and more
 Enables rapid identification of potential bottlenecks for troubleshooting
query performance issues
 Allows drill down to live
operator level statistics
 Number of generated rows
 Elapsed time
 Operator progress
 Live warnings
LQS: Summary
Query Store
 Definition and aim
 Architecture-wise where does it stand?
 How QS collects data
 Upgrading to SQL 2016
 Ways to manage and monitor QS
 Best practices
 Demo
 Summary
“The SQL Server Query Store feature provides you with insight on query plan
choice and performance.
It simplifies performance troubleshooting by helping you quickly find performance
differences caused by query plan changes.
Query Store automatically captures a history of queries, plans, and runtime
statistics, and retains these for your review.
It separates data by time windows so you can see database usage patterns and
understand when query plan changes happened on the server.”
Query Store: Definition and aim
With the power vested to you by the Query Store you, the
DBA, are in control now!
 Dedicated store for query workload performance data
 Captures the history of plans for each query
 Captures the performance of each plan over time
 Persists the data to disk (works across restarts, upgrades, and recompiles)
 Significantly reduces TTD/TTM
 Find regressions and other issues in seconds
 Allows you to force previous plans from history
Query Store: Definition and aim (cont.)
Remember this?
Query Store: Architecture-wise where does it stand?
…now Query Store enabled! 
Query Store: Architecture-wise where does it stand?
Query Store works as a flight data recorder. The information is stored in tables and the
following views are used to display the info to the users:
Query Store: How QS collects data (Part 1/5)
Exposed views
Query
text
Query Plan
Runtime
stats
Context
settings
Runtime
stats
interval
One row per query text per plan
affecting option
(example: ANSI NULLS on/off)
One row per
plan (for
each query)
One row per plan
per time interval
(example: 5 min)
1 - n
Compile stats:
query_store_query_text
query_context_settings
query_store_query
query_store_plan
Runtime stats:
query_store_runtime_stats_interval
query_store_runtime_stats
sys.
Internal tables
1 - n
.
Query Store: How QS collects data (Part 2/5)
What happens after you hit “F5”… or you know what I mean.
Nuts and bolts of QS continues…
Query Store: How QS collects data (Part 3/5)
Nuts and bolts of QS continues…
Query Store write architecture
Query Store: How QS collects data (Part 4/5)
Query Store
Query
Execution
Internal
tables
Query and
Plan Store
Runtime stats
store
Query exec. stats
Compile
Execute
async
Query text and plan
Nuts and bolts of QS continues…
Query Store read architecture
Query Store: How QS collects data (Part 5/5)
Query StoreQuery Execution
Internal
tables
Query and
Plan Store
Runtime stats
store
Query exec. stats
Compile
Execute
async
Query text and plan
Query Store views
Keeping stability while upgrading to SQL Sever 2016
Query Store: Upgrading to SQL 2016
Install bits
Keep existing
compat. level
Run Query Store
(create a
baseline)
Move to vNext
CompatLevel
Fix
regressions
with plan
forcing
 Enable/disable Query Store
ALTER DATABASE <database_name> SET QUERY_STORE = {ON|OFF};
 Is Query Store currently active?
SELECT actual_state, actual_state_desc, readonly_reason,
current_storage_size_mb, max_storage_size_mb
FROM sys.database_query_store_options;
 Get Query Store options
SELECT * FROM sys.database_query_store_options;
 Set all Query Store options
ALTER DATABASE <database name>
SET QUERY_STORE (
OPERATION_MODE = READ_WRITE,
CLEANUP_POLICY =
(STALE_QUERY_THRESHOLD_DAYS = 30),
DATA_FLUSH_INTERVAL_SECONDS = 3000,
MAX_STORAGE_SIZE_MB = 500,
INTERVAL_LENGTH_MINUTES = 15,
SIZE_BASED_CLEANUP_MODE = AUTO,
QUERY_CAPTURE_MODE = AUTO,
MAX_PLANS_PER_QUERY = 1000
);
LQS: Ways to manage and monitor QS
 Use the latest SSMS
 Use Query Performance Insight in Azure SQL Databases
 Using Query Store with Elastic Pool Databases
 Keep Query Store adjusted to your workload
 How to start with query performance troubleshooting
 Verify Query Store is collecting data continuously
 Set the optimal Query Capture Mode
 Check the status of Forced Plans regularly
 Avoid renaming databases if you have plans forced
 Keep the Most Relevant Data in Query Store
Query Store: Best practices
Query Store in Action
 Capability
 Query Store helps customers quickly find and fix query performance issues
 Query Store is a ‘flight data recorder’ for database workloads
 Benefits
 Greatly simplifies query performance troubleshooting
 Provides performance stability across SQL Server upgrades
 Allows deeper insight into workload performance
Query Store: Summary
Apart from my passion for SQL, other sources
were used to make this presentation a reality:
 MSDN
 TechNet
 BOL
 Many blogs from around the web
…and of course our very own sqlschool.gr 
S E L E C T K N O W L E D G E F R O M S Q L S E R V E R
Copyright © 2015 SQLschool.gr. All right reserved.
PRESENTER MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION

Contenu connexe

Tendances

Query Store and live Query Statistics
Query Store and live Query StatisticsQuery Store and live Query Statistics
Query Store and live Query StatisticsSolidQ
 
SQL Server 2016: Just a Few of Our DBA's Favorite Things
SQL Server 2016: Just a Few of Our DBA's Favorite ThingsSQL Server 2016: Just a Few of Our DBA's Favorite Things
SQL Server 2016: Just a Few of Our DBA's Favorite ThingsHostway|HOSTING
 
Microsoft SQL Server 2016 - Everything Built In
Microsoft SQL Server 2016 - Everything Built InMicrosoft SQL Server 2016 - Everything Built In
Microsoft SQL Server 2016 - Everything Built InDavid J Rosenthal
 
Dynamic data masking sql server 2016
Dynamic data masking sql server 2016Dynamic data masking sql server 2016
Dynamic data masking sql server 2016Antonios Chatzipavlis
 
SQL Server 2016 Editions
SQL Server 2016 Editions SQL Server 2016 Editions
SQL Server 2016 Editions Onomi
 
Introduction to Machine Learning on Azure
Introduction to Machine Learning on AzureIntroduction to Machine Learning on Azure
Introduction to Machine Learning on AzureAntonios Chatzipavlis
 
SQL server 2016 New Features
SQL server 2016 New FeaturesSQL server 2016 New Features
SQL server 2016 New Featuresaminmesbahi
 
Everything you need to know about SQL Server 2016
Everything you need to know about SQL Server 2016Everything you need to know about SQL Server 2016
Everything you need to know about SQL Server 2016Softchoice Corporation
 
Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018
Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018 Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018
Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018 Antonios Chatzipavlis
 
SQL Server 2016 New Features and Enhancements
SQL Server 2016 New Features and EnhancementsSQL Server 2016 New Features and Enhancements
SQL Server 2016 New Features and EnhancementsJohn Martin
 
Using extended events for troubleshooting sql server
Using extended events for troubleshooting sql serverUsing extended events for troubleshooting sql server
Using extended events for troubleshooting sql serverAntonios Chatzipavlis
 
What's new in SQL Server 2016
What's new in SQL Server 2016What's new in SQL Server 2016
What's new in SQL Server 2016Onomi
 
SQL Server 2016 novelties
SQL Server 2016 noveltiesSQL Server 2016 novelties
SQL Server 2016 noveltiesMSDEVMTL
 
SQL Server 2016 new features
SQL Server 2016 new featuresSQL Server 2016 new features
SQL Server 2016 new featuresSpanishPASSVC
 
Azure SQL Database Introduction by Tim Radney
Azure SQL Database Introduction by Tim RadneyAzure SQL Database Introduction by Tim Radney
Azure SQL Database Introduction by Tim RadneyHasan Savran
 
PASS VC: SQL Server Performance Monitoring and Baselining
PASS VC: SQL Server Performance Monitoring and BaseliningPASS VC: SQL Server Performance Monitoring and Baselining
PASS VC: SQL Server Performance Monitoring and BaseliningPARIKSHIT SAVJANI
 

Tendances (20)

Query Store and live Query Statistics
Query Store and live Query StatisticsQuery Store and live Query Statistics
Query Store and live Query Statistics
 
SQL Server 2016: Just a Few of Our DBA's Favorite Things
SQL Server 2016: Just a Few of Our DBA's Favorite ThingsSQL Server 2016: Just a Few of Our DBA's Favorite Things
SQL Server 2016: Just a Few of Our DBA's Favorite Things
 
Microsoft SQL Server 2016 - Everything Built In
Microsoft SQL Server 2016 - Everything Built InMicrosoft SQL Server 2016 - Everything Built In
Microsoft SQL Server 2016 - Everything Built In
 
Dynamic data masking sql server 2016
Dynamic data masking sql server 2016Dynamic data masking sql server 2016
Dynamic data masking sql server 2016
 
SQL Server 2016 BI updates
SQL Server 2016 BI updatesSQL Server 2016 BI updates
SQL Server 2016 BI updates
 
SQL Server 2016 Editions
SQL Server 2016 Editions SQL Server 2016 Editions
SQL Server 2016 Editions
 
Introduction to Machine Learning on Azure
Introduction to Machine Learning on AzureIntroduction to Machine Learning on Azure
Introduction to Machine Learning on Azure
 
SQL server 2016 New Features
SQL server 2016 New FeaturesSQL server 2016 New Features
SQL server 2016 New Features
 
Everything you need to know about SQL Server 2016
Everything you need to know about SQL Server 2016Everything you need to know about SQL Server 2016
Everything you need to know about SQL Server 2016
 
Troubleshooting sql server
Troubleshooting sql serverTroubleshooting sql server
Troubleshooting sql server
 
Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018
Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018 Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018
Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018
 
SQL Server 2016 New Features and Enhancements
SQL Server 2016 New Features and EnhancementsSQL Server 2016 New Features and Enhancements
SQL Server 2016 New Features and Enhancements
 
Using extended events for troubleshooting sql server
Using extended events for troubleshooting sql serverUsing extended events for troubleshooting sql server
Using extended events for troubleshooting sql server
 
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
 
Auditing Data Access in SQL Server
Auditing Data Access in SQL ServerAuditing Data Access in SQL Server
Auditing Data Access in SQL Server
 
What's new in SQL Server 2016
What's new in SQL Server 2016What's new in SQL Server 2016
What's new in SQL Server 2016
 
SQL Server 2016 novelties
SQL Server 2016 noveltiesSQL Server 2016 novelties
SQL Server 2016 novelties
 
SQL Server 2016 new features
SQL Server 2016 new featuresSQL Server 2016 new features
SQL Server 2016 new features
 
Azure SQL Database Introduction by Tim Radney
Azure SQL Database Introduction by Tim RadneyAzure SQL Database Introduction by Tim Radney
Azure SQL Database Introduction by Tim Radney
 
PASS VC: SQL Server Performance Monitoring and Baselining
PASS VC: SQL Server Performance Monitoring and BaseliningPASS VC: SQL Server Performance Monitoring and Baselining
PASS VC: SQL Server Performance Monitoring and Baselining
 

Similaire à Live Query Statistics & Query Store in SQL Server 2016

05_DP_300T00A_Optimize.pptx
05_DP_300T00A_Optimize.pptx05_DP_300T00A_Optimize.pptx
05_DP_300T00A_Optimize.pptxKareemBullard1
 
Novidades do SQL Server 2016
Novidades do SQL Server 2016Novidades do SQL Server 2016
Novidades do SQL Server 2016Marcos Freccia
 
Expert summit SQL Server 2016
Expert summit   SQL Server 2016Expert summit   SQL Server 2016
Expert summit SQL Server 2016Łukasz Grala
 
Oracle Sql Tuning
Oracle Sql TuningOracle Sql Tuning
Oracle Sql TuningChris Adkin
 
Managing SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBAManaging SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBAConcentrated Technology
 
SQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginners
SQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginnersSQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginners
SQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginnersTobias Koprowski
 
Whatsnew in-my sql-primary
Whatsnew in-my sql-primaryWhatsnew in-my sql-primary
Whatsnew in-my sql-primaryKaizenlogcom
 
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
 
Advance Sql Server Store procedure Presentation
Advance Sql Server Store procedure PresentationAdvance Sql Server Store procedure Presentation
Advance Sql Server Store procedure PresentationAmin Uddin
 
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Aaron Shilo
 
Modernizing your database with SQL Server 2019
Modernizing your database with SQL Server 2019Modernizing your database with SQL Server 2019
Modernizing your database with SQL Server 2019Antonios Chatzipavlis
 
שבוע אורקל 2016
שבוע אורקל 2016שבוע אורקל 2016
שבוע אורקל 2016Aaron Shilo
 
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginnersKoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginnersTobias Koprowski
 
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginnersKoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginnersTobias Koprowski
 
What is SQL Server 2019 Standard Edition
What is SQL Server 2019 Standard EditionWhat is SQL Server 2019 Standard Edition
What is SQL Server 2019 Standard EditionSoftwareDeals
 
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
 
How should I monitor my idaa
How should I monitor my idaaHow should I monitor my idaa
How should I monitor my idaaCuneyt Goksu
 
Enhancements that will make your sql database roar sp1 edition sql bits 2017
Enhancements that will make your sql database roar sp1 edition sql bits 2017Enhancements that will make your sql database roar sp1 edition sql bits 2017
Enhancements that will make your sql database roar sp1 edition sql bits 2017Bob Ward
 
Columnstore improvements in SQL Server 2016
Columnstore improvements in SQL Server 2016Columnstore improvements in SQL Server 2016
Columnstore improvements in SQL Server 2016Niko Neugebauer
 

Similaire à Live Query Statistics & Query Store in SQL Server 2016 (20)

05_DP_300T00A_Optimize.pptx
05_DP_300T00A_Optimize.pptx05_DP_300T00A_Optimize.pptx
05_DP_300T00A_Optimize.pptx
 
Novidades do SQL Server 2016
Novidades do SQL Server 2016Novidades do SQL Server 2016
Novidades do SQL Server 2016
 
Expert summit SQL Server 2016
Expert summit   SQL Server 2016Expert summit   SQL Server 2016
Expert summit SQL Server 2016
 
Oracle Sql Tuning
Oracle Sql TuningOracle Sql Tuning
Oracle Sql Tuning
 
Managing SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBAManaging SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBA
 
Sherlock holmes for dba’s
Sherlock holmes for dba’sSherlock holmes for dba’s
Sherlock holmes for dba’s
 
SQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginners
SQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginnersSQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginners
SQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginners
 
Whatsnew in-my sql-primary
Whatsnew in-my sql-primaryWhatsnew in-my sql-primary
Whatsnew in-my sql-primary
 
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
 
Advance Sql Server Store procedure Presentation
Advance Sql Server Store procedure PresentationAdvance Sql Server Store procedure Presentation
Advance Sql Server Store procedure Presentation
 
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
 
Modernizing your database with SQL Server 2019
Modernizing your database with SQL Server 2019Modernizing your database with SQL Server 2019
Modernizing your database with SQL Server 2019
 
שבוע אורקל 2016
שבוע אורקל 2016שבוע אורקל 2016
שבוע אורקל 2016
 
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginnersKoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
 
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginnersKoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
 
What is SQL Server 2019 Standard Edition
What is SQL Server 2019 Standard EditionWhat is SQL Server 2019 Standard Edition
What is SQL Server 2019 Standard Edition
 
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
 
How should I monitor my idaa
How should I monitor my idaaHow should I monitor my idaa
How should I monitor my idaa
 
Enhancements that will make your sql database roar sp1 edition sql bits 2017
Enhancements that will make your sql database roar sp1 edition sql bits 2017Enhancements that will make your sql database roar sp1 edition sql bits 2017
Enhancements that will make your sql database roar sp1 edition sql bits 2017
 
Columnstore improvements in SQL Server 2016
Columnstore improvements in SQL Server 2016Columnstore improvements in SQL Server 2016
Columnstore improvements in SQL Server 2016
 

Plus de Antonios Chatzipavlis

Workload Management in SQL Server 2019
Workload Management in SQL Server 2019Workload Management in SQL Server 2019
Workload Management in SQL Server 2019Antonios Chatzipavlis
 
Loading Data into Azure SQL DW (Synapse Analytics)
Loading Data into Azure SQL DW (Synapse Analytics)Loading Data into Azure SQL DW (Synapse Analytics)
Loading Data into Azure SQL DW (Synapse Analytics)Antonios Chatzipavlis
 
Building diagnostic queries using DMVs and DMFs
Building diagnostic queries using DMVs and DMFs Building diagnostic queries using DMVs and DMFs
Building diagnostic queries using DMVs and DMFs Antonios Chatzipavlis
 
Designing a modern data warehouse in azure
Designing a modern data warehouse in azure   Designing a modern data warehouse in azure
Designing a modern data warehouse in azure Antonios Chatzipavlis
 
Designing a modern data warehouse in azure
Designing a modern data warehouse in azure   Designing a modern data warehouse in azure
Designing a modern data warehouse in azure Antonios Chatzipavlis
 

Plus de Antonios Chatzipavlis (19)

Data virtualization using polybase
Data virtualization using polybaseData virtualization using polybase
Data virtualization using polybase
 
SQL server Backup Restore Revealed
SQL server Backup Restore RevealedSQL server Backup Restore Revealed
SQL server Backup Restore Revealed
 
Migrate SQL Workloads to Azure
Migrate SQL Workloads to AzureMigrate SQL Workloads to Azure
Migrate SQL Workloads to Azure
 
Machine Learning in SQL Server 2019
Machine Learning in SQL Server 2019Machine Learning in SQL Server 2019
Machine Learning in SQL Server 2019
 
Workload Management in SQL Server 2019
Workload Management in SQL Server 2019Workload Management in SQL Server 2019
Workload Management in SQL Server 2019
 
Loading Data into Azure SQL DW (Synapse Analytics)
Loading Data into Azure SQL DW (Synapse Analytics)Loading Data into Azure SQL DW (Synapse Analytics)
Loading Data into Azure SQL DW (Synapse Analytics)
 
Introduction to DAX Language
Introduction to DAX LanguageIntroduction to DAX Language
Introduction to DAX Language
 
Building diagnostic queries using DMVs and DMFs
Building diagnostic queries using DMVs and DMFs Building diagnostic queries using DMVs and DMFs
Building diagnostic queries using DMVs and DMFs
 
Exploring T-SQL Anti-Patterns
Exploring T-SQL Anti-Patterns Exploring T-SQL Anti-Patterns
Exploring T-SQL Anti-Patterns
 
Designing a modern data warehouse in azure
Designing a modern data warehouse in azure   Designing a modern data warehouse in azure
Designing a modern data warehouse in azure
 
Designing a modern data warehouse in azure
Designing a modern data warehouse in azure   Designing a modern data warehouse in azure
Designing a modern data warehouse in azure
 
SQLServer Database Structures
SQLServer Database Structures SQLServer Database Structures
SQLServer Database Structures
 
Sqlschool 2017 recap - 2018 plans
Sqlschool 2017 recap - 2018 plansSqlschool 2017 recap - 2018 plans
Sqlschool 2017 recap - 2018 plans
 
Statistics and Indexes Internals
Statistics and Indexes InternalsStatistics and Indexes Internals
Statistics and Indexes Internals
 
Introduction to Azure Data Lake
Introduction to Azure Data LakeIntroduction to Azure Data Lake
Introduction to Azure Data Lake
 
Azure SQL Data Warehouse
Azure SQL Data Warehouse Azure SQL Data Warehouse
Azure SQL Data Warehouse
 
Introduction to azure document db
Introduction to azure document dbIntroduction to azure document db
Introduction to azure document db
 
Exploring sql server 2016 bi
Exploring sql server 2016 biExploring sql server 2016 bi
Exploring sql server 2016 bi
 
Exploring sql server 2016
Exploring sql server 2016Exploring sql server 2016
Exploring sql server 2016
 

Dernier

Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Kings of Saudi Arabia, information about them
Kings of Saudi Arabia, information about themKings of Saudi Arabia, information about them
Kings of Saudi Arabia, information about themeitharjee
 
Gartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxGartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxchadhar227
 
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...gajnagarg
 
20240412-SmartCityIndex-2024-Full-Report.pdf
20240412-SmartCityIndex-2024-Full-Report.pdf20240412-SmartCityIndex-2024-Full-Report.pdf
20240412-SmartCityIndex-2024-Full-Report.pdfkhraisr
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Researchmichael115558
 
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...nirzagarg
 
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...nirzagarg
 
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24  Building Real-Time Pipelines With FLaNKDATA SUMMIT 24  Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNKTimothy Spann
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Valters Lauzums
 
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...nirzagarg
 
Ranking and Scoring Exercises for Research
Ranking and Scoring Exercises for ResearchRanking and Scoring Exercises for Research
Ranking and Scoring Exercises for ResearchRajesh Mondal
 
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...nirzagarg
 
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...Bertram Ludäscher
 
TrafficWave Generator Will Instantly drive targeted and engaging traffic back...
TrafficWave Generator Will Instantly drive targeted and engaging traffic back...TrafficWave Generator Will Instantly drive targeted and engaging traffic back...
TrafficWave Generator Will Instantly drive targeted and engaging traffic back...SOFTTECHHUB
 
Top Call Girls in Balaghat 9332606886Call Girls Advance Cash On Delivery Ser...
Top Call Girls in Balaghat  9332606886Call Girls Advance Cash On Delivery Ser...Top Call Girls in Balaghat  9332606886Call Girls Advance Cash On Delivery Ser...
Top Call Girls in Balaghat 9332606886Call Girls Advance Cash On Delivery Ser...kumargunjan9515
 
Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...
Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...
Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...HyderabadDolls
 
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...nirzagarg
 
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...HyderabadDolls
 
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book nowVadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book nowgargpaaro
 

Dernier (20)

Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Kings of Saudi Arabia, information about them
Kings of Saudi Arabia, information about themKings of Saudi Arabia, information about them
Kings of Saudi Arabia, information about them
 
Gartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxGartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptx
 
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
 
20240412-SmartCityIndex-2024-Full-Report.pdf
20240412-SmartCityIndex-2024-Full-Report.pdf20240412-SmartCityIndex-2024-Full-Report.pdf
20240412-SmartCityIndex-2024-Full-Report.pdf
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
 
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
 
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
 
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24  Building Real-Time Pipelines With FLaNKDATA SUMMIT 24  Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
 
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
 
Ranking and Scoring Exercises for Research
Ranking and Scoring Exercises for ResearchRanking and Scoring Exercises for Research
Ranking and Scoring Exercises for Research
 
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
 
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
 
TrafficWave Generator Will Instantly drive targeted and engaging traffic back...
TrafficWave Generator Will Instantly drive targeted and engaging traffic back...TrafficWave Generator Will Instantly drive targeted and engaging traffic back...
TrafficWave Generator Will Instantly drive targeted and engaging traffic back...
 
Top Call Girls in Balaghat 9332606886Call Girls Advance Cash On Delivery Ser...
Top Call Girls in Balaghat  9332606886Call Girls Advance Cash On Delivery Ser...Top Call Girls in Balaghat  9332606886Call Girls Advance Cash On Delivery Ser...
Top Call Girls in Balaghat 9332606886Call Girls Advance Cash On Delivery Ser...
 
Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...
Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...
Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...
 
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
 
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
 
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book nowVadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
 

Live Query Statistics & Query Store in SQL Server 2016

  • 1.
  • 2. SQL Server 2016 Live Query Statistics & Query Store
  • 3. PresenterInfo 1976 Born. The world is now a safer place to be :P 1987 My first computer was a Sinclair ZX Spectrum 1995 I started my professional career in computers industry as an all-around-all-weather IT-guy while studying. Later that year I got introduced to SQL Server 6.5 2000 . . . Microsoft Certified Professional and MCT on 2005. Staff happening… I got older and wiser while still educating myself on SQL Server and other staff that made me what I am today 2007 I became father to a wonderful boy!  . . . Staff happening… 2016 Here we are now looking at me saying about myself (recursion-alert) Vassilis IOANNIDIS a.k.a. “Bull” SQL Server Geek MCT, MCSD, MCDBA, MCSA, MCTS, MCPS
  • 4. SQLschool.gr Team Antonios Chatzipavlis SQL Server Evangelist • Trainer Vassilis Ioannidis SQL Server Expert • Trainer Fivi Panopoulou System Engineer • Speaker Sotiris Karras System Engineer • Speaker
  • 7. Presentation Content  Live Query Statistics  Query Store
  • 8. Live Query Statistics  Let’s lay the basis  Say hello world to Query Optimizer!  High-level bits of the engine running, under the hood of SQL Server  Procedure Cache  Buffer Pool  Execution Plans  Live Query Statistics (LQS)  Definition and aim  When and why  Meanwhile, behind the scenes…  Limitations and permissions  Demo  Summary
  • 9.  Say hello world to Query Optimizer! The Query Optimizer of SQL Server is a cost-based optimizer. Its work is to analyze candidate execution plans, and based on the cost each one produce, to choose the one with lowest estimated cost. It is part of the Query Processor which one of the two main components of the Relational Engine of SQL Server, with the other one being the Storage Engine. LQS: Let’s lay the basis
  • 10.  Say hello world to Query Optimizer! (cont.) ….This means that this tiny part of the engine holds a gigantic affect on the performance of your instance! So keep it happy and feed it regularly! With what?? Statistics of course! LQS: Let’s lay the basis
  • 11. When the Jr. DBA tells me he fixed the parameter sniffing issue by setting up a job to update statistics every 2 hours. (HT @SQLsoldier) Bonus slide!
  • 12.  High-level bits of the engine running under the hood  Procedure cache A place in memory, where all your execution plans reside. Well, at least one for each query. To clear the plan cache use: DBCC FREEPROCCACHE Governed by the Query Processor.  Buffer pool A place in memory, also, where the cached data resides, and is first checked before hitting on the disk and producing physical I/O. To clear the buffer pool use: DBCC DROPCLEANBUFFERS Governed by the Storage Engine. LQS: Let’s lay the basis
  • 13.  High-level bits of the engine running under the hood (cont.)  Execution Plans Two kinds of executions plans: Estimated and Actual Even in Actual plans, exists estimate numbers based on …statistics  Tip: Try not to have the following iterator: lookup, hash, sort, spool, nested (serial) loop and scans …maybe. LQS: Let’s lay the basis
  • 14. Live Query Statistics, are a brand new feature of the latest SQL Server Management Studio namely “2016”, which allows you to witness the live execution of the plan chosen by the Query Optimizer for the running query! Sounds awesome, right? …right! LQS: Definition and aim
  • 15. Warning! This feature is primarily intended for troubleshooting purposes. Using this feature can moderately slow the overall query performance. You’ve been warned!  So, LQS is great for troubleshooting and debugging mainly long running queries or queries that are never ending or overflowing the poor old-tempdb! Timeout issues could be also a thingy to investigate with QLS. …or it you could just run it because you like to see data flow around from operator to operator and fancy yourself as the almighty “data whisperer”. LQS: When, Why, How
  • 16. LQS: When, Why, How (cont.)  Can be activated in one of 3 ways:
  • 17. Tada…. enters sys.dm_exec_query_profiles DMV! So, what we see as Live Query Statistics is a very nice and visual interpretation of the sys.dm_exec_query_profiles DMV Nonetheless you gotta love the easiness it provides for quick execution insight! Just love it! Debug-debug-debug! New tools under your belt! Use them wisely! LQS: Meanwhile, behindthe scenes…
  • 18. LQS: Meanwhile, behindthe scenes…  Limitations  The live windows will not show up if the query:  is using column store indexes  Is using memory optimized tables  Native Stored Procedures are not supported  The good thing is that you can utilize it from SQL Server 2014 SP1 and onwards by installing the latest SSMS, which now is not included in the initial setup of SQL Server.  Permissions  Requires the database level SHOWPLAN permission to populate the Live Query Statistics results page, the server level VIEW SERVER STATE permission to see the live statistics, and requires any permissions necessary to execute the query.
  • 20. Live Query Statistics  View CPU/memory usage, execution time, query progress, and more  Enables rapid identification of potential bottlenecks for troubleshooting query performance issues  Allows drill down to live operator level statistics  Number of generated rows  Elapsed time  Operator progress  Live warnings LQS: Summary
  • 21. Query Store  Definition and aim  Architecture-wise where does it stand?  How QS collects data  Upgrading to SQL 2016  Ways to manage and monitor QS  Best practices  Demo  Summary
  • 22. “The SQL Server Query Store feature provides you with insight on query plan choice and performance. It simplifies performance troubleshooting by helping you quickly find performance differences caused by query plan changes. Query Store automatically captures a history of queries, plans, and runtime statistics, and retains these for your review. It separates data by time windows so you can see database usage patterns and understand when query plan changes happened on the server.” Query Store: Definition and aim
  • 23. With the power vested to you by the Query Store you, the DBA, are in control now!  Dedicated store for query workload performance data  Captures the history of plans for each query  Captures the performance of each plan over time  Persists the data to disk (works across restarts, upgrades, and recompiles)  Significantly reduces TTD/TTM  Find regressions and other issues in seconds  Allows you to force previous plans from history Query Store: Definition and aim (cont.)
  • 24. Remember this? Query Store: Architecture-wise where does it stand?
  • 25. …now Query Store enabled!  Query Store: Architecture-wise where does it stand?
  • 26. Query Store works as a flight data recorder. The information is stored in tables and the following views are used to display the info to the users: Query Store: How QS collects data (Part 1/5) Exposed views Query text Query Plan Runtime stats Context settings Runtime stats interval One row per query text per plan affecting option (example: ANSI NULLS on/off) One row per plan (for each query) One row per plan per time interval (example: 5 min) 1 - n Compile stats: query_store_query_text query_context_settings query_store_query query_store_plan Runtime stats: query_store_runtime_stats_interval query_store_runtime_stats sys. Internal tables 1 - n
  • 27. . Query Store: How QS collects data (Part 2/5) What happens after you hit “F5”… or you know what I mean.
  • 28. Nuts and bolts of QS continues… Query Store: How QS collects data (Part 3/5)
  • 29. Nuts and bolts of QS continues… Query Store write architecture Query Store: How QS collects data (Part 4/5) Query Store Query Execution Internal tables Query and Plan Store Runtime stats store Query exec. stats Compile Execute async Query text and plan
  • 30. Nuts and bolts of QS continues… Query Store read architecture Query Store: How QS collects data (Part 5/5) Query StoreQuery Execution Internal tables Query and Plan Store Runtime stats store Query exec. stats Compile Execute async Query text and plan Query Store views
  • 31. Keeping stability while upgrading to SQL Sever 2016 Query Store: Upgrading to SQL 2016 Install bits Keep existing compat. level Run Query Store (create a baseline) Move to vNext CompatLevel Fix regressions with plan forcing
  • 32.  Enable/disable Query Store ALTER DATABASE <database_name> SET QUERY_STORE = {ON|OFF};  Is Query Store currently active? SELECT actual_state, actual_state_desc, readonly_reason, current_storage_size_mb, max_storage_size_mb FROM sys.database_query_store_options;  Get Query Store options SELECT * FROM sys.database_query_store_options;  Set all Query Store options ALTER DATABASE <database name> SET QUERY_STORE ( OPERATION_MODE = READ_WRITE, CLEANUP_POLICY = (STALE_QUERY_THRESHOLD_DAYS = 30), DATA_FLUSH_INTERVAL_SECONDS = 3000, MAX_STORAGE_SIZE_MB = 500, INTERVAL_LENGTH_MINUTES = 15, SIZE_BASED_CLEANUP_MODE = AUTO, QUERY_CAPTURE_MODE = AUTO, MAX_PLANS_PER_QUERY = 1000 ); LQS: Ways to manage and monitor QS
  • 33.  Use the latest SSMS  Use Query Performance Insight in Azure SQL Databases  Using Query Store with Elastic Pool Databases  Keep Query Store adjusted to your workload  How to start with query performance troubleshooting  Verify Query Store is collecting data continuously  Set the optimal Query Capture Mode  Check the status of Forced Plans regularly  Avoid renaming databases if you have plans forced  Keep the Most Relevant Data in Query Store Query Store: Best practices
  • 34. Query Store in Action
  • 35.  Capability  Query Store helps customers quickly find and fix query performance issues  Query Store is a ‘flight data recorder’ for database workloads  Benefits  Greatly simplifies query performance troubleshooting  Provides performance stability across SQL Server upgrades  Allows deeper insight into workload performance Query Store: Summary
  • 36. Apart from my passion for SQL, other sources were used to make this presentation a reality:  MSDN  TechNet  BOL  Many blogs from around the web …and of course our very own sqlschool.gr 
  • 37.
  • 38.
  • 39. S E L E C T K N O W L E D G E F R O M S Q L S E R V E R Copyright © 2015 SQLschool.gr. All right reserved. PRESENTER MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION