SlideShare ist ein Scribd-Unternehmen logo
1 von 7
Performance Enhancing T-SQL Queries and Stored Procedures




Iwan de Beer
 Analysing Queries

 Filtering Results

 Batching Operations

 Performance Killers
 sp_lock shows which tables are being locked

 sp_who tells you which statements are currently
  running

 The Profiler identifies long running queries

 Query Execution Plans pinpoint bottle-necks
 Ensure your queries have WHERE clauses

 Select as little data as possible into Temporary
  Tables

 Avoid SELECT * - return subsets of columns
 Avoid Cursors

 Perform operations in Batches

 Use Temporary Tables
 Slow Triggers impact on insert, update, and/or
  delete statements

 Missing / Inappropriate Indexes slows down
  SELECT statements
 http://www.mssqlcity.com/Tips/tipTSQL.htm

 http://www.sql-server-performance.com/tips/all_main.aspx

 http://www.codeproject.com/KB/database/sqldodont.aspx

Weitere ähnliche Inhalte

Andere mochten auch

Coding T-SQL in a Team Environment
Coding T-SQL in a Team EnvironmentCoding T-SQL in a Team Environment
Coding T-SQL in a Team EnvironmentMark Ginnebaugh
 
Intro to T-SQL – 2nd session
Intro to T-SQL – 2nd sessionIntro to T-SQL – 2nd session
Intro to T-SQL – 2nd sessionMedhat Dawoud
 
New T-SQL Features in SQL Server 2012
New T-SQL Features in SQL Server 2012 New T-SQL Features in SQL Server 2012
New T-SQL Features in SQL Server 2012 Richie Rump
 
T-SQL performance improvement - session 2 - Owned copy
T-SQL performance improvement - session 2 - Owned copyT-SQL performance improvement - session 2 - Owned copy
T-SQL performance improvement - session 2 - Owned copyDzung Nguyen
 
Advanced t sql - querying and programming inside sql server
Advanced t sql - querying and programming inside sql serverAdvanced t sql - querying and programming inside sql server
Advanced t sql - querying and programming inside sql serverVinod Kumar
 

Andere mochten auch (9)

Coding T-SQL in a Team Environment
Coding T-SQL in a Team EnvironmentCoding T-SQL in a Team Environment
Coding T-SQL in a Team Environment
 
Part 12 t-sql
Part 12  t-sqlPart 12  t-sql
Part 12 t-sql
 
Intro to T-SQL – 2nd session
Intro to T-SQL – 2nd sessionIntro to T-SQL – 2nd session
Intro to T-SQL – 2nd session
 
Writing and optimizing T-SQL
Writing and optimizing T-SQLWriting and optimizing T-SQL
Writing and optimizing T-SQL
 
New T-SQL Features in SQL Server 2012
New T-SQL Features in SQL Server 2012 New T-SQL Features in SQL Server 2012
New T-SQL Features in SQL Server 2012
 
Using T-SQL
Using T-SQL Using T-SQL
Using T-SQL
 
T-SQL Overview
T-SQL OverviewT-SQL Overview
T-SQL Overview
 
T-SQL performance improvement - session 2 - Owned copy
T-SQL performance improvement - session 2 - Owned copyT-SQL performance improvement - session 2 - Owned copy
T-SQL performance improvement - session 2 - Owned copy
 
Advanced t sql - querying and programming inside sql server
Advanced t sql - querying and programming inside sql serverAdvanced t sql - querying and programming inside sql server
Advanced t sql - querying and programming inside sql server
 

Ähnlich wie Enhance SQL Query & Stored Procedure Performance

Web Cloud Computing SQL Server - Ferrara University
Web Cloud Computing SQL Server  -  Ferrara UniversityWeb Cloud Computing SQL Server  -  Ferrara University
Web Cloud Computing SQL Server - Ferrara Universityantimo musone
 
Top 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tipsTop 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tipsNirav Shah
 
Maximizing SAP ABAP Performance
Maximizing SAP ABAP PerformanceMaximizing SAP ABAP Performance
Maximizing SAP ABAP PerformancePeterHBrown
 
Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005rainynovember12
 
Profiling its okay in sql server
Profiling its okay in sql serverProfiling its okay in sql server
Profiling its okay in sql serverunclebiguns
 
Tony Jambu (obscure) tools of the trade for tuning oracle sq ls
Tony Jambu   (obscure) tools of the trade for tuning oracle sq lsTony Jambu   (obscure) tools of the trade for tuning oracle sq ls
Tony Jambu (obscure) tools of the trade for tuning oracle sq lsInSync Conference
 
