SQL

The SQL Transaction Log

A Simple recovery model will allow the transaction log to truncate previous transactions once it has reached a checkpoint. This means it will free up space for another run. One could say that a man with muddy shoes walk backwards and mobs the floor at the same time to clean up after himself. A Simple recovery model can still leave a transaction log full – perhaps if the SQL is being hammered upon and a transaction never ends.

Shrinking a log is generally not a good idea because it can cause fragmentation. Shrinking the log means it will ’format’ the space up untill where the log is in the process. So depending on where the transaction log is in the process it might not free up much space when doing a shrink, and the log has to ask Windows for space allocation from scratch.

A Full recovery model does not truncate transactions and needs to do a backup in order to do so. This however allows one to recover from disaster right up to the minute.

Transaction Log