SQL Saturday Night                                  9th   Execution Plans   Microsoft SQL Server 2008 R2       Σάββατο 26/...
Η παρουσίαση αυτή καταγράφεται ώστε να είναι διαθέσιμη σεόσους θέλουν να την ξαναδούν, ή δεν είχαν την δυνατότητα νατην πα...
Antonios ChatzipavlisSolution Architect - Principal ConsultantDevelopment Evangelist - SQL Server MVPMCT, MCITP, MCPD, MCS...
AgendaExecution Plans in Microsoft SQL Server 2008 R2•••                                                  4
Microsoft SQL Server 2008 R2                               5
How a query executedBasics of Execution Plans in Microsoft SQL Server 2008 R2                                             ...
Estimated vs Actual Execution PlansBasics of Execution Plans in Microsoft SQL Server 2008 R2•    •    ••    •    •        ...
Execution Plan ReuseBasics of Execution Plans in Microsoft SQL Server 2008 R2•                      (previously called Pro...
demo       9
Estimated != Actual Execution PlanBasics of Execution Plans in Microsoft SQL Server 2008 R2•••                            ...
Execution Plan FormatsBasics of Execution Plans in Microsoft SQL Server 2008 R2•    •    ••    •    •    ••    •    •     ...
demo       12
Interpreting Graphical Execution PlansBasics of Execution Plans in Microsoft SQL Server 2008 R2                           ...
Interpreting Text Execution PlansBasics of Execution Plans in Microsoft SQL Server 2008 R2                                ...
Microsoft SQL Server 2008 R2                               15
The Icon LanguageThe Language of Graphical Execution Plans in Microsoft SQL Server 2008 R2       Clustered Index Scan     ...
demo       17
Microsoft SQL Server 2008 R2                               18
19
demo       20
Contact Me – Follow meTwitter:   antonioschBlog:      sqlschoolgr.wordpress.comEmail:     sqlschool.gr@gmail.com          ...
Σας Ευχαριστώ                22
Rocking with Knowledge of SQL Server http://www.sqlschool.gr
Upcoming SlideShare
Loading in …5
×

9th ssn execution plans in microsoft sql server 2008 r2

367 views
291 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
367
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

9th ssn execution plans in microsoft sql server 2008 r2

  1. 1. SQL Saturday Night 9th Execution Plans Microsoft SQL Server 2008 R2 Σάββατο 26/03/2011
  2. 2. Η παρουσίαση αυτή καταγράφεται ώστε να είναι διαθέσιμη σεόσους θέλουν να την ξαναδούν, ή δεν είχαν την δυνατότητα νατην παρακολουθήσουν σε πραγματικό χρόνο.Η παρουσίαση αυτή διατίθεται δωρεάν.Εάν κάποιος από τους παραβρισκόμενους στην παρουσίασηαυτή έχει το οποιοδήποτε πρόβλημα ή αντίρρηση να είναι μέσαστην καταγραφή αυτής, παρακαλείται να αποχωρήσει άμεσα.Σε διαφορετική περίπτωση η παρουσία του εκλαμβάνεται ωςαποδοχή της καταγραφής.Η παρουσίαση αρχίζει σε 1 λεπτό…
  3. 3. Antonios ChatzipavlisSolution Architect - Principal ConsultantDevelopment Evangelist - SQL Server MVPMCT, MCITP, MCPD, MCSD, MCDBA, MCSA, MCTS, MCAD, MCP, OCA
  4. 4. AgendaExecution Plans in Microsoft SQL Server 2008 R2••• 4
  5. 5. Microsoft SQL Server 2008 R2 5
  6. 6. How a query executedBasics of Execution Plans in Microsoft SQL Server 2008 R2 Relational Engine QUERY Query Parse/Query/Sequence Algebrizer Query Processor Parsing Tree Output Process Tree Output Query Optimizer Estimated Statistics Models Execution Plan Storage Engine Query Actual Execution Execution Plan Actual Execution Plan Plan Cache Actual Execution Plan Actual Execution Plan Actual Execution Plan 6
  7. 7. Estimated vs Actual Execution PlansBasics of Execution Plans in Microsoft SQL Server 2008 R2• • •• • • 7
  8. 8. Execution Plan ReuseBasics of Execution Plans in Microsoft SQL Server 2008 R2• (previously called Procedure Cache)• Each plan is stored once in Plan Cache • Except if the optimizer sees parallelism, in this case one query gets two plans.• Execution Plans are not kept in memory forever. • Slowly aged out of the system using an “age” formula • Estimated Cost X Number of Times it has been used • Lazywriter process periodically scans the cache and decreases this value by one each time. 8
  9. 9. demo 9
  10. 10. Estimated != Actual Execution PlanBasics of Execution Plans in Microsoft SQL Server 2008 R2••• 10
  11. 11. Execution Plan FormatsBasics of Execution Plans in Microsoft SQL Server 2008 R2• • •• • • •• • • 11
  12. 12. demo 12
  13. 13. Interpreting Graphical Execution PlansBasics of Execution Plans in Microsoft SQL Server 2008 R2 13
  14. 14. Interpreting Text Execution PlansBasics of Execution Plans in Microsoft SQL Server 2008 R2 14
  15. 15. Microsoft SQL Server 2008 R2 15
  16. 16. The Icon LanguageThe Language of Graphical Execution Plans in Microsoft SQL Server 2008 R2 Clustered Index Scan Clustered Index Seek Non-Clustered Index Scan Non-Clustered Index Seek Key Lookup Table Scan RID LookUp Hash Match Nested Loops Merge Join Sort Filter 16
  17. 17. demo 17
  18. 18. Microsoft SQL Server 2008 R2 18
  19. 19. 19
  20. 20. demo 20
  21. 21. Contact Me – Follow meTwitter: antonioschBlog: sqlschoolgr.wordpress.comEmail: sqlschool.gr@gmail.com 21
  22. 22. Σας Ευχαριστώ 22
  23. 23. Rocking with Knowledge of SQL Server http://www.sqlschool.gr

×