When query plans go wrong

Slides:



Advertisements
Similar presentations
Module 13: Performance Tuning. Overview Performance tuning methodologies Instance level Database level Application level Overview of tools and techniques.
Advertisements

Presenter: Red Devilic Sponsored by SQLViet.com 22/12/2013 SQL SERVER CONFERENCE HCMC 2013 DATABASE TUNING PERFORMANCE OVERVIEW.
Advanced SQL Schema Customization & Reporting Presented By: John Dyke As day to day business needs become more complex so does the need for specifically.
SQL Performance 2011/12 Joe Chang, SolidQ
Understanding Parameter Sniffing Benjamin Nevarez Blog: benjaminnevarez.com 1.
Sponsored by: Professional Association for SQL Server Bad plan! Sit! Gail Shaw.
10 Things Not To Do With SQL SQLBits 7. Some things you shouldn’t do.
Connect with life Vinod Kumar M Technology Evangelist | Microsoft
Module 8: Monitoring SQL Server for Performance. Overview Why to Monitor SQL Server Performance Monitoring and Tuning Tools for Monitoring SQL Server.
Session-01. Hibernate Framework ? Why we use Hibernate ?
Connect with life Praveen Srvatsa Director | AsthraSoft Consulting Microsoft Regional Director, Bangalore Microsoft MVP, ASP.NET.
Agenda Advanced Query Techniques Agenda Taming SQL Performance issues.
By Cory G Stevenson.  Back ground in general IT, accounting and business consulting  Currently work as a Database Engineer for Hyland Software  Blog:
2 Copyright © 2006, Oracle. All rights reserved. Performance Tuning: Overview.
Hitachi Consulting’s Solution Offerings Eric Winton Manager Technology Solutions Hitachi Consulting.
Module 7 Reading SQL Server® 2008 R2 Execution Plans.
Learningcomputer.com SQL Server 2008 – Profiling and Monitoring Tools.
Amit Bansal CTO | Peopleware India (unit of eDominer Systems) | |
How to Use Parameters Like a Pro …and Boost Performance Guy Glantser, CEO, Madeira.
1 Chapter Overview Developing a Performance Monitoring Methodology Choosing Among Monitoring Tools Performing Monitoring Tasks.
MAKING BUSINESS INTELLIGENT SSRS Subscriptions Bradley Schacht Blog:
Maciej Pilecki Consultant Project Botticelli Ltd. DAT404.
SQL Server Statistics DEMO SQL Server Statistics SREENI JULAKANTI,MCTS.MCITP,MCP. SQL SERVER Database Administration.
Scott Fallen Sales Engineer, SQL Sentry Blog: scottfallen.blogspot.com.
SAP Tuning 실무 SK㈜ ERP TFT.
High Performance Functions SQLBits VI. Going backwards is faster than going forwards.
Improve query performance with the new SQL Server 2016 query store!! Michelle Gutzait Principal Consultant at
No more waiting. Sponsors About me  Database Technology Specialist  MVP  Blogger  Author 3
Sponsored by: Professional Association for SQL Server Advanced Reporting Services Slicers.
SQL Server Magic Buttons! What are Trace Flags and why should I care? Steinar Andersen, SQL Service Nordic AB Thanks to Thomas Kejser for peer-reviewing.
SQL Server Performance Tuning
SQL Server Certifications
SQL Server Certifications
SQL Server Statistics and its relationship with Query Optimizer
SQL Server Certifications
Curacao SQL Saturday June 11, 2016
Troubleshooting SQL Server high CPU usage
Stored Procedures – Facts and Myths
SQL Server Data Collector From Every Angle
Hitting the SQL Server “Go Faster” Button
T-SQL Coding Techniques Are you playing with fire?
Improve Troubleshooting & Performance Analysis
Parameter Sniffing in SQL Server Stored Procedures
Query Tuning without Production Data
Building Modern Transaction Systems on SQL Server
Peeking into the Plan Cache with SQL Server 2008
Query Execution Expectation-Reality Denis Reznik
Decoding the Cardinality Estimator to Speed Up Queries
Performance Tuning for Mere Mortals Part II
Now where does THAT estimate come from?
Cardinality Estimator 2014/2016
Statistics: What are they and How do I use them
Performance Tuning for Mere Mortals Part II
Hugo Kornelis Now where does THAT estimate come from? The nuts and bolts of cardinality estimation.
SQL Server Performance Tuning Nowadays
How to Use Parameters Like a Pro
Targeting Wait Statistics with Extended Events
SQL Server 2008 for developers
Parameter Sniffing: the Good, the Bad, and the Ugly
SQL Server Performance Tuning
Parameter Sniffing: the Good,the Bad, and the Ugly
Parameter Sniffing on SQL Server
Parameter Sniffing: the Good, the Bad, and the Ugly
Query Tuning Fundamentals
SQL Server Query Design and Optimization Recommendations
Homework Reading Machine Projects Labs
The Complete Guide to Temporary Tables and Table Variables
Using wait stats to determine why my server is slow
The Complete Guide to Temporary Tables and Table Variables
Working with Very Large Tables Like a Pro in SQL Server 2017
Presentation transcript:

When query plans go wrong

SQL

Simon Sabin Independent SQL Server Consultant and Trainer Database design and development, Business Intelligence, Performance tuning and troubleshooting SQL Server since 6.5 Email: Simon@onarc.com Blog: http://Sqlblogcasts.com/blogs/simons Twitter: simon_sabin

Car crash

Works on my computer

Parameter Sniffing @

SQL tries to be clever

A bit like

Statistics

So what are the root causes

Out of date statistics Best Before: 1/4/1999

Skewed data

Multi purpose queries

Solutions Selective code paths WITH RECOMPILE OPTIMIZE FOR PLAN guides Careful as SP is compiled as one batch WITH RECOMPILE Compilation hit, plan cache bloat OPTIMIZE FOR Results in a consistent plan PLAN guides

Update Statistics Update Statistics Trace flag 2388, 2389 and 2390 Can be a performance hit Trace flag 2388, 2389 and 2390

Overview    Out of date statistics Compilation Best Query Skewed Data Supportable Multiple Code paths   Update statistics  OPTIMZE FOR WITH RECOMPILE Trace Flags

Summary You will only know if you monitor Baseline your system Identify changes in read, writes and cpu Not duration Consider the options for your situation You can win this battle

Please fill in feedback forms Q&A Now - Just ask Afterwards – I’ll be around Much Later Simon@SQLKnowHow.com @simon_sabin http://sqlblogcasts.com/blogs/simonsabin Please fill in feedback forms