Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Updating large table take a long time.

$
0
0

I am trying to write a stored procedure to update a large table  .  The table is around 8M records and each time it will update around 15,000 records. Every time, it takes 60 seconds +  which will end up timing out the page.

I tried couple way to optimized :

1. Partition table

2. Break Down update records to 5000 reach

3.  Update Statistic before running (give 5 seconds improvement)

4. Convert update into insert and then delete old record

Everything I tried does not improve the performance.  I already lowered the the update where clause to pure id .  So almost nothing else I can do on that.

What I notice from the execution plan is that it take a good amount of time to do table spool because of an index. It also spend a good amount  on index scan, Clustered Index Update.

Can an expert give me a way to lower the update time to within 20 seconds?


kenneth


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>