How to speed up the deletion of large amounts of list items within SharePoint
If you have code which deletes a lot of items from a SharePoint list (“clear the list”) your best only friend is the ProcessBatchData-Method of the current SPWeb-object.
Recycling will slow you down…
Every item you delete will be stored in the recycle-bin of your site and later in the recycle-bin of your site-collection.
…so simply stop recycling!
To speed up the process even more you should disable the recycle-bin for the time of the deletion-process.
// web is a the SPWeb object your lists belong to // Before starting your deletion web.Site.WebApplication.RecycleBinEnabled = false; // When your are finished re-enable it web.Site.WebApplication.RecycleBinEnabled = true;
- April 2nd
You should mention that setting RecycleBinEnabled = false; deletes all files in the recyclebin…