SlideShare a Scribd company logo
@JohnSterrett
Troubleshooting Plan Changes with
Query Store in SQL Server 2016
www.linchpinpeople.com 2
John Sterrett
@johnsterrett
John.Sterrett@linchpinpeople.com
Johnsterrett.com
linked.com/in/johnsterrett
google.com/+johnsterrett
Specialties / Focus Areas / Passions:
• Performance Tuning &
Troubleshooting
• Virtualization
• Infrastructure
• Architecture
• High Availability
• Disaster Recovery
• Health Monitoring
• Capacity Management
• License Efficiency
Linchpin People Group Principle
Leader Austin SQL
Server User Group
Leader Virtual Chapter
“High Availability and
Disaster Recovery”
PASS Regional Mentor
Life of an Execution Plan
Execute T-SQL
Does A Execution
Plan Exist?
Use The Execution Plan
in Cache
Yes, It Exists
Build Execution Plan
with Variables Used at
Runtime
No, Plan Doesn t Exist
Put Execution Plan in
Cache
11/12/2015 www.linchpinpeople.com 3
How Do I Detect Plan Recompile?
• Profiler
• Extended Events
• Dynamic Management Views (DMVs)
• Query Store (SQL Server 2016)
• TechNet – Execution Plan Caching and Reuse
11/12/2015 www.linchpinpeople.com 4
Reasons for Execution Plan Recompiles
• Changes made to a table or view referenced by the query (ALTER TABLE and ALTER VIEW).
• Changes made to a single procedure, which would drop all plans for that procedure from the
cache (ALTER PROCEDURE).
• Changes to any indexes used by the execution plan.
• Updates on statistics used by the execution plan, generated either explicitly from a statement,
such as UPDATE STATISTICS, or generated automatically.
• Dropping an index used by the execution plan.
• An explicit call to sp_recompile.
• Large numbers of changes to keys (generated by INSERT or DELETE statements from other users
that modify a table referenced by the query).
• For tables with triggers, if the number of rows in the inserted or deleted tables grows
significantly.
• Executing a stored procedure using the WITH RECOMPILE option.
11/12/2015 www.linchpinpeople.com 5
DEMO!
• Capture Execution Plan information
• Identify Queries with Changing Plans
• Learn how to freeze a plan with Plan Guides
11/12/2015 www.linchpinpeople.com 6
References
• Plan Guides (plan freezing) in SQL Server 2005/2008
• Plan Guides on Books Online
• Execution Plan Caching and Reuse
The SQL Server 2016 Solution….
8
Query Store!
9
DEMO!
• Query Store in SQL Server 2016
• Find Top Offenders
• Identify Changing Execution Plans
• Easily Freeze an Execution Plan
• Internal DMVs
10
References
• Plan Guides (plan freezing) in SQL Server 2005/2008
• Plan Guides on Books Online
• Execution Plan Caching and Reuse
• Monitor Performance With Query Store (SQL 2016)

More Related Content

PDF
Driving Business Value Through Agile Data Assets
PDF
Agile, Automated, Aware: How to Model for Success
PDF
Great Scott! Dealing with New Datatypes
PPT
ODI 11g in the Enterprise - BIWA 2013
PDF
Odi ireland rittman
PDF
Oracle data integrator 12c - getting started
PPTX
Conceptional Data Vault
PPTX
How to Handle DEV&TEST&PROD for Oracle Data Integrator
Driving Business Value Through Agile Data Assets
Agile, Automated, Aware: How to Model for Success
Great Scott! Dealing with New Datatypes
ODI 11g in the Enterprise - BIWA 2013
Odi ireland rittman
Oracle data integrator 12c - getting started
Conceptional Data Vault
How to Handle DEV&TEST&PROD for Oracle Data Integrator

What's hot (20)

