Solved

SQL Server Needs constant sp_UpdateStats to Run Fast

Posted on 2009-05-13
2
1,085 Views
Last Modified: 2013-11-27
I'm running SQL Server Express 2005 with a 2.5 GB data file and Access 2003 programs are used as an interface to the data.  I've upsized to SQL Server over a year ago, and periodically, a couple of Access Forms (ones that run a particular stored procedure) would slow down, and running "sp_updatestats" on the database would always speed those forms back up.  Last week, however, all of the forms in all of the Access databases were really slow.  What usually takes 40 seconds to process was taking 1 minute and 40 seconds.  So for the first time in over a year I reindexed the database with the following script given to me by a friend ...

EXECUTE master.dbo.xp_sqlmaint N'-D Altek -Rpt "C:\sql\results\Sunday_Maint_DBCC.txt" -DelTxtRpt 4WEEKS -WriteHistory -CkDB -CkAl -CkTxtAl -CkCat'

EXECUTE master.dbo.xp_sqlmaint N'-D Altek -Rpt "C:\sql\results\Sunday_APP_Maint_Rebuild_Indexes.txt" -DelTxtRpt 4WEEKS -WriteHistory  -RebldIdx 100'

DBCC UPDATEUSAGE (Altek) with no_infomsgs

......

I ran this on Sunday night.  It seemed to have sped the programs up.  However, again, on Monday, I had to run sp_updatestats to speed up 2 of the Access forms when they slowed down and it worked.  Now today, like last week, all of the forms in all of the applications slowed down to a crawl again like last week.  I ran sp_updatestats and it seemed to speed the programs up, however, I need to find a different solution than to keep running sp_updatestats every time the programs slow down.  Also, we've been using the programs with SQL Server for over a year and never has the system slowed down as much as last week and today.  What can I do to prevent the programs from slowing down so much?
0
Comment
Question by:Declan_Basile
2 Comments
 
LVL 41

Accepted Solution

by:
pcelba earned 260 total points
ID: 24378897
sp_updatestats updates statistics which are indexes in fact but they are static (not updated when data are updated), so you should create additional indexes based on info from these staistics and the query speed should remain moreless unchanged all the time.
0
 
LVL 8

Assisted Solution

by:ludo_friend
ludo_friend earned 240 total points
ID: 24381668
on a 2.5gb db, no query should really take that long. I'd say your issue here is to do with indexing more then statistics.  
if you have a full sql 2005 server available, I'd get a copy of the db put on the full sql server, a single client connected to it, use Database Engine Tuning Advisor to recommend changes which you can assess and apply if need be.  the database engine tuning advisor does NOT run on sql express.
I'd also check our your servers physical ram, how much sql is using and how much is left. I've found a bit of extra am goes a long way performance-wise.

hope the above helps
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Viewers will learn how the fundamental information of how to create a table.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now