Improve query performance with the new SQL Server 2016 Query Store!!



Similar documents
W I S E. SQL Server 2012 Database Engine Technical Update WISE LTD.

Microsoft SQL Server: MS Performance Tuning and Optimization Digital

SQL Server Performance Tuning and Optimization

This presentation is an introduction to the SQL Server Profiler tool.

$99.95 per user. SQL Server 2008/R2 Database Administration CourseId: 157 Skill level: Run Time: 47+ hours (272 videos)

SQL Server 2016 Query Store

Database Administrator Certificate Capstone Project Evaluation Checklist

SQL Sentry Essentials

SQL Server 2012 Optimization, Performance Tuning and Troubleshooting

PRODUCT OVERVIEW SUITE DEALS. Combine our award-winning products for complete performance monitoring and optimization, and cost effective solutions.

The Complete Performance Solution for Microsoft SQL Server

Resource Governor, Monitoring and Tracing. On SQL Server

Introduction. Part I: Finding Bottlenecks when Something s Wrong. Chapter 1: Performance Tuning 3

Mind Q Systems Private Limited

6231B: Maintaining a Microsoft SQL Server 2008 R2 Database

SQL Server 2012 Database Administration With AlwaysOn & Clustering Techniques

Microsoft SQL Server 2012 Administration

Solving Performance Problems In SQL Server by Michal Tinthofer

NUTECH COMPUTER TRAINING INSTITUTE 1682 E. GUDE DRIVE #102, ROCKVILLE, MD WEB: TEL:

MOC 20462C: Administering Microsoft SQL Server Databases

Understanding SQL Server Execution Plans. Klaus Aschenbrenner Independent SQL Server Consultant SQLpassion.at

WW TSS-02\03 MS SQL Server Extended Performance & Tuning

Database Maintenance Guide

SQL SERVER FREE TOOLS

Course 55144: SQL Server 2014 Performance Tuning and Optimization

Performance Tuning and Optimizing SQL Databases 2016

Server 2008 SQL. Administration in Action ROD COLLEDGE MANNING. Greenwich. (74 w. long.)

"Charting the Course... MOC AC SQL Server 2014 Performance Tuning and Optimization. Course Summary

MS SQL Server 2014 New Features and Database Administration

Infor LN Performance, Tracing, and Tuning Guide for SQL Server

SQL Server 2008 Designing, Optimizing, and Maintaining a Database Session 1

ADMINISTERING MICROSOFT SQL SERVER DATABASES

SQL Server 2012 Performance White Paper

SQL Server Developer Training Program. Topics Covered

Azure VM Performance Considerations Running SQL Server

Upgrading Your SQL Server 2000 Database Administration (DBA) Skills to SQL Server 2008 DBA Skills Course 6317A: Three days; Instructor-Led

Oracle Database 12c: Performance Management and Tuning NEW

PERFORMANCE TUNING IN MICROSOFT SQL SERVER DBMS

SQL Server 2008 Administration

The Database is Slow

Microsoft SQL Server 2008 Step by Step

Only for Data Group Students Do not share with outsiders and do not use for commercial purposes.

How To Improve Performance In A Database

SQL Server 2014 Performance Tuning and Optimization 55144; 5 Days; Instructor-led

One of the database administrators

Monitor and Manage Your MicroStrategy BI Environment Using Enterprise Manager and Health Center

SQL Server. DMVs in Action. Better Queries with. Dynamic Management Views MANNING IANW. STIRK. Shelter Island

Administering Microsoft SQL Server Databases

Administering Microsoft SQL Server Databases

ILMT Central Team. Performance tuning. IBM License Metric Tool 9.0 Questions & Answers IBM Corporation

MS SQL Performance (Tuning) Best Practices:

2015 OSIsoft TechCon. Optimizing SQL Queries for Performance using PI OLEDB Enterprise

Administering Microsoft SQL Server Databases

Case Study - I. Industry: Social Networking Website Technology : J2EE AJAX, Spring, MySQL, Weblogic, Windows Server 2008.

