Presentation is loading. Please wait.

Presentation is loading. Please wait.

EXECUTION PLANS Quick Dive.

Similar presentations


Presentation on theme: "EXECUTION PLANS Quick Dive."— Presentation transcript:

1 EXECUTION PLANS Quick Dive

2 ABOUT ME @shawsql

3 I OWE EVERYTHING TO…

4 WHAT WE WON’T TALK ABOUT
Execution plan cache Performance tuning DMV’s (maybe a little) XML, parallelism, partitioning, etc. Statistics Politics

5 KEY CONCEPTS T-SQL is non-procedural
This means the language does not tell how to retrieve the data Execution Plans are cost-based This means even a good plan may not necessarily be the best plan and the best plan may never be known Execution Plans are broken up into logical and physical operators Logical operations are expressed by physical operations

6 EXECUTION PROCESS

7 EXECUTION PLANS Each step in an execution plan is a physical operator
Plans read from left to right Bar thickness represents amount of data Outer tables on top, inner tables on bottom Plans are either “trivial” or “full”

8 DEMO Trivial Plans Index\Table Scans\Seeks Bookmark Lookups

9 JOIN TYPES Hash - Build table and probe table
- In memory, grace, recursive Nested Loops - Outer table and inner table - Best when outer input is small and inner output is indexed

10 JOIN TYPES Merge - Each input is sorted
- Best for large, pre-sorted tables

11 DEMO Join Types

12 TOOL TIP TIME A lot of information but most not necessarily relevant.

13 Best Practices Locate the step with the highest cost
Eliminate table scans Update statistics Avoid bookmark lookups by using clustered indexes or covering indexes


Download ppt "EXECUTION PLANS Quick Dive."

Similar presentations


Ads by Google