|
Hi All,
I have optimized one store procedure. Original is taking 35 seconds to take data and new SP is taking more than 1 min.
So, I tried to make the replica of same SP with the same code, even that is taking more than 1 min.
Summary is, new replica of same SP is taking also more than 1 min.
Please suggests, if any one faced this issue. This is very urgent issue.
Thanks,
|
|
|
|
|
Start by reading the text at the top of the page and you will see in bright red letters that this isn't the place for technical queries. So if you want to make people happy, post this in the right place. Happy people give better help than annoyed ones do...
Post it here:http://www.codeproject.com/Questions/ask.aspx[^] but think first: Remember that we can't see your screen, access your HDD, or read your mind - we only get what you tell us to work from. So write your question based on that!
Explain exactly what you have tried, and where you are stuck. The more accurate you are the better the response.
Oh, and don't stress the urgency - every question is urgent to the person who needs an answer! All that your stressing the urgency does is to make us think you have left it too late, and want us to do it for you. This annoys some people, and can slow a response.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Have you tried turning it off and on again?
|
|
|
|
|
Yes, I did these all things....please suggest...
|
|
|
|
|
Please explain the exact procedure you used to turn a stored procedure off and back on again.
As you may know, there are many ways to do this, and some are more effective than others...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
As OriginalGriff suggested in his message[^].
Post the question in either
Database Discussion Boards[^]
Ask a Question[^]
I wouldn't post in both though, just pick one. By asking the question in one of these forums you will get a more suggestions on what to try. but please remember to give as much information as possible
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
Your optimisation is wrong.
|
|
|
|
|
Which is why, problem is same SP taking more than 1 min, no new code....please suggest....
|
|
|
|
|
I suggest you go to a proper technical forum and post a proper detailed question.
|
|
|
|
|
His optimism is wrong as well!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Yet he remains optimistic that some one will help
|
|
|
|
|
|
hmmm, is that why I always got hungry and started drooling when the school bell rang?
|
|
|
|
|
Thanks for all, my challenge is the below code. If I am not using it then SP is taking 6 seconds to get data and after using it, taking more then 1 min
Please do you have any idea to optimize it
----------------------------------------------------
Update TMP1
Set DriverID = FDR.DriverID,
CompanyID = CDT.CompanyName
from @TempTable1 TMP1
Inner Join (Select FaxID, CompanyID, LTrim(Replace(Stuff((Select ', ' + ISNULL(Cast(FD1.DriverID as varchar(10)),'') From FaxId_Document_Relation FD1 Where FD1.FaxID = FD2.FaxID For XML PATH ('')),1,1,''),' ,','')) as DriverID
From FaxId_Document_Relation FD2
Where FaxID in (select FaxID from @TempTable1)
Group By FaxID, CompanyID) as FDR ON TMP1.FaxID = FDR.FaxID
--Inner Join CustomerDetails CDT on CDT.CompanyID = FDR.CompanyID --Anoop
Inner Join (select CompanyID, CompanyName from CustomerDetails) as CDT on CDT.CompanyID = FDR.CompanyID
|
|
|
|
|
What part of this:
Quote: Start by reading the text at the top of the page and you will see in bright red letters that this isn't the place for technical queries. So if you want to make people happy, post this in the right place. Happy people give better help than annoyed ones do... did you assume does not apply to you?
You have been told, you ignore it.
You are showing yourself to be rude, arrogant, and uncaring. Why the heck should we try to help you if you just assume that the rules do not apply to you?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Sir, I optimized now and time decrease from 35 secs to 6 secs...
Thanks for your valuable support...
|
|
|
|
|
OriginalGriff wrote: did you assume does not apply to you?
Apparently not. He posted the question and somehow his problem got fixed without one post that addressed it.
I wonder if I can get code written for myself the same way?
|
|
|
|
|
ya know what would really get it?
That (in Unicode and therefore .net) NULL-characters are allowed in strings yet aren't considered whitespace.
modified 5-Apr-18 17:31pm.
|
|
|
|
|
|
You rotten so and so - I followed your link and seriously though "that can't be right"
I then used google and it made a lot more sense.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
A NULL character is part and parcel of a string. Otherwise you need some form of counted string,, otherwise the length is undetermined.
modified 5-Apr-18 4:14am.
|
|
|
|
|
The string is over when the fat lady sings.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
In .Net, string is a class, and has a length variable, so can contain NULL in the middle. Just like the std::string class in C++.
FWIW, I thought the Pascal style of having the length in the first char was quite neat (though that limited it to strings of < 255 characters).
|
|
|
|
|
Like the UNICODE_STRING we use in the kernel, it contains a length member and a pointer to the string data.
Orjan Westin wrote: can contain NULL in the middle
SOunds a bit like a multi string, nulls in the middle, ,two at the end.
Why would you want a null in the middle of a string though? How does it make it useful?
|
|
|
|
|
If you have a good old VT-52, it finally gets something it can safely ignore:
Quote: <nul> 00 Null Never affects the device. <nul> codes are always ignored wherever they appear in the character stream.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|