Van Vugt's dynamiXs

All around NAV dev and test

Let's clean up NAV #5 - Torn Page Detection

Join the Clean Team! Geeked

Welcome to my fellow MVP Alain Krikilion, aka Kriki, who also clearly wants to clean up as you can read below. Let's kriki up NAV!

In the database properties of NAV, on the Options tab, there is the toggle Torn Page Detection.

In SQL2000 this option was introduced to have some mechanism to detect if a page was 'torn'.

What is behind it?

A page in SQL is approx. 8KB. But the default disk-cluster in Windows is 4 KB. So when you write a SQL page to disk, you write it in 2 disk-clusters. If the first cluster is written well, but the second not because of some problem, you have a torn-page.

In a later version of SQL Server, the Checksum was introduced. SQL Server calculates this checksum, when a SQL-page is written to disk, and writes it together with the data in the page. Now when SQL server reads that page, it calculates the checksum and confronts it with the checksum found in the page. If they differ, SQL knows the page is corrupt.

In the beginning, it was feared that it could have a performance impact, but that proved to be wrong (luckily). So the default has become Checksum and you don't need the possibility in NAV to change that as there is no reason to do it!

So lets get rid of Torn Page Detection.