SlideShare a Scribd company logo
SQL Server 2005 – Reading and Interpreting Query PlansFlorin CardaşimLead developerRomSoft, IAŞI,http://www.rms.ro
Sql Server execution plans
AgendaGraphic, Xml and Text query plans
One-table SELECT
Table Join SELECT
INSERT, UPDATE, DELETESql Server Architecturehttp://en.wikipedia.org/wiki/Microsoft_SQL_Server
Sql Server execution plans
DemoThe tools:Management Studio
Server Profiler

More Related Content

ODP
Power pivot intro
PPTX
SQL Server Columnstore
PDF
Building BI Publisher Reports using Templates
DOC
qidb_resume
PPTX
Susan Lennon: Building SharePoint Dashboards
PPTX
124 excelrest
PDF
Luke Kremer Resume
DOC
Qidb resume
Power pivot intro
SQL Server Columnstore
Building BI Publisher Reports using Templates
qidb_resume
Susan Lennon: Building SharePoint Dashboards
124 excelrest
Luke Kremer Resume
Qidb resume

Viewers also liked (14)

PDF
PDF
XML on SQL Server
PPT
7a advanced tsql
PPTX
SQL Functions
PPT
Sql operators & functions 3
PPTX
Sql query analyzer & maintenance
PDF
SQL Server - Querying and Managing XML Data
PDF
Stored-Procedures-Presentation
PDF
CSS3 and Responsive Web Design - Web Technologies (1019888BNR)
PDF
Course Review - Lecture 12 - Next Generation User Interfaces (4018166FNR)
PDF
T-SQL Data Types (Quick Overview)
PPTX
Getting Started with HTML5 in Tech Com (STC 2012)
PDF
Sql hints
PDF
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
XML on SQL Server
7a advanced tsql
SQL Functions
Sql operators & functions 3
Sql query analyzer & maintenance
SQL Server - Querying and Managing XML Data
Stored-Procedures-Presentation
CSS3 and Responsive Web Design - Web Technologies (1019888BNR)
Course Review - Lecture 12 - Next Generation User Interfaces (4018166FNR)
T-SQL Data Types (Quick Overview)
Getting Started with HTML5 in Tech Com (STC 2012)
Sql hints
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Ad

Similar to Sql Server execution plans (20)

