Monica Rathbun truncates some data:
SQL Server performance issues often stem from easy fix bottle necks that can be fixed with the right tuning strategies. This short blog will focus on the DELETE statement.
Click through for the full story. One minor correction that I’d offer is that the TRUNCATE TABLE
command is logged, which is why you can roll it back in a transaction. The logging process is much less intensive than with DELETE
because of the deferred drop logic that Paul talks about in the link.
That aside, Monica’s key point is absolutely correct: DELETE
operations tend to be quite slow, especially as the number of records you need to delete increases. This is where techniques like batching delete operations can help reduce the pain level, but if you’re deleting every (or almost every) row from a table, there’s probably a better method. Unless replication is involved in the mix—in that case, there are no good methods for anything because replication hates us.