Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quick query slow stored procedure...

Status
Not open for further replies.

GShort

MIS
Apr 20, 2005
70
US
Hello all,

We currently have a stored procedure that is giving us fits. We use this stored procedure on a web site to give our sale staff there stats.

This stored procedure seems to run fine at first but slows done after time. We found that if we run the stored procedures code (we physicaly change the website to run from the SQL code on the site instead of the stored procedure) the stored procedure then runs fast again after changing it back.

Any Suggestions would be great.
 
What is the time frame over the slow down. Is it over the course of a single day or many days?
How often do you update your statistics?

- Paul
10qkyfp.gif

- If at first you don't succeed, find out if the loser gets anything.
 
It is usally about a day and the data is is off of live data. There are two variables of start date and end date.
 
You can get back that credit by mentioning that WITH RECOMPILE is only one option, another would be to use something like...

OPTION (HASH JOIN)

...to force a particular join approach within the SQL statement(s) - if that is where the original problem lies :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top