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?