Hi all
I have a SP that beahves strange. Originally it takes about 20 milliseconds
to complete, but sometimes it starts going slow and take about 5-7 seconds.
When this happens, it keeps going slow until I drop the SP and re-create it.
I tried to run the SQL body of the SP in the Query analyzer, and it runs
fast (20 ms), while the SP takes 5-7 seconds (before it is re-created).
Does anyone knows what can cause this and what is the soloution ?
TIA
Boaz Ben-Porat
Milestone SystemsSounds like the execution plan deviates significantly from the actual
data over time. You may want to try using the WITH RECOMPILE option to
force the SP to recompile every time it runs.
Stu
Monday, March 19, 2012
A stored-procedure becomes slow and needs re-creation
Labels:
5-7,
alli,
beahves,
becomes,
complete,
database,
microsoft,
millisecondsto,
mysql,
oracle,
originally,
re-creation,
server,
slow,
sql,
starts,
stored-procedure,
strange
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment