Basic Execution Plans Eugene Meidinger emeidinger@all-lines-tech @ sqlgene sqlgene

13
Basic Execution Plans Eugene Meidinger [email protected] @sqlgene www.sqlgene.com

description

Basic Execution Plans Eugene Meidinger [email protected] @ sqlgene www.sqlgene.com. Thank you to our Sponsors!!!. Who is All Lines Technology?. - PowerPoint PPT Presentation

Transcript of Basic Execution Plans Eugene Meidinger emeidinger@all-lines-tech @ sqlgene sqlgene

Page 1: Basic  Execution Plans Eugene Meidinger emeidinger@all-lines-tech @ sqlgene sqlgene

Basic Execution PlansEugene Meidinger

[email protected]@sqlgene

www.sqlgene.com

Page 2: Basic  Execution Plans Eugene Meidinger emeidinger@all-lines-tech @ sqlgene sqlgene

Thank you to our Sponsors!!!

Page 3: Basic  Execution Plans Eugene Meidinger emeidinger@all-lines-tech @ sqlgene sqlgene

• All Lines Technology is a local woman owned solutions provider with corporate headquarters in Warrendale, PA, with offices in Cleveland, Columbus and Morgantown.

• Our parent company, Fire Fighter Sales & Service Co. has been in business since 1946, supplying fire suppression and life safety products and services to over 15,000 customers in the tri-state area.

• Customer service has been the cornerstone of our business for over 60 years.• Strong company foundation and financial stability achieving year of year profitable revenue

growth.

Who is All Lines Technology?

Page 4: Basic  Execution Plans Eugene Meidinger emeidinger@all-lines-tech @ sqlgene sqlgene

Who is LANtek?• Staffing – Named largest, local Staffing Firm in Western PA since 2011• Hardware Break / Fix• Application Development• SharePoint Services• NOC / Help Desk Services• Network/LAN/WAN Design &Delivery• Datacenter Design &Architecture• PC Deployment• VDI and BYOD Solutions• Cloud Services, including LANtek hosted &MS Office 365 & Azure

Page 5: Basic  Execution Plans Eugene Meidinger emeidinger@all-lines-tech @ sqlgene sqlgene

Who am I?• Accidental DBA• Graduated Penn State 2010 for IST• First Job was in BI department at Bayer• Head of small BI department at FF/ALT/Lantek• Certified in Querying SQL Server 2012• Started speaking a year ago

– Don’t go to the SQL Saturday after event! You’ll get drafted

• Not an expert, just know enough to speak

Page 6: Basic  Execution Plans Eugene Meidinger emeidinger@all-lines-tech @ sqlgene sqlgene

What are we going to talk about?• What is an execution Plan• How to view an execution plan• What does a plan look like• How to read one• Demo• Resources• Q/A

Page 7: Basic  Execution Plans Eugene Meidinger emeidinger@all-lines-tech @ sqlgene sqlgene

What is an execution plan?• Instructions for how to process a query

– Can think of it as a recipe

• Created by query optimizer at run time• Execution plans are cached after the first run• Many different ways to process the same query

– For trivial queries, a simple plan is used– Can be forced with hints– Don’t try to outsmart the database engine

Page 8: Basic  Execution Plans Eugene Meidinger emeidinger@all-lines-tech @ sqlgene sqlgene

How to view the execution plan?• Go to Query

– Click Include Actual Execution Plan

• Or, Press Ctrl + M• Or click the Execution Plan Icon on the tool bar

Page 9: Basic  Execution Plans Eugene Meidinger emeidinger@all-lines-tech @ sqlgene sqlgene

What does a plan look like?

Page 10: Basic  Execution Plans Eugene Meidinger emeidinger@all-lines-tech @ sqlgene sqlgene

How to read an execution plan• Read from right to left and top to bottom• Icons represent operators

– Operators have cost below them in %

• Arrows represent data flow– Bigger arrows represent more data

• Hover over icons and arrows for more detail

Page 11: Basic  Execution Plans Eugene Meidinger emeidinger@all-lines-tech @ sqlgene sqlgene

Demo

Demo code.sql

Page 13: Basic  Execution Plans Eugene Meidinger emeidinger@all-lines-tech @ sqlgene sqlgene

Questions?Thank you!