Extending Your Use of Extended Events

Explain how to prepare the hardware and other resources necessary to install SQL Server. Install SQL Server. Manage and configure SQL Server.

DBA 101: Best Practices All DBAs Should Follow

Administering Microsoft SQL Server Databases 20462C; 5 days

Microsoft SQL Server performance tuning for Microsoft Dynamics NAV

FAQ: HPA-SQL FOR DB2 MAY

PERFORMANCE TESTING. New Batches Info. We are ready to serve Latest Testing Trends, Are you ready to learn.?? START DATE : TIMINGS : DURATION :

Microsoft SQL Server OLTP Best Practice

Response Time Analysis

Response Time Analysis

$99.95 per user. SQL Server 2005 Database Administration CourseId: 152 Skill level: Run Time: 30+ hours (158 videos)

Course 20462C: Administering Microsoft SQL Server Databases

DB Audit Expert 3.1. Performance Auditing Add-on Version 1.1 for Microsoft SQL Server 2000 & 2005

VirtualCenter Database Performance for Microsoft SQL Server 2005 VirtualCenter 2.5

What Is Specific in Load Testing?

PTC System Monitor Solution Training

W I S E. SQL Server 2008/2008 R2 Advanced DBA Performance & WISE LTD.

PATROL From a Database Administrator s Perspective

Course: Administering Microsoft SQL Server Databases Overview

Administering Microsoft SQL Server Databases

Administering Microsoft SQL Server 2012 Databases

Maintaining a Microsoft SQL Server 2008 Database

Query Performance Tuning: Start to Finish. Grant Fritchey

Dynamics NAV/SQL Server Configuration Recommendations

Monitoring applications in multitier environment. Uroš Majcen A New View on Application Management.

SQL Server Introduction to SQL Server SQL Server 2005 basic tools. SQL Server Configuration Manager. SQL Server services management

Who is my SAP HANA DBA? What can I expect from her/him? HANA DBA Role & Responsibility. Rajesh Gupta, Deloitte. Consulting September 24, 2015

SAP HANA SPS 09 - What s New? Administration & Monitoring

SQL DBA Bundle. Data Sheet. Data Sheet. Introduction. What does it cost. What s included in the SQL DBA Bundle. Feedback for the SQL DBA Bundle

20462C: Administering Microsoft SQL Server Databases

Exam : Upgrade: Transition Your MCITP SQL Server 2005 DBA to MCITP SQL Server Title : Version : Demo

20462 Administering Microsoft SQL Server Databases

Below are the some of the new features of SQL Server that has been discussed in this course

Visual Studio Team Edition for Database Professionals. Woody Pewitt Developer Evangelist

AV-005: Administering and Implementing a Data Warehouse with SQL Server 2014

SQLintersection SQL123

Professional SQL Server 2012 Internals and Troubleshooting

MS SQL Server 2000 Data Collector. Status: 12/8/2008

Before attending this course, participants should have:

ITG Software Engineering

Informatica Corporation Proactive Monitoring for PowerCenter Operations Version 3.0 Release Notes May 2014

ImageNow for Microsoft SQL Server

Transcription:

Improve query performance with the new SQL Server 2016 Query Store!! Mon, Feb 29 2016 15:00 UTC מיכל גוטצייט Michelle (Michal) Gutzait MCITP, Principal SQL Server Consultant The Pythian Group gutzait@pythian.com

בעברית... 2

T-SQL performance analysis and tuning Something is broken DB is too slow Timeouts Application crashes Weird behavior

The approach Where to start? Which tools to use? How to identify heavy T-SQL?

Tools SQL Server SQL Server Profiler & SQL Traces ReadTrace (RML utility) command line SQL Server Management Studio Sp_who2 and Dbcc inputbuffer (<spid>) Scripts

Tools SQL Server (2) Database Engine Tuning Advisor DMVs and statistics SQL Server Activity Monitor

Tools SQL Server (3) Performance monitor And Data Collectors SQLDiag and SQL Nexus

