SlideShare une entreprise Scribd logo
1  sur  9
SQL Server 2005 – Reading and Interpreting Query Plans Florin Cardaşim Lead developer RomSoft, IAŞI,http://www.rms.ro
Agenda ,[object Object]
One-table SELECT
Table Join SELECT
INSERT, UPDATE, DELETE,[object Object]
Demo The tools: ,[object Object]
Server Profiler

Contenu connexe

En vedette

XML on SQL Server
XML on SQL ServerXML on SQL Server
XML on SQL Servertorp42
 
7a advanced tsql
7a   advanced tsql7a   advanced tsql
7a advanced tsqlNauman R
 
Sql query analyzer & maintenance
Sql query analyzer & maintenanceSql query analyzer & maintenance
Sql query analyzer & maintenancenspyrenet
 
SQL Server - Querying and Managing XML Data
SQL Server - Querying and Managing XML DataSQL Server - Querying and Managing XML Data
SQL Server - Querying and Managing XML DataMarek Maśko
 
Stored-Procedures-Presentation
Stored-Procedures-PresentationStored-Procedures-Presentation
Stored-Procedures-PresentationChuck Walker
 
CSS3 and Responsive Web Design - Web Technologies (1019888BNR)
CSS3 and Responsive Web Design - Web Technologies (1019888BNR)CSS3 and Responsive Web Design - Web Technologies (1019888BNR)
CSS3 and Responsive Web Design - Web Technologies (1019888BNR)Beat Signer
 
Course Review - Lecture 12 - Next Generation User Interfaces (4018166FNR)
Course Review - Lecture 12 - Next Generation User Interfaces (4018166FNR)Course Review - Lecture 12 - Next Generation User Interfaces (4018166FNR)
Course Review - Lecture 12 - Next Generation User Interfaces (4018166FNR)Beat Signer
 
T-SQL Data Types (Quick Overview)
T-SQL Data Types (Quick Overview)T-SQL Data Types (Quick Overview)
T-SQL Data Types (Quick Overview)Naji El Kotob
 
Getting Started with HTML5 in Tech Com (STC 2012)
Getting Started with HTML5 in Tech Com (STC 2012)Getting Started with HTML5 in Tech Com (STC 2012)
Getting Started with HTML5 in Tech Com (STC 2012)Peter Lubbers
 
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...Beat Signer
 

En vedette (14)

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

Similaire à Sql Server execution plans

Reports with SQL Server Reporting Services
Reports with SQL Server Reporting ServicesReports with SQL Server Reporting Services
Reports with SQL Server Reporting ServicesPeter Gfader
 
Sql Summit Clr, Service Broker And Xml
Sql Summit   Clr, Service Broker And XmlSql Summit   Clr, Service Broker And Xml
Sql Summit Clr, Service Broker And XmlDavid Truxall
 
Sql tuning guideline
Sql tuning guidelineSql tuning guideline
Sql tuning guidelineSidney Chen
 
SQL Server Denali: BI on Your Terms
SQL Server Denali: BI on Your Terms SQL Server Denali: BI on Your Terms
SQL Server Denali: BI on Your Terms Andrew Brust
 
A Primer To Sybase Iq Development July 13
A Primer To Sybase Iq Development July 13A Primer To Sybase Iq Development July 13
A Primer To Sybase Iq Development July 13sparkwan
 
PLSQL - Raymond Wu
PLSQL - Raymond WuPLSQL - Raymond Wu
PLSQL - Raymond Wuraymond wu
 
3 CityNetConf - sql+c#=u-sql
3 CityNetConf - sql+c#=u-sql3 CityNetConf - sql+c#=u-sql
3 CityNetConf - sql+c#=u-sqlŁukasz Grala
 
Joel Chamberlain Business Intelligence Portfolio
Joel Chamberlain Business Intelligence PortfolioJoel Chamberlain Business Intelligence Portfolio
Joel Chamberlain Business Intelligence Portfoliojwchamb
 
Taming the Data Science Monster with A New ‘Sword’ – U-SQL
Taming the Data Science Monster with A New ‘Sword’ – U-SQLTaming the Data Science Monster with A New ‘Sword’ – U-SQL
Taming the Data Science Monster with A New ‘Sword’ – U-SQLMichael Rys
 
vinay reddy resume 2yrs
vinay reddy resume 2yrsvinay reddy resume 2yrs
vinay reddy resume 2yrsVinay Reddy
 
Oracle application express
Oracle application expressOracle application express
Oracle application expressAbhinaw Kumar
 
Bi Ppt Portfolio Elmer Donavan
Bi Ppt Portfolio  Elmer DonavanBi Ppt Portfolio  Elmer Donavan
Bi Ppt Portfolio Elmer DonavanEJDonavan
 

Similaire à Sql Server execution plans (20)

It ready dw_day3_rev00
It ready dw_day3_rev00It ready dw_day3_rev00
It ready dw_day3_rev00
 
