T Sql Performance Practices

593 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

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

No notes for slide

T Sql Performance Practices

  1. 1. Performance Enhancing T-SQL Queries and Stored Procedures Iwan de Beer
  2. 2.  Analysing Queries  Filtering Results  Batching Operations  Performance Killers
  3. 3.  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
  4. 4.  Ensure your queries have WHERE clauses  Select as little data as possible into Temporary Tables  Avoid SELECT * - return subsets of columns
  5. 5.  Avoid Cursors  Perform operations in Batches  Use Temporary Tables
  6. 6.  Slow Triggers impact on insert, update, and/or delete statements  Missing / Inappropriate Indexes slows down SELECT statements
  7. 7.  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

×