PPTX
Oracle data integrator (odi) online training
PPTX
Oracle Data integrator 11g (ODI) - Online Training Course
PDF
OBIEE12c and Embedded Essbase 12c - An Initial Look at Query Acceleration Use...
ODP
Moving and Transforming Data with Pentaho Data Integration 5.0 CE (aka Kettle)
PDF
Data Visualization and Discovery
PDF
Talend Introduction by TSI
PPTX
Talend Big Data Capabilities Overview
PPTX
Oracle Data Integrator
PPT
Kettle – Etl Tool
PDF
Oracle Data Integrator 12c - Getting Started
PPTX
Why does Microsoft care about NoSQL, SQL and Polyglot Persistence?
PPT
oracle data integrator training | oracle data integrator training videos | or...
PDF
Kettle: Pentaho Data Integration tool
PPT
Using OBIEE and Data Vault to Virtualize Your BI Environment: An Agile Approach
PPT
Pentaho etl-tool
PDF
Manipulating Data with Talend.
PDF
Pentaho data integration 4.0 and my sql
PPSX
Business Intelligence and Big Data Analytics with Pentaho
PPTX
Top Five Cool Features in Oracle SQL Developer Data Modeler
PDF
Democratizing Data Quality Through a Centralized Platform
Oracle data integrator (odi) online training
Oracle Data integrator 11g (ODI) - Online Training Course
OBIEE12c and Embedded Essbase 12c - An Initial Look at Query Acceleration Use...
Moving and Transforming Data with Pentaho Data Integration 5.0 CE (aka Kettle)
Data Visualization and Discovery
Talend Introduction by TSI
Talend Big Data Capabilities Overview
Oracle Data Integrator
Kettle – Etl Tool
Oracle Data Integrator 12c - Getting Started
Why does Microsoft care about NoSQL, SQL and Polyglot Persistence?
oracle data integrator training | oracle data integrator training videos | or...
Kettle: Pentaho Data Integration tool
Using OBIEE and Data Vault to Virtualize Your BI Environment: An Agile Approach
Pentaho etl-tool
Manipulating Data with Talend.
Pentaho data integration 4.0 and my sql
Business Intelligence and Big Data Analytics with Pentaho
Top Five Cool Features in Oracle SQL Developer Data Modeler
Democratizing Data Quality Through a Centralized Platform
Ad

Viewers also liked (14)

PPTX
PHONE GAP
PDF
Git Hooks
PPTX
HEALTHY FOODS - DINESH VORA
PPTX
What's up LOD Cloud - Observing the state of Linked Open Data Cloud Metadata
DOCX
Molly Elizabeth Cox resume
PPTX
South south and north north co operation on (2)
ODP
2016 09-24-mini-maker-faire-madrid
PPT
Gen1 week3final
PPTX
The Secrets of SQL Server: Database Worst Practices
PDF
Infopath replacement sharepoint alternative
PPTX
Getting Started Building Mobile Applications for iOS and Android
PDF
Qa tester
DOCX
my resume
PHONE GAP
Git Hooks
HEALTHY FOODS - DINESH VORA
What's up LOD Cloud - Observing the state of Linked Open Data Cloud Metadata
Molly Elizabeth Cox resume
South south and north north co operation on (2)
2016 09-24-mini-maker-faire-madrid
Gen1 week3final
The Secrets of SQL Server: Database Worst Practices
Infopath replacement sharepoint alternative
Getting Started Building Mobile Applications for iOS and Android
Qa tester
my resume
Ad

Similar to Troubleshooting Plan Changes with Query Store in SQL Server 2016 (20)