Reports with SQL Server Reporting Services
Reports with SQL Server Reporting ServicesReports with SQL Server Reporting Services
Reports with SQL Server Reporting Services
 
Resume_of_sayeed
Resume_of_sayeedResume_of_sayeed
Resume_of_sayeed
 
Sql Summit Clr, Service Broker And Xml
Sql Summit   Clr, Service Broker And XmlSql Summit   Clr, Service Broker And Xml
Sql Summit Clr, Service Broker And Xml
 
Sql tuning guideline
Sql tuning guidelineSql tuning guideline
Sql tuning guideline
 
SQL Server Denali: BI on Your Terms
SQL Server Denali: BI on Your Terms SQL Server Denali: BI on Your Terms
SQL Server Denali: BI on Your Terms
 
resume
resumeresume
resume
 
Wangshuang
Wangshuang Wangshuang
Wangshuang
 
A Primer To Sybase Iq Development July 13
A Primer To Sybase Iq Development July 13A Primer To Sybase Iq Development July 13
A Primer To Sybase Iq Development July 13
 
PLSQL - Raymond Wu
PLSQL - Raymond WuPLSQL - Raymond Wu
PLSQL - Raymond Wu
 
3 CityNetConf - sql+c#=u-sql
3 CityNetConf - sql+c#=u-sql3 CityNetConf - sql+c#=u-sql
3 CityNetConf - sql+c#=u-sql
 
Joel Chamberlain Business Intelligence Portfolio
Joel Chamberlain Business Intelligence PortfolioJoel Chamberlain Business Intelligence Portfolio
Joel Chamberlain Business Intelligence Portfolio
 
Resume (1)
Resume (1)Resume (1)
Resume (1)
 
Resume (1)
Resume (1)Resume (1)
Resume (1)
 
James Henry Robinson
James Henry RobinsonJames Henry Robinson
James Henry Robinson
 
James Henry Robinson
James Henry RobinsonJames Henry Robinson
James Henry Robinson
 
Taming the Data Science Monster with A New ‘Sword’ – U-SQL
Taming the Data Science Monster with A New ‘Sword’ – U-SQLTaming the Data Science Monster with A New ‘Sword’ – U-SQL
Taming the Data Science Monster with A New ‘Sword’ – U-SQL
 
vinay reddy resume 2yrs
vinay reddy resume 2yrsvinay reddy resume 2yrs
vinay reddy resume 2yrs
 
Oracle application express
Oracle application expressOracle application express
Oracle application express
 
Bi Ppt Portfolio Elmer Donavan
Bi Ppt Portfolio  Elmer DonavanBi Ppt Portfolio  Elmer Donavan
Bi Ppt Portfolio Elmer Donavan
 

Plus de Florin Cardasim

Netug 18 dec2013-a bus ride to happiness
Netug 18 dec2013-a bus ride to happinessNetug 18 dec2013-a bus ride to happiness
Netug 18 dec2013-a bus ride to happinessFlorin Cardasim
 
Targul de Cariere Iasi 22 Oct 2013- We Are Living in Amazing Times
Targul de Cariere Iasi 22 Oct 2013- We Are Living in Amazing TimesTargul de Cariere Iasi 22 Oct 2013- We Are Living in Amazing Times
Targul de Cariere Iasi 22 Oct 2013- We Are Living in Amazing TimesFlorin Cardasim
 
ItCamp2012-Real-Time-Web-Web-Sockets-Windows 8- Florin-Cardasim
ItCamp2012-Real-Time-Web-Web-Sockets-Windows 8- Florin-CardasimItCamp2012-Real-Time-Web-Web-Sockets-Windows 8- Florin-Cardasim
ItCamp2012-Real-Time-Web-Web-Sockets-Windows 8- Florin-CardasimFlorin Cardasim
 
Endava Career Days Jan 2012 Analysis and Architecture in Endava
Endava Career Days Jan 2012 Analysis and Architecture in EndavaEndava Career Days Jan 2012 Analysis and Architecture in Endava
Endava Career Days Jan 2012 Analysis and Architecture in EndavaFlorin Cardasim
 
Codecamp Iasi-26 nov 2011 - Html 5 WebSockets
Codecamp Iasi-26 nov 2011 - Html 5 WebSocketsCodecamp Iasi-26 nov 2011 - Html 5 WebSockets
Codecamp Iasi-26 nov 2011 - Html 5 WebSocketsFlorin Cardasim
 
ITCamp 2011 - Florin Cardasim - Duplex Communications with WCF and Azure
ITCamp 2011 - Florin Cardasim - Duplex Communications with WCF and AzureITCamp 2011 - Florin Cardasim - Duplex Communications with WCF and Azure
ITCamp 2011 - Florin Cardasim - Duplex Communications with WCF and AzureFlorin Cardasim
 
WCF from the web developer
WCF from the web developerWCF from the web developer
WCF from the web developerFlorin Cardasim
 

Plus de Florin Cardasim (10)

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

Sql Server execution plans

Notes de l'éditeur

  1. 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.
  2. 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
  3. 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