Have a quick general question. I have a table I'm trying to purge a table. I'm deleting using a WHILE
loop with WAITFOR DELAY
time of 50ms between batches and 2000 records per batch. The real issue is that as time progresses the number of records deleted drops over time. Refer to the following:
Minute Number | Number of Records Deleted:
1 | 162,000
2 | 116,000
3 | 80,000
4 | 72,000
5 | 62,000
6 | 38,000
7 | 38,000
8 | 34,000
9 | 20,000
Wondering if there is something fundamental about using WHILE
loop batches for deleting records that causes the performance to degrade with each iteration of the loop. we have been manually watching the performance and then stopping the proc as the performance begins to drop drastically around the 5th to 6th minute and then restarting the deployment again. We don't think its a locking issue directly because as we play with the batch size the performance is always dropping at around the 5 to 6 minute mark.