PPTX
Database Fundamental Concepts- Series 1 - Performance Analysis
PPTX
LVOUG meetup #2 - Forcing SQL Execution Plan Instability
PPTX
Sql server operational best practices notes from the field - charley hanan...
PPTX
Database Migrations with Gradle and Liquibase
PDF
SQL Server 2017 - Adaptive Query Processing and Automatic Query Tuning
PDF
Liquibase få kontroll på dina databasförändringar
PDF
Performance Stability, Tips and Tricks and Underscores
DOCX
Informatica course content
DOCX
Informatica Training in Chennai
DOCX
Informatica course content
DOCX
Informatica course content
DOCX
Informatica course content
PDF
Role of-analytics-in-db as-life
PPTX
Cache issues from T-SQL-generated Plans and How to Manage Them
PDF
KoprowskiT_SQLRelay2014#4_Caerdydd_MaintenancePlansForBeginners
PDF
Openstack upgrade without_down_time_20141103r1
PDF
Discovering the Plan Cache (#SQLSat 206)
PPTX
SPSNYC17 - The Wall: Overcoming SharePoint’s Site Collection Boundary
PPTX
Geek Sync | Intro to Query Store
PDF
PCM18 (Big Data Analytics)
Database Fundamental Concepts- Series 1 - Performance Analysis
LVOUG meetup #2 - Forcing SQL Execution Plan Instability
Sql server operational best practices notes from the field - charley hanan...
Database Migrations with Gradle and Liquibase
SQL Server 2017 - Adaptive Query Processing and Automatic Query Tuning
Liquibase få kontroll på dina databasförändringar
Performance Stability, Tips and Tricks and Underscores
Informatica course content
Informatica Training in Chennai
Informatica course content
Informatica course content
Informatica course content
Role of-analytics-in-db as-life
Cache issues from T-SQL-generated Plans and How to Manage Them
KoprowskiT_SQLRelay2014#4_Caerdydd_MaintenancePlansForBeginners
Openstack upgrade without_down_time_20141103r1
Discovering the Plan Cache (#SQLSat 206)
SPSNYC17 - The Wall: Overcoming SharePoint’s Site Collection Boundary
Geek Sync | Intro to Query Store
PCM18 (Big Data Analytics)

More from Embarcadero Technologies (20)

PDF
PyTorch for Delphi - Python Data Sciences Libraries.pdf
PDF
Android on Windows 11 - A Developer's Perspective (Windows Subsystem For Andr...
PDF
Linux GUI Applications on Windows Subsystem for Linux
PDF
Python on Android with Delphi FMX - The Cross Platform GUI Framework
PDF
Introduction to Python GUI development with Delphi for Python - Part 1: Del...
PDF
FMXLinux Introduction - Delphi's FireMonkey for Linux
PDF
Python for Delphi Developers - Part 2
PPTX
Python for Delphi Developers - Part 1 Introduction
PDF
RAD Industrial Automation, Labs, and Instrumentation
PDF
Embeddable Databases for Mobile Apps: Stress-Free Solutions with InterBase
PDF
Rad Server Industry Template - Connected Nurses Station - Setup Document
PPTX
TMS Google Mapping Components
PDF
Move Desktop Apps to the Cloud - RollApp & Embarcadero webinar
PPTX
Useful C++ Features You Should be Using
PPTX
Embarcadero RAD server Launch Webinar
PPTX
ER/Studio 2016: Build a Business-Driven Data Architecture
PDF
What's New in DBArtisan and Rapid SQL 2016
PDF
Is This Really a SAN Problem? Understanding the Performance of Your IO Subsy...
PDF
RAD Studio, Delphi and C++Builder 10 Feature Matrix
PDF
7 Dangerous Myths DBAs Believe about Data Modeling
PyTorch for Delphi - Python Data Sciences Libraries.pdf
Android on Windows 11 - A Developer's Perspective (Windows Subsystem For Andr...
Linux GUI Applications on Windows Subsystem for Linux
Python on Android with Delphi FMX - The Cross Platform GUI Framework
Introduction to Python GUI development with Delphi for Python - Part 1: Del...
FMXLinux Introduction - Delphi's FireMonkey for Linux
Python for Delphi Developers - Part 2
Python for Delphi Developers - Part 1 Introduction
RAD Industrial Automation, Labs, and Instrumentation
Embeddable Databases for Mobile Apps: Stress-Free Solutions with InterBase
Rad Server Industry Template - Connected Nurses Station - Setup Document
TMS Google Mapping Components
Move Desktop Apps to the Cloud - RollApp & Embarcadero webinar
Useful C++ Features You Should be Using
Embarcadero RAD server Launch Webinar
ER/Studio 2016: Build a Business-Driven Data Architecture
What's New in DBArtisan and Rapid SQL 2016
Is This Really a SAN Problem? Understanding the Performance of Your IO Subsy...
RAD Studio, Delphi and C++Builder 10 Feature Matrix
7 Dangerous Myths DBAs Believe about Data Modeling

Recently uploaded (20)

PPTX
Maximizing Revenue with Marketo Measure: A Deep Dive into Multi-Touch Attribu...
PPTX
Odoo Integration Services by Candidroot Solutions
PDF
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
PDF
QAware_Mario-Leander_Reimer_Architecting and Building a K8s-based AI Platform...
DOCX
The Five Best AI Cover Tools in 2025.docx
PPTX
Materi_Pemrograman_Komputer-Looping.pptx
PPTX
What to Capture When It Breaks: 16 Artifacts That Reveal Root Causes
PDF
Comprehensive Salesforce Implementation Services.pdf
PDF
The Future of Smart Factories Why Embedded Analytics Leads the Way
PDF
Emergency Mustering solutions – A Brief overview
PDF
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
PPTX
10 Hidden App Development Costs That Can Sink Your Startup.pptx
PDF
Why Use Open Source Reporting Tools for Business Intelligence.pdf
PPT
FALLSEM2025-26_ISWE304L_TH_VL2025260102786_2025-07-10_Reference-Material-II.ppt
PDF
IEEE-CS Tech Predictions, SWEBOK and Quantum Software: Towards Q-SWEBOK
DOCX
The Future of Smart Factories Why Embedded Analytics Leads the Way
PDF
Solar Panel Installation Guide – Step By Step Process 2025.pdf
PPTX
Materi-Enum-and-Record-Data-Type (1).pptx
PDF
Become an Agentblazer Champion Challenge
PPTX
Audio Editing and it's techniques in computer graphics.pptx
Maximizing Revenue with Marketo Measure: A Deep Dive into Multi-Touch Attribu...
Odoo Integration Services by Candidroot Solutions
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
QAware_Mario-Leander_Reimer_Architecting and Building a K8s-based AI Platform...
The Five Best AI Cover Tools in 2025.docx
Materi_Pemrograman_Komputer-Looping.pptx
What to Capture When It Breaks: 16 Artifacts That Reveal Root Causes
Comprehensive Salesforce Implementation Services.pdf
The Future of Smart Factories Why Embedded Analytics Leads the Way
Emergency Mustering solutions – A Brief overview
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
10 Hidden App Development Costs That Can Sink Your Startup.pptx
Why Use Open Source Reporting Tools for Business Intelligence.pdf
FALLSEM2025-26_ISWE304L_TH_VL2025260102786_2025-07-10_Reference-Material-II.ppt
IEEE-CS Tech Predictions, SWEBOK and Quantum Software: Towards Q-SWEBOK
The Future of Smart Factories Why Embedded Analytics Leads the Way
Solar Panel Installation Guide – Step By Step Process 2025.pdf
Materi-Enum-and-Record-Data-Type (1).pptx
Become an Agentblazer Champion Challenge
Audio Editing and it's techniques in computer graphics.pptx

Troubleshooting Plan Changes with Query Store in SQL Server 2016

  • 1. @JohnSterrett Troubleshooting Plan Changes with Query Store in SQL Server 2016
  • 2. www.linchpinpeople.com 2 John Sterrett @johnsterrett [email protected] Johnsterrett.com linked.com/in/johnsterrett google.com/+johnsterrett Specialties / Focus Areas / Passions: • Performance Tuning & Troubleshooting • Virtualization • Infrastructure • Architecture • High Availability • Disaster Recovery • Health Monitoring • Capacity Management • License Efficiency Linchpin People Group Principle Leader Austin SQL Server User Group Leader Virtual Chapter “High Availability and Disaster Recovery” PASS Regional Mentor
  • 3. Life of an Execution Plan Execute T-SQL Does A Execution Plan Exist? Use The Execution Plan in Cache Yes, It Exists Build Execution Plan with Variables Used at Runtime No, Plan Doesn t Exist Put Execution Plan in Cache 11/12/2015 www.linchpinpeople.com 3
  • 4. How Do I Detect Plan Recompile? • Profiler • Extended Events • Dynamic Management Views (DMVs) • Query Store (SQL Server 2016) • TechNet – Execution Plan Caching and Reuse 11/12/2015 www.linchpinpeople.com 4
  • 5. Reasons for Execution Plan Recompiles • Changes made to a table or view referenced by the query (ALTER TABLE and ALTER VIEW). • Changes made to a single procedure, which would drop all plans for that procedure from the cache (ALTER PROCEDURE). • Changes to any indexes used by the execution plan. • Updates on statistics used by the execution plan, generated either explicitly from a statement, such as UPDATE STATISTICS, or generated automatically. • Dropping an index used by the execution plan. • An explicit call to sp_recompile. • Large numbers of changes to keys (generated by INSERT or DELETE statements from other users that modify a table referenced by the query). • For tables with triggers, if the number of rows in the inserted or deleted tables grows significantly. • Executing a stored procedure using the WITH RECOMPILE option. 11/12/2015 www.linchpinpeople.com 5
  • 6. DEMO! • Capture Execution Plan information • Identify Queries with Changing Plans • Learn how to freeze a plan with Plan Guides 11/12/2015 www.linchpinpeople.com 6
  • 7. References • Plan Guides (plan freezing) in SQL Server 2005/2008 • Plan Guides on Books Online • Execution Plan Caching and Reuse
  • 8. The SQL Server 2016 Solution…. 8
  • 10. DEMO! • Query Store in SQL Server 2016 • Find Top Offenders • Identify Changing Execution Plans • Easily Freeze an Execution Plan • Internal DMVs 10
  • 11. References • Plan Guides (plan freezing) in SQL Server 2005/2008 • Plan Guides on Books Online • Execution Plan Caching and Reuse • Monitor Performance With Query Store (SQL 2016)