INF: SQL Server Update Transaction Log InformationID: Q67174
|
The following information discusses how the transaction log file is updated.
Each transaction log record is composed of a 16-byte header, plus a
variable length row for the type of transaction.
When an update is performed and a nonclustered index is used on the
table, SQL Server will delete the old version of the row, and then
insert the new version of the row. This is true for both data rows and
index rows. Please note that SQL Server will perform an "update in
place" under certain restrictions. For an outline of these
restrictions, query on the following words:
SQL Server and criteria and insert and update
Begin transaction
CMD
Intent to delete record 0
Intent to insert data "hello world" log record (2054, 12)
Intent to delete record 1
Intent to insert data "hello work" log record (2054, 14)
Delete index #1
Delete index #2
Delete record data "good bye world"
Delete index #1
Delete index #2
Delete record data "good bye work"
Insert index #1
Insert Index #2
Insert data from (2054,12) to page 40
Insert index #1
Insert Index #2
Insert data from (2054,14) to page 41
End Transaction
For each update assuming that there are two indexes:
2 Rows for Index Deletes
2 Rows for Index Inserts
1 Row for data Delete
1 Row for deferred insert
-
6 x 16 bytes = 96 bytes
1 Row for deferred delete with a fixed length of 24 bytes
1 Row for location of insert with a fixed length of 52 bytes
------------------------------------------------------------
Total 172 bytes x #rows to be updated
+ 2 x the size of data
+ 2 x the size of index
Additional query words: Database repair
Keywords : kbother SSrvServer
Version : 4.2
Platform : OS/2
Issue type :
Last Reviewed: March 10, 1999