Stumbled across some deadlocks in one of our content databases that i could track down to some workflows wrecking havoc in a site collection by creating over a million of list items in multiple workflow history lists. I'm afraid that this has a negative impact on the sites and the user experience.
After some research i found a couple of PowerShell Scripts that does a bulk-delete operation against a list and a console application that does the same.
I also read about SharePoints Information Management Policy that has the option to instantly delete list items without putting them in the recycle bin (i guess that they are deleted instantly from the database) based on some conditions and there are 2 timer jobs related, one that picks up new policies and one that does the actual job.
I wonder if anyone could share some details how the second timer job that executes the policy on the list works, and if it would be better in a performance perspective to run a script or use the policy to get rid of all the list items.
I saw that the timer job runs on saturday by default which is good, but is there any risk to make the policy delete all the items in an instant or would it be better to batch delete items based on a date condition (like created + 1/2/3 months old items and so on?) and run the timer job multiple times manually?