Below is what I did:
- Created database in simple recovery mode.
- Created table.
- Began tran and inserted so many rows to exceed size of the log file.
- Committed the transaction.
Before step 4 I noticed that log file grew, which confused me. Why did that happen?
According to MSDN:
For each logical write, a transaction log record is inserted in the log cache that records the modification.
Log records are written to disk when the transactions are committed.
So how do you explain the fact that the log file is growing when the data is being inserted, even when a transaction is not committed?
As I understand, uncommitted log records should be stored in the log buffer, not on disk.