The previous blog posts have introduced the version storage area. Now let's take a look at its logical structure and see how it stores tables and index rows of different structures. In fact, you only need to take a look at the DMVsys. dm_tran_version_store DMV. This DVM view shows the full logical structure of the version storage area. There are two points worth noting. First
The previous blog posts have introduced the version storage area. Now let's take a look at its logical structure and see how it stores tables and index rows of different structures. In fact, we only need to take a look at the DMV sys. dm_tran_version_store. This DVM view shows the full logical structure of the version storage area. There are two points worth noting. First
The previous blog posts have introduced the version storage area. Now let's take a look at its logical structure and see how it stores tables and index rows of different structures. In fact, we only need to take a look at DMV.
Sys. dm_tran_version_store this DMV is enough.
This DVM view shows the full logical structure of the version storage area. There are two points worth noting. First, the version storage area and the data page index page are also composed of 8 K pages. These pages exist in the buffer pool and can be written to the disk when TempDB is under memory pressure. Second, the version storage area stores Complete Binary files, just like those stored on data pages. This binary file is divided into two parts:
Server is combined internally. This makes row version storage independent of the structure of the object to which it belongs. That is, a page in a storage area can store rows with different indexes in different tables, or even different rows under the same instance. In other words, the version storage area is an SQL
Public under the Server instance. Like data pages and index pages, version storage pages are also cleared from the buffer pool when memory is insufficient.
If you view the DMV named sys. dm_tran_version_store, we will find that the version line has a lot of raw data or new attributes not available on the index page, such as database-id and row length. You may ask, the row version is also subject to SQL
If the maximum length of a Server row is 8060, how does one store the original data rows (the maximum length of a row is 8060) and add new attributes. The answer is that data rows are actually divided into two rows on the version storage page, but are displayed as a large row in the DMV view.
The following is an example of version storage. Transaction 57 has updated three different rows, and transaction 58 only updates one row. Note that if a transaction updates the same row multiple times, only one row version is created, because it holds the X lock from the beginning for other transactions.
Transaction_sequence_num
Version_sequence_num database_id
------------------------
-------------------------------
57 1 9
57 2 9
57 3 9
58 1 9
Rowset_id status min_length_in_bytes
--------------------
-------------------------
72057594038321152 0
12
72057594038321152 0
12
72057594038321152 0
12
72057594038386688 0
16
Record_length_first_part_in_bytes
---------------------------------
29
29
29
33
Record_image_first_part
--------------------------------------------------------------------
0x50000c007300000000000000200fcb0000000000000000002700000000000000
0x50000c0073000000020000000200fcb0000000010001002700000000000000
0x50000c0073000000030000000200fcb0000000010002002700000000000000
0x5000000000000002000000030000000300f8000000000000000000002e0000000000
Record_length_second_part_in_bytes record_image_second_part
----------------------------------
----------------------
0 NULL
0 NULL
0 NULL
0 NULL