Database Journal
MS SQL Oracle DB2 Access MySQL PostgreSQL Sybase PHP SQL Etc SQL Scripts & Samples Links Database Forum

» Database Journal Home
» Database Articles
» Database Tutorials
MS SQL
Oracle
DB2
MS Access
MySQL
» RESOURCES
Database Tools
SQL Scripts & Samples
Links
» Database Forum
» Sitemap
Free Newsletters:
DatabaseDaily  
News Via RSS Feed


follow us on Twitter
Database Journal |DBA Support |SQLCourse |SQLCourse2
 

Featured Database Articles

MS SQL

Posted Jul 31, 2001

SQL Server Performance Tuning: Pt. 1 - Page 5

By Aaron Goldman

Identifying the Problem

The details from the trace will tell you exactly where your problem is, but you still have to figure out what it is.

The actual process of optimization will be trial and error. You will likely have to run the offending statements several times until you get them right. If your code is essentially a select which doesn't modify data, you can just run it over and over. But if it modifies data you should run it in a transaction/rollback block so you can repeat it:

A simple select:

Select * from authors
  where phone like '408%'

or

exec sp_selectStatement

An updating statement:

begin tran
  go

  update authors
     set phone = 'N/A'
     where phone like '408%'
  go

  rollback
  go

or

begin tran
  go

  exec sp_updatingStatement
  go

  rollback
  go

Use SQL Profiler, Query Analyzer's Show Execution Plan, and/or Statistics IO to see how long each statement is taking paying attention to cpu time.



MS SQL Archives

Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 




Latest Forum Threads
MS SQL Forum
Topic By Replies Updated
SQL 2005: SSIS: Error using SQL Server credentials poverty 3 August 17th, 07:43 AM
Need help changing table contents nkawtg 1 August 17th, 03:02 AM
SQL Server Memory confifuration bhosalenarayan 2 August 14th, 05:33 AM
SQL Server Primary Key and a Unique Key katty.jonh 2 July 25th, 10:36 AM