Tools SQL Server (4) Performance Dashboard Performance Analysis of Logs (PAL)

3-rd party tools

Retroactive T-SQL analysis before SQL Server 2016

Dynamic Management Views (DMVs) Cleared up from Cache when: Manually SQL Server is restarted Statistics are updated Memory pressure

Example DMV - sys.dm_exec_query_plan Execution plans Query plans for cached batches or are currently executing No versioning No history

To get the correct Execution Plan The solution include: T-SQL code re-write Example: use #tmp Query hints Plan guides Statistics Indexes sp_configure settings

To get Execution plan history Use performance monitoring software Execution plans of all queries Keep history Use scripts to capture history from DMVs SQL Traces

New feature Query Store New approach? Community Technology Preview (CTP)

This presentation Introduces the Query Store Explains the architecture Shows how it can be used to solve real-world performance problems

SQL Server s new Query Store Tracks: Query plans Runtime statistics Queries/plans history Helps find regressing queries Quickly find new queries with multiple plans Identify un-efficient plans so you can force a better plan

SQL Server s new Query Store Saves history of queries and execution plans Even after SQL Server restart The current and previous plans will be exposed in a DMV

How to use Configure

Enable Query Store

Configure Query Store Read_only vs. Read_Write Max_Storage_size

View disk usage space

Query Store System Objects and New Extended Events SPs: https://msdn.microsoft.com/en-us/library/dn818153.aspx Catalog views: https://msdn.microsoft.com/en-us/library/dn818149.aspx.

Query Store container in SSMS

Query Store reports SSMS view Regressed Queries Top Resource Consuming Queries Tracked Queries Overall Resource Consumption Scenario Pinpoint queries for which execution metrics have recently regressed (i.e. changed to worse). Use this view to correlate observed performance problems in your application with the actual queries that needs to be fixed or improved. Choose an execution metric of interest and identify queries that had the most extreme values for a provided time interval. Use this view to focus your attention on the most relevant queries which have the biggest impact to database resource consumption. Track the execution of the most important queries in real-time. Typically, you use this view when you have queries with forced plans and you want to make sure that query performance is stable. Analyze the total resource consumption for the database for any of the execution metrics. Use this view to identify resource patterns (daily vs. nightly workloads) and optimize overall consumption for your database.

Regressed Queries

Demo

Best Practices https://msdn.microsoft.com/en-ca/library/mt604821.aspx#configure Use latest SSMS Use Query Performance Insight in Azure SQL Database Keep Query Store Adjusted to your Workload Max size Collection interval Retention period (per query and overall)

Best Practices (2) Verify Query Store is Collecting Query Data Continuously Silent mode change Avoid using Non-parameterized queries To avoid frequent recompiles

Non-Parameterized Queries Parameterize queries where applicable, for example wrap queries inside a stored procedure. Use the Optimize for Ad Hoc Workloads option if your workload contains many single use ad-hoc batches with different query plans. Compare the number of distinct query_hash values with the total number of entries in sys.query_store_query. If the ratio is close to 1 your ad-hoc workload generates different queries. Apply FORCED PARAMETERIZATION, for the database or for a subset of queries if the number of different query plans is not large. Use plan guide to force parameterization only for the selected query. Configure FORCED PARAMETERIZATION for the database, if there are a small number of different query plans in your workload. (When the ratio between the count of distinct query_hash and the total number of entries in sys.query_store_query is much less than 1.) Set the Query Capture Mode to AUTO to automatically filter out ad-hoc queries with small resource consumption.

Best Practices (3) Avoid recreating stored procedure, function, and trigger or renaming databases Check the Status of Forced Plans Regularly

Thank you! תודה! gutzait@pythian.com

Answers to questions raised during previous sessions Q: Permissions to view only query store (for developers) A: I could not find any answer to this question but for sure if you are dbo in the database you can do anything with the query store. I will need to play around with permissions for more details. I will publish such an article on the Pythian site. Stay tuned!