PPTX
Database Performance
PPS
01 qmds2005 session01
PPTX
Sql performance tuning
PDF
Brad McGehee Intepreting Execution Plans Mar09
PDF
Brad McGehee Intepreting Execution Plans Mar09
PDF
Discovering the Plan Cache (#SQLSat 206)
PDF
Discovering the plan cache (#SQLSat211)
PDF
What Is SQL Server 2012?
PPT
Introduction to Threading in .Net
PPTX
Geek Sync | Understand Indexes to Write Better Queries
PPTX
dotnetMALAGA - Sql query tuning guidelines
PPTX
Sql server introduction fundamental
PPTX
We Don't Need Roads: A Developers Look Into SQL Server Indexes
PDF
SqlDay 2018 - Brief introduction into SQL Server Execution Plans
PPTX
Presentación Oracle Database Migración consideraciones 10g/11g/12c
PDF
Bn 1019 demo sql server 2012
PDF
Sql server common interview questions and answers
PPT
New features of sql server 2005
PDF
Discovering the plan cache (sql sat175)
PDF
Introduction to sql server
Database Performance
01 qmds2005 session01
Sql performance tuning
Brad McGehee Intepreting Execution Plans Mar09
Brad McGehee Intepreting Execution Plans Mar09
Discovering the Plan Cache (#SQLSat 206)
Discovering the plan cache (#SQLSat211)
What Is SQL Server 2012?
Introduction to Threading in .Net
Geek Sync | Understand Indexes to Write Better Queries
dotnetMALAGA - Sql query tuning guidelines
Sql server introduction fundamental
We Don't Need Roads: A Developers Look Into SQL Server Indexes
SqlDay 2018 - Brief introduction into SQL Server Execution Plans
Presentación Oracle Database Migración consideraciones 10g/11g/12c
Bn 1019 demo sql server 2012
Sql server common interview questions and answers
New features of sql server 2005
Discovering the plan cache (sql sat175)
Introduction to sql server
Ad

More from Florin Cardasim (10)

PPTX
Netug 18 dec2013-a bus ride to happiness
PDF
Targul de Cariere Iasi 22 Oct 2013- We Are Living in Amazing Times
PPTX
ItCamp2012-Real-Time-Web-Web-Sockets-Windows 8- Florin-Cardasim
PPTX
Endava Career Days Jan 2012 Analysis and Architecture in Endava
PPTX
Codecamp Iasi-26 nov 2011 - Html 5 WebSockets
PPTX
ITCamp 2011 - Florin Cardasim - Duplex Communications with WCF and Azure
PPTX
CLR threads
PPTX
WCF from the web developer
PPTX
News In Wcf40
PPTX
News In The Net40
Netug 18 dec2013-a bus ride to happiness
Targul de Cariere Iasi 22 Oct 2013- We Are Living in Amazing Times
ItCamp2012-Real-Time-Web-Web-Sockets-Windows 8- Florin-Cardasim
Endava Career Days Jan 2012 Analysis and Architecture in Endava
Codecamp Iasi-26 nov 2011 - Html 5 WebSockets
ITCamp 2011 - Florin Cardasim - Duplex Communications with WCF and Azure
CLR threads
WCF from the web developer
News In Wcf40
News In The Net40

Sql Server execution plans

Editor's Notes

  • #5: Startamdiscutia cu imaginea care descriearhitectura SQL Server. Din multitudinea de componente ne indreptamatentiacatre Query Engine(Processor) si Storage Engine. Pescurt, Query Engine ia in primire un statement SQL, ilparseazasi in urmaunoranalize produce ceeace se numeste Query Plan.Acest plan estetrimis (in format binar) la Storage Engine care esteresposnsabil cu accesulfizic la date. Discutia de astazi se limiteaza la Query Engine sioutputulacestuia Query Plan. Vomintelegeimpreunaceeste un Query plan, cum se poateobtine, citisiinterpreta.
  • #6: Scopulunui Query Plan esteacela de a descoperipasiiprin care rezolva query-ulcu un consum minimum de apeluri de I/O (disk) si CPU. Cost-based plan.Serverulcreazamaimulte Query Planurisi decide pe care ilutilizeazasianumepecel cu costul minim.Serverulmentinestatisticidespredistributiasiselectivitatea (unicitatea) valorilor din coloanesiindecsi.Implicit, statisticile se mentin automat la fiecare insert, update, joinsiasamaideparte.Planulestepasatcatre Storage Engine, care ilexecuta. E posibil ca planulsa nu fie respectatde Storage Engine in cazul in care statisticile nu maisuntactuale in momentulefectiv al rularii.Planul actual siplanulestimatcelestimatestecalculatfara a rulaefectiv query-ul, cidoarpebazastatisticilorcel actual esteplanulutilizat la rularea query-uluiPlanul actual poatediferi de celestimat, in principal din doua motive: statisticilesuntincorecte (in timpelesuntalterate un urmaoperatiunilor de insert, update, delete) sau e vorba de planuri care utilizeazaparalelismsi care la momentulrulariidecid ca paraelismul nu se maipoateefectua din motive cum arfilipsamemorieisau a threadurilorlibere.Planurile de executiesunt cache-uite cu scopul de a fireutilizate. Cum crearea un pan esteO operatiecostisitoare, intr-un sistem in care se ajunge la o bunareutilizare a planurilor, se obtincastiguriconsiderabile de performanta. Exista o schema de imbatranire a planurilor deexecutiepebazacareiaplanurilesuntscoasetreptat din cache (pentru a nu se consumainutilmemorie)DBCC FREEPROCACHE – curata cache-ul, util la testare
  • #7: Cum se vizualizeazaplanulestimatsicel actual in format Text, XML siGraficCum se automatizeazaproducerea de planurifolosind Profiler; cum se salveaza un plan XML pentru a fireutilizatmaitarziuCum se foloseste Tuning Advisor;.trc, .sql