cynx
asked on
SP with Cursor all of sudden very slow
I have a SP which loads about 1.7 million records into a temp table, and then fetches each of those records and performs few checks to update records in physical tables
The part which loads records in temp table is quick - 1 min. however the remaining part is taking very long all of sudden.
Previously, entire SP used to query records in 3 mins. Now it takes 4-5 hours.
Any idea what could be causing this and what should I look for to get this sorted?
Thanks
The part which loads records in temp table is quick - 1 min. however the remaining part is taking very long all of sudden.
Previously, entire SP used to query records in 3 mins. Now it takes 4-5 hours.
Any idea what could be causing this and what should I look for to get this sorted?
Thanks
ASKER
could there be issues with memory on the server?
ASKER
the code is too huge to be posted.
Like Scott said, it's impossible to know what the problem is without seeing your queries and plans.
The code "being too huge to be posted" is never a good sign... Can you save it to file and attach it?
The code "being too huge to be posted" is never a good sign... Can you save it to file and attach it?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Has an index "disappear" ?
But you may be able to avoid the cursor and give yourself vastly better speed overall anyway. Can't say for sure w/o seeing the code.