Skip to content

Commit 5d9a858

Browse files
committed
Add examples and output to optimized-locking README.md
1 parent d6ec888 commit 5d9a858

1 file changed

Lines changed: 25 additions & 5 deletions

File tree

  • samples/features/optimized-locking/transaction-id-locking

samples/features/optimized-locking/transaction-id-locking/README.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,22 +109,42 @@ FROM
109109
dbo.TelemetryPacket;
110110
```
111111

112+
The output is similar to the following, except to the values in PageId column.
113+
114+
| PageId | PacketID | Device |
115+
| ----------- | --------- | --------- |
116+
| (1:2456:0) | 1 | Something |
117+
| (1:2457:0) | 2 | Something |
118+
| (1:2458:0) | 3 | Something |
119+
112120
The values shown in the PageId column represent the physical location of the data.
113121

114122
Let's look at the row where PacketID equals 1.
115123

116-
The value (1:XXXX:0) in the PageId column is composed of three parts separated by ":". Here is what each part represents:
124+
The value (1:2456:0) in the PageId column is composed of three parts separated by ":". Here is what each part represents:
117125
- 1 is the numeric identifier of the database file (file number) where the page is located
118-
- XXXX is the page number inside file 1 of the database
126+
- 2456 is the page number inside file 1 of the database
119127
- 0 is the slot number
120128

121-
Use the `DBCC PAGE` command to inspect the TID of page XXXX.
129+
Use the `DBCC PAGE` command to inspect the TID of page 2456.
130+
131+
```sql
132+
DBCC PAGE ('OptimizedLocking', 1, 2456, 3);
133+
```
134+
135+
The value of the unique transaction identifier (TID) that modified the row with PacketID equal to 1 is in the **Version Information** section, under the **Transaction Timestamp** attribute, as shown in the following sample data.
122136

123137
```sql
124-
DBCC PAGE ('OptimizedLocking', 1, XXXX, 3);
138+
Version Information =
139+
Transaction Timestamp: 985
140+
Version Pointer: Null
141+
Slot 0 Column 1 Offset 0x4 Length 4 Length (physical) 4
142+
PacketID = 1
143+
Slot 0 Column 2 Offset 0x8 Length 8000 Length (physical) 8000
144+
Device = Something…
125145
```
126146

127-
The value of the unique transaction identifier (TID) that modified the row with PacketID equal to 1 is in the Version Information section, under the Transaction Timestamp attribute.
147+
TID 985 represents the identifier of the transaction that inserted the rows; every subsequent change to the table rows will update the TID.
128148

129149
<a name=disclaimers></a>
130150
## Disclaimers

0 commit comments

Comments
 (0)