HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

SQL Server 2008 R2 : LDF file size not increasing

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
file2008sqlsizeldfincreasingservernot

Problem

I am using SQL Server 2008 R2. I have a table statDB of 100 GB in primary filegroup.

I have created a secondary filegroup in same database (Lab1) and created a table copyStatDB.

Now I start copy table data from primary file group to secondary file group.

I have noticed that none of my TempDB size change and not my .LDF file size change.

I am surprised to see that because as per my understanding when we execute a Insert statement it should increase .LDF file size increase first then copy data to my .NDF file.

Solution

I wouldn't expect a copy operation to increase file sizes unless the file size was too small to begin with. SQL Server will first use unallocated space within data files before growing the file. Similarly, if the log file is large enough for the operation, that file shouldn't grow either.

Also regarding log space usage, some operations can be minimally logged to reduce logging requirements. Whether or not your INSERT...SELECT is fully logged depends on the database recovery model and indexes on the target table.

Context

StackExchange Database Administrators Q#107122, answer score: 3

Revisions (0)

No revisions yet.