THE SQL Server Blog Spot on the Web

Welcome to - The SQL Server blog spot on the web Sign in | |
in Search

John Paul Cook

Minimally Logged Deletes - please vote!

I posted a suggestion for a minimally logged delete feature on Connect: There is a legitimate need for minimal logging of deletes. Just because deletes need to be able to be rolled back in most cases doesn't invalidate the need for minimal logging at other times. Bulk deletes are necessary at times. When large amounts of data are deleted, the transaction log grows. Sometimes deletes bloat the log so much that the server stops because it doesn't have any space left for the log to grow. If a minimally logged delete is made available, I won't care if it fails and it can't roll back. I'll just issue the command again. I don't want recoverability and I certainly don't want log growth when I'm doing a bulk delete. Imagine a TRUNCATE with a where clause - that's the general concept.
Published Monday, November 9, 2009 2:24 PM by John Paul Cook

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS



a.m. said:

Hi John,

How do you expect this to work internally? It seems to me that there are a number of reasons that you can't do this today, including: RI needs to be maintained, which requires a check before deleting each row on a page. Index maintenance may have to be done to keep the linked list up to date; you can't just deallocate the page and update the IAM. And then there is the issue of having to find and lock the pages that need to be deallocated, which could lead to concurrency issues (of course, that could be avoided if a TABLOCK hint is required). It seems like a great idea, but unless the SQL Server team has solved these problems it would be impossible to implement. Do you have ideas around how this should work?

November 9, 2009 4:08 PM

John Paul Cook said:

In the actual Connect post, I outlined a procedure many people use as a workaround. I'm sure the product team can come up with something much better.

November 9, 2009 4:39 PM

Leave a Comment


About John Paul Cook

John Paul Cook is a database and Azure specialist in Houston. He previously worked as a Data Platform Solution Architect in Microsoft's Houston office. Prior to joining Microsoft, he was a SQL Server MVP. He is experienced in SQL Server and Oracle database application design, development, and implementation. He has spoken at many conferences including Microsoft TechEd and the SQL PASS Summit. He has worked in oil and gas, financial, manufacturing, and healthcare industries. John is also a Registered Nurse currently studying to be a psychiatric nurse practitioner. Contributing author to SQL Server MVP Deep Dives and SQL Server MVP Deep Dives Volume 2. Connect on LinkedIn

This Blog



Privacy Statement