April 18, 2010 at 11:49 am
Hi Friends
I had one SP which was taking almost 7 minutes to complete the execution. But now I could seen that when I tried to execute the sp it is still executing even after 20 minutes!!! Then I just tried to execute it as a script rather than an SP , the script got completed the execution by the same 7 minutes.
What could be the reason that the SP getting hanged..?
Regards,
MC
Thanks & Regards,
MC
April 18, 2010 at 12:53 pm
Please, please help those who want to help you by posting your problem following the second link in my signature block,for what will help you get a good answer
April 18, 2010 at 10:41 pm
Hi
Ron thanks for reply and sorry for not following the style of posting which you mentioned.
In my case as I told when I executed it as a script it completed the execution as expected and when I dropped and recreated the sp , it got completed execution by 7 minutes as expected.
So I thought it is nothing to do with tuning, and the reason for why the SP took a long time is something else which I dontknow...
Regards,
MC
Thanks & Regards,
MC
April 19, 2010 at 7:01 am
There could be any number of reasons and without more detail, it will be very difficult to guess.
The first two guesses that come to mind are either parameter sniffing or resource contention. But I couldn't be sure either way without a lot more detail. What does the query plan look like when the query runs long? Is it different than when it runs quickly? Have you checked blocking processes on the server while running the query?
That's just the start of the kind of detail that would be needed to provide you with a detailed answer.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 19, 2010 at 9:46 am
Thanks for the reply.
Unfortunately I didn't check these two things... And as I mentioned, when I dropped and recreated the SP it was fine, so no chance to replicate it.. 🙁
Regards,
MC
Thanks & Regards,
MC
April 19, 2010 at 3:22 pm
only4mithunc (4/19/2010)
Thanks for the reply.Unfortunately I didn't check these two things... And as I mentioned, when I dropped and recreated the SP it was fine, so no chance to replicate it.. 🙁
Regards,
MC
That would certainly cause a "recompile" of the proc which will temporarily solve a "parameter sniffing" problem.
--Jeff Moden
Change is inevitable... Change for the better is not.
April 19, 2010 at 7:25 pm
Jeff Moden (4/19/2010)
only4mithunc (4/19/2010)
Thanks for the reply.Unfortunately I didn't check these two things... And as I mentioned, when I dropped and recreated the SP it was fine, so no chance to replicate it.. 🙁
Regards,
MC
That would certainly cause a "recompile" of the proc which will temporarily solve a "parameter sniffing" problem.
Exactly. You might see this problem reappear occasionally.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply