The Query Store, part of Azure SQL Database and SQL Server 2016, changes the way query performance tuning will be done. Learn about this new technology, how it works and how to apply it.
1. Grant Fritchey | www.ScaryDBA.com
www.ScaryDBA.com
The Query Store
and SQL Tuning
Grant Fritchey – Red Gate Software
2. Grant Fritchey | www.ScaryDBA.com
Goal
Understand the information and mechanisms behind the Query Store
Learn how to work with and maintain the Query Store
Discover new opportunities and mechanisms for dealing with query
performance tuning issues
2
3. Grant Fritchey | www.ScaryDBA.com
Get in touch
scarydba.com
grant@scarydba.com
@gfritchey
Grant Fritchey
10. Grant Fritchey | www.ScaryDBA.com
Query Store Lives
10
SQL Server 2016
Azure SQL
Database
2014?
11. Grant Fritchey | www.ScaryDBA.com
You control…
11
Turn it on or Off
Time to flush to disk
Size of storage
Days in storage
Plans per query limit
Automatic cleanup
Capture Mode
Aggregation Interval Length
12. Grant Fritchey | www.ScaryDBA.com 12
Queries • Execution
count
• Duration
• CPU
• Compile
ExecutionPlans
• Estimated
Plan
• More than
one per
query
14. Grant Fritchey | www.ScaryDBA.com
In-Memory OLTP
14
Exactly the same
Except
• Not persisted
• sys.sp_xtp_control_query_exec_stats
• Plan forcing can fail
• No memory grants
• Need to recompile to capture metrics
15. Grant Fritchey | www.ScaryDBA.com
Plan Forcing
15
Plan Store
Runtime
Statistics
Query
Optimization
Process
Async
Query
Execution
Async
Plan forcing
16. Grant Fritchey | www.ScaryDBA.com
Goal
Understand the information and mechanisms behind the Query Store
Learn how to work with and maintain the Query Store
Discover new opportunities and mechanisms for dealing with query
performance tuning issues
16
17. Grant Fritchey | www.ScaryDBA.com
Get in touch
scarydba.com
grant@scarydba.com
@gfritchey
Grant Fritchey