THE SQL Server Blog Spot on the Web

Welcome to SQLblog.com - 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: https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=509341. 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 09, 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

Comments

 

Adam Machanic 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

(required) 
(required) 
Submit

About John Paul Cook

John Paul Cook is both a Registered Nurse and a Microsoft SQL Server MVP experienced in Microsoft 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. Experienced in systems integration and workflow analysis, John is passionate about combining his IT experience with his nursing background to solve difficult problems in healthcare. He sees opportunities in using business intelligence and Big Data to satisfy healthcare meaningful use requirements and improve patient outcomes. John graduated from Vanderbilt University with a Master of Science in Nursing Informatics and is an active member of the Sigma Theta Tau nursing honor society. Contributing author to SQL Server MVP Deep Dives and SQL Server MVP Deep Dives Volume 2.

This Blog

Syndication

Powered by Community Server (Commercial Edition), by Telligent Systems
  Privacy Statement