How does the read committed snapshot isolation level relate (link) the row in tempdb to the original row?



  • I understand that the read committed snapshot isolation level holds the row versions in the tempdb.

    I enabled this feature on a test database and I was expecting to see a new column (guid) get automatically added to the source data table (which I thought SQL will use to link to the record in tempdb). But there is no such column I can visibly see.

    How does the read committed snapshot isolation level relate (link) the row in tempdb to the original row?



  • SQL Server adds this 14 byte overhead as internal information. You need to use special command to see the overhead, as noted by MBuschi.

    Note that the overhead is not added until you modify a row, after you turned on RCSI.

    These 14 bytes is a combo of two pieces of information:

    1. XSN (Transaction Sequence Number), which identifies the transaction that performed the modification. This is 6 bytes.
    2. RID, a pointer to the versioned row. This is 8 bytes.

    https://docs.microsoft.com/en-us/sql/relational-databases/sql-server-transaction-locking-and-row-versioning-guide#space-used-in-data-rows



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2