Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Deleting in batch
Message
From
12/04/2016 21:11:30
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
Database management
Title:
Deleting in batch
Environment versions
SQL Server:
SQL Server 2014
OS:
Windows 8.1
Network:
Windows 2008 Server
Miscellaneous
Thread ID:
01634725
Message ID:
01634725
Views:
57
As many are doing, I have to delete in batch in order to be as optimized as possible. So, I delete batches of 2000 records at a time. This is done every 15 minutes and I delete about 50,000 records on each occurence.

This has been working well for two years. We never had one single issue. Over the weekend, on our UAT environment, users on the Web site had dead lock issues because of the delete command executed from a robot. That happened for three days in a row. One occurence would have been a coincidence but not three days.

I have been reading somewhere one person mentioned that the condition to rely on to delete the records would be better to be on a non-clustered index. For now, I have the primary key and that is a clustered index. Can someone comment on that point as to know if it would be preferrable to create one additional field in that big Hit table just for the field to use when comes time to delete?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Next
Reply
Map
View

Click here to load this message in the networking platform