New update on minimal logging for SQL Server 2008

Based on the customer feedback, we have decided to make minimal logging functionality into a btree available to SQL 2008 customers. All you need to do is to enable TF-610 in RTM bits. As a cautionary note, we have seen some slowdown if you are loading data into a btrree using TF-610 on a slower IO subsystem. So please make sure you test it first.

Here are the two performance issues you need to be aware of. I will walk you through each of these with examples

1.     Double writes

2.     Log space reservation.


-- create the source table. This table stores 2 row per page

create table t_source (c1 int, c2 int, c3 char (3000))


-- I insert 10000 rows. With 2 rows/page, I will have 5000 pages so

-the size of the table is 40MB

declare @i int

select @i = 1

while (@i < 10000)


      insert into t_source values (@i, @i+10000, 'hello')

      select @i= @i + 1


-- create target table with clusttered index

create table t_ci (c1 int,  c2 int, c3 char(3000))


create clustered index ci on t_ci(c1)


-- I will now insert all the rows from the source table into the target

-- table and measure (a) logspace used (b)logspace reserved (c) number of writes

-- both with TF-610 ON and OFF.

-- Here is the INSERT statement

begin tran

insert into t_ci select * from t_source order by c1




# of page writes(appx)


Logspace used (appx)


Logspace reserved (appx)


TF-610 OFF








TF-610 ON








What is interesting to note, is that without TF-610, we write the data page only once and it is fully logged. While with TF-610, we write the data page twice (i.e. double write) but we do get minimal logging (i.e. we took wrote only 3.5MB log). However, the log reserved space balloons to 82MB. This is done to allow for rollback of the transaction and this space is reserved assuming full-logging. You may wonder that it should atmost be 34MB, but it is because of conservative log reservation algorithm.

For details, please refer to my blog entries