Basic Execution Plans Eugene Meidinger emeidinger@all-lines-tech @ sqlgene sqlgene
-
Upload
megan-lucas -
Category
Documents
-
view
16 -
download
0
description
Transcript of Basic Execution Plans Eugene Meidinger emeidinger@all-lines-tech @ sqlgene sqlgene
![Page 2: Basic Execution Plans Eugene Meidinger emeidinger@all-lines-tech @ sqlgene sqlgene](https://reader036.fdocuments.in/reader036/viewer/2022062717/56812aad550346895d8e739b/html5/thumbnails/2.jpg)
Thank you to our Sponsors!!!
![Page 3: Basic Execution Plans Eugene Meidinger emeidinger@all-lines-tech @ sqlgene sqlgene](https://reader036.fdocuments.in/reader036/viewer/2022062717/56812aad550346895d8e739b/html5/thumbnails/3.jpg)
• 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](https://reader036.fdocuments.in/reader036/viewer/2022062717/56812aad550346895d8e739b/html5/thumbnails/4.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022062717/56812aad550346895d8e739b/html5/thumbnails/5.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022062717/56812aad550346895d8e739b/html5/thumbnails/6.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022062717/56812aad550346895d8e739b/html5/thumbnails/7.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022062717/56812aad550346895d8e739b/html5/thumbnails/8.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022062717/56812aad550346895d8e739b/html5/thumbnails/9.jpg)
What does a plan look like?
![Page 10: Basic Execution Plans Eugene Meidinger emeidinger@all-lines-tech @ sqlgene sqlgene](https://reader036.fdocuments.in/reader036/viewer/2022062717/56812aad550346895d8e739b/html5/thumbnails/10.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022062717/56812aad550346895d8e739b/html5/thumbnails/11.jpg)
Demo
Demo code.sql
![Page 12: Basic Execution Plans Eugene Meidinger emeidinger@all-lines-tech @ sqlgene sqlgene](https://reader036.fdocuments.in/reader036/viewer/2022062717/56812aad550346895d8e739b/html5/thumbnails/12.jpg)
Resources Adventure Works Database Execution Plan Basics by Grant Fritchey SQL Server Execution Plans, Second Edition by Grant Fritchey Watch Brent Ozar Tune Queries by Brent Ozar
![Page 13: Basic Execution Plans Eugene Meidinger emeidinger@all-lines-tech @ sqlgene sqlgene](https://reader036.fdocuments.in/reader036/viewer/2022062717/56812aad550346895d8e739b/html5/thumbnails/13.jpg)
Questions?Thank you!