Oracle database performance tuning
Oracle database performance tuningOracle database performance tuning
Oracle database performance tuningYogiji Creations
 
Tony jambu (obscure) tools of the trade for tuning oracle sq ls
Tony jambu   (obscure) tools of the trade for tuning oracle sq lsTony jambu   (obscure) tools of the trade for tuning oracle sq ls
Tony jambu (obscure) tools of the trade for tuning oracle sq lsInSync Conference
 
Performance tuning
Performance tuningPerformance tuning
Performance tuningami111
 
Sql and PL/SQL Best Practices I
Sql and PL/SQL Best Practices ISql and PL/SQL Best Practices I
Sql and PL/SQL Best Practices ICarlos Oliveira
 
Sql tuning guideline
Sql tuning guidelineSql tuning guideline
Sql tuning guidelineSidney Chen
 
Novidades do SQL Server 2016
Novidades do SQL Server 2016Novidades do SQL Server 2016
Novidades do SQL Server 2016Marcos Freccia
 
Understanding System Performance
Understanding System PerformanceUnderstanding System Performance
Understanding System PerformanceTeradata
 
SQL Server 2016 novelties
SQL Server 2016 noveltiesSQL Server 2016 novelties
SQL Server 2016 noveltiesMSDEVMTL
 
Sql coding-standard-sqlserver
Sql coding-standard-sqlserverSql coding-standard-sqlserver
Sql coding-standard-sqlserverlochaaaa
 
Database development coding standards
Database development coding standardsDatabase development coding standards
Database development coding standardsAlessandro Baratella
 
SQL Server 2008 Development for Programmers
SQL Server 2008 Development for ProgrammersSQL Server 2008 Development for Programmers
SQL Server 2008 Development for ProgrammersAdam Hutson
 
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...Alex Zaballa
 

Ähnlich wie Enhance SQL Query & Stored Procedure Performance (20)

Web Cloud Computing SQL Server - Ferrara University
Web Cloud Computing SQL Server  -  Ferrara UniversityWeb Cloud Computing SQL Server  -  Ferrara University
Web Cloud Computing SQL Server - Ferrara University
 
Top 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tipsTop 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tips
 
Maximizing SAP ABAP Performance
Maximizing SAP ABAP PerformanceMaximizing SAP ABAP Performance
Maximizing SAP ABAP Performance
 
Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005
 
Profiling its okay in sql server
Profiling its okay in sql serverProfiling its okay in sql server
Profiling its okay in sql server
 
SQL Tunning
SQL TunningSQL Tunning
SQL Tunning
 
Tony Jambu (obscure) tools of the trade for tuning oracle sq ls
Tony Jambu   (obscure) tools of the trade for tuning oracle sq lsTony Jambu   (obscure) tools of the trade for tuning oracle sq ls
Tony Jambu (obscure) tools of the trade for tuning oracle sq ls
 
Oracle database performance tuning
Oracle database performance tuningOracle database performance tuning
Oracle database performance tuning
 
Tony jambu (obscure) tools of the trade for tuning oracle sq ls
Tony jambu   (obscure) tools of the trade for tuning oracle sq lsTony jambu   (obscure) tools of the trade for tuning oracle sq ls
Tony jambu (obscure) tools of the trade for tuning oracle sq ls
 
Performance tuning
Performance tuningPerformance tuning
Performance tuning
 
Sql and PL/SQL Best Practices I
Sql and PL/SQL Best Practices ISql and PL/SQL Best Practices I
Sql and PL/SQL Best Practices I
 
Sql tuning guideline
Sql tuning guidelineSql tuning guideline
Sql tuning guideline
 
Novidades do SQL Server 2016
Novidades do SQL Server 2016Novidades do SQL Server 2016
Novidades do SQL Server 2016
 
Using AWR for SQL Analysis
Using AWR for SQL AnalysisUsing AWR for SQL Analysis
Using AWR for SQL Analysis
 
Understanding System Performance
Understanding System PerformanceUnderstanding System Performance
Understanding System Performance
 
SQL Server 2016 novelties
SQL Server 2016 noveltiesSQL Server 2016 novelties
SQL Server 2016 novelties
 
Sql coding-standard-sqlserver
Sql coding-standard-sqlserverSql coding-standard-sqlserver
Sql coding-standard-sqlserver
 
Database development coding standards
Database development coding standardsDatabase development coding standards
Database development coding standards
 
SQL Server 2008 Development for Programmers
SQL Server 2008 Development for ProgrammersSQL Server 2008 Development for Programmers
SQL Server 2008 Development for Programmers
 
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
 

Enhance SQL Query & Stored Procedure Performance