SQL Server Performance Rotating Header Image

Write Logs

Today’s blog is the beginning of your lessons on Write Logs. So what’s the definition of a write log. Well when a SQL Server session waits on the WRITELOG wait type, it’s waiting to write the contents of that log cache to disk where of course the transaction log is stored.

We will explain the process in a little more detail, so let’s assume a session starts a transaction that will perform several INSERT statements. While the data is being inserted, two actions will occur:

  1. The data page in the buffer cache is updated with the new data.
  2. The data is written to the log cache which is a segment of memory used to record data that will be used for rolling back the transaction or be written to the log file.

This process continues until the transaction has completed or committed at which time the data in the log cache is immediately written to the physical log file. When SQL Server is in the act of flushing the log cache to disk, the session will wait on the WRITELOG wait type. Now you have the basics of a write log!

2 Comments

Leave a Reply