Denny Cherry Manager of Information Systems MVP, MCSA, MCDBA, MCTS, MCITP.

Slides:



Advertisements
Similar presentations
Understanding SQL Server Query Execution Plans
Advertisements

SQL Server performance tuning basics
Denny Cherry Manager of Information Systems MVP, MCSA, MCDBA, MCTS, MCITP.
EXECUTION PLANS By Nimesh Shah, Amit Bhawnani. Outline  What is execution plan  How are execution plans created  How to get an execution plan  Graphical.
Denny Cherry Manager of Information Systems MVP, MCSA, MCDBA, MCTS, MCITP.
Access Tutorial 3 Maintaining and Querying a Database
Denny Cherry MVP, MCSA, MCDBA, MCTS, MCITP.
Virtual techdays INDIA │ 9-11 February 2011 SQL 2008 Query Tuning Praveen Srivatsa │ Principal SME – StudyDesk91 │ Director, AsthraSoft Consulting │ Microsoft.
Mary K. Olson PS Reporting Instance – Query Tool 101.
Access Tutorial 3 Maintaining and Querying a Database
Parallel Execution Plans Joe Chang
Copyright 2007, Paradigm Publishing Inc. BACKNEXTEND 3-1 LINKS TO OBJECTIVES Save a Filter as a Query Save a Filter as a Query Parameter Query Inner, Left,
Denny Cherry Senior Database Administrator / Architect MVP, MCSA, MCDBA, MCTS, MCITP.
Database System Architecture and Performance CSCI 6442 ©Copyright 2015, David C. Roberts, all rights reserved.
Module 7 Reading SQL Server® 2008 R2 Execution Plans.
Denny Cherry Manager of Information Systems twitter.com/mrdenny MVP, MCSA, MCDBA, MCTS, MCITP.
Ashwani Roy Understanding Graphical Execution Plans Level 200.
Data Partitioning in VLDB Tal Olier
Primary Key, Cluster Key & Identity Loop, Hash & Merge Joins Joe Chang
Query Processing. Steps in Query Processing Validate and translate the query –Good syntax. –All referenced relations exist. –Translate the SQL to relational.
Parallel Execution Plans Joe Chang
Intro to SQL Management Studio. Please Be Sure!! Make sure that your access is read only. If it isn’t, you have the potential to change data within your.
1 Chapter 10 Joins and Subqueries. 2 Joins & Subqueries Joins – Methods to combine data from multiple tables – Optimizer information can be limited based.
COMPREHENSIVE Access Tutorial 3 Maintaining and Querying a Database.
Denny Cherry Manager of Information Systems twitter.com/mrdenny MVP, MCSA, MCDBA, MCTS, MCITP.
© IBM Corporation 2005 Informix User Forum 2005 John F. Miller III Explaining SQLEXPLAIN ®
SQL Select Statement IST359.
(SQL - Structured Query Language)
2010 Ami Levin. SQL Server implements three different physical operators to perform joins. In this session we will see how each of these three operators.
A Guide to SQL, Eighth Edition Chapter Four Single-Table Queries.
Sorting and Joining.
DAY 18: ACCESS CHAPTER 3 Tazin Afrin October 22,
Query Processing – Implementing Set Operations and Joins Chap. 19.
Eugene Meidinger Execution Plans
Dave LinkedIn
How to kill SQL Server Performance Håkan Winther.
Scott Fallen Sales Engineer, SQL Sentry Blog: scottfallen.blogspot.com.
Execution Plans Detail From Zero to Hero İsmail Adar.
LAB: Web-scale Data Management on a Cloud Lab 11. Query Execution Plan 2011/05/27.
Diving into Query Execution Plans ED POLLACK AUTOTASK CORPORATION DATABASE OPTIMIZATION ENGINEER.
SQL Server Statistics and its relationship with Query Optimizer
Chris Index Feng Shui Chris
An Introductory Look at Execution Plans
Execution Planning for Success
Query Tuning without Production Data
Reading execution plans successfully
Reading Execution Plans Successfully
Introduction to Execution Plans
The Key to the Database Engine
Physical Join Operators
Execution Plans Demystified
SQL Server 2016 Execution Plan Analysis Liviu Ieran
Reading Execution Plans Successfully
Introduction to reading execution plans
Dave Bland LinkedIn SQL Server Execution Plans: How to use them to find performance bottlenecks Dave Bland LinkedIn
Introduction to Execution Plans
“Magic numbers”, local variable and performance
EXECUTION PLANS Quick Dive.
Execution plans Eugene
Diving into Query Execution Plans
Introduction to Execution Plans
Query Optimization Techniques
Reading execution plans successfully
Introduction to Execution Plans
Welcome!.
New Perspectives on Microsoft
All about Indexes Gail Shaw.
The Ins and Outs of Indexes
SQL Server Indexing for the Client Developer
Presentation transcript:

Denny Cherry Manager of Information Systems MVP, MCSA, MCDBA, MCTS, MCITP

Agenda What is an Execution Plan Reading an Execution Plan Execution Plan Operators Changing the Execution Plan Reading the Execution Plan Demo

What is an Execution Plan How the SQL Server access the data within the database. Returned as XML or text when requested. Displayed in a much more readable graphical form Can not be edited directly Can be adjusted with index hints Can be set by pining Execution Plans SQL chooses a Good Enough Plan not the perfect plan.

Reading an Execution Plan Graphical Plan Read from Right To Left, Top to Bottom Follow Arrows until next branch from below Text Plan Read from Left to Right, Top to Bottom Each Operator has it’s own CPU and IO Statistics, both Estimates and Actuals

Reading an Execution Plan

Operators Finding Data Index Seek – Reads the portion of the index which contains the needed data. Index Scan – Reads the entire index for the needed data. Table Scan – Reads the entire table for the needed data. Key Lookup – Looks up values row by row for values which are missing from the index used. Table Valued Function – Executes a table valued function within the database

Operators Filtering and Sorting Nested Loops - Performs inner, outer, semi and anti semi join operations. Performs search on the inner table for each row of the outer table. Hash Match - Creates a hash for required columns for each row. Then creates a hash for second table and finds matches. TOP - Returns the specified top number of rows. Sort - Sorts the incoming rows. Stream Aggregate – groups rows by one or more columns and calculates one or more aggregate expressions.

Changing the Execution Plan Index hints NOLOCK READPAST FIRSTFAST INDEX() Pinning an Execution Plan sp_create_plan_guide sp_control_plan_guide Adding Indexes To Tables Modify Indexes to remove scan and lookup operations

sp_create_plan_guide

sp_control_plan_guide

Please fill out the survey at Twitter Contact InfoBlog