SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 SQL 2000 Sudden performance drop
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Fletch
Starting Member

United Kingdom
29 Posts

Posted - 05/31/2007 :  06:33:01  Show Profile  Reply with Quote
I realise there must be many threads about performance but having done some reading I'm still none the wiser.

We have a regular job that adds data to the database. What used to run in a couple of seconds now (suddenly) takes a few minutes to run.

I have a copy of the database on a different machine; same data, same volume of data (around 7gig) and it still runs fast there.

Given that the problem appears to be environmental I've had a look at memory usage, Disk Queue, Pages/sec etc.

While the importer runs:
% Processor goes up to 50% (all of 1 processor)
The Avg. Disk Queue goes above 100 for a few seconds at a time.
The buffer cache stays close to 100%

My pagefile usage remains at around 90% of 2gig all the time (I have 2gig of RAM)

Any advice hugely appreciated.

Kristen
Test

United Kingdom
22431 Posts

Posted - 05/31/2007 :  07:54:27  Show Profile  Reply with Quote
Are the statistics updated regularly?
Are the indexes rebuilt regularly?

Are the indexes the same on both machines? (Number, and DDL, of the indexes)

Kristen
Go to Top of Page

Fletch
Starting Member

United Kingdom
29 Posts

Posted - 05/31/2007 :  08:15:31  Show Profile  Reply with Quote
I've never (knowingly) update the statistics.
I did a defrag on the indexes and then a full rebuild of them.

Things appeared to improve a little but it's still taking five minutes to run what used to be a 10 second job.

I believe the indexes are the same on both machines. The second (faster) machine database was a restore of the live a couple of months ago, and updated in parallel ever since.
Go to Top of Page

rmiao
Flowing Fount of Yak Knowledge

USA
7266 Posts

Posted - 05/31/2007 :  10:10:45  Show Profile  Reply with Quote
Rebuilding index will update statistics, but how often do you do that? Did you rebuild clustered index? If not, you can't defrag table.
Go to Top of Page

Fletch
Starting Member

United Kingdom
29 Posts

Posted - 05/31/2007 :  10:30:35  Show Profile  Reply with Quote
I ran a script that claimed to rebuild ALL indexes. I haven't defragged since then (actually I've only ever defragged the indexes rather than the whole table anyway).

I obviously need to look at defragging the tables as well as the indexes.
Will defragging the hard disk make a difference? I assumed SQL would lock it's files on the disk anyway so windows defrag wouldn't make any difference to this particular problem.
Go to Top of Page

Kristen
Test

United Kingdom
22431 Posts

Posted - 05/31/2007 :  10:34:05  Show Profile  Reply with Quote
Update the statistics anyway, it can't hurt! (but it might slow the server for a while whilst updating):

exec sp_UpdateStats

If your "job" calls a Stored Procedure it would be wise to recompile that too, after updating the stats:

EXEC sp_recompile 'MySproc'

Kristen
Go to Top of Page

Fletch
Starting Member

United Kingdom
29 Posts

Posted - 05/31/2007 :  11:12:18  Show Profile  Reply with Quote
Hmmm.
It gets 75% of the way through the job and then perfmon is showing the average disk queue is oscillating between 0 and 100. This must indicate the disk is being hammered. Would this be due to fragmentation or memory being swapped to disk?
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000