microsoft / tigertoolbox

Toolbox repository for Tiger team
http://aka.ms/sqlserverteam
Other
1.48k stars 740 forks source link

Fixing-VLFs accurate to 73728MB only #303

Open walterse-leidos opened 11 months ago

walterse-leidos commented 11 months ago

Growing the tlog size by 8192MB and predicting 16 new VLFs for each growth increment is only accurate up to 73728MB. After that, each new growth increment results in 1 new VLF. Therefore, the Potential VLFs begins to diverge from Actual VLFs quickly. At 122880MB, the script Potential VLFs is 240. However, the Actual VLFs achieved from growing the log from 1M to 122880MB in 8192MB increments is about 153.

This is because, "In SQL Server 2014 (12.x) and later versions, if the next growth is less than 1/8 of the current log physical size, then create 1 VLF that covers the growth size."

73728 * 1/8 = 9216 9216 < 8192 then create 1 VLF

Reference: https://learn.microsoft.com/en-us/sql/relational-databases/sql-server-transaction-log-architecture-and-management-guide?view=sql-server-2016#virtual-log-file-creation