Seems as though this is a documentation issue, as the version_record_count
, as suspected, is showing any versioned records and not just those from PVS (due to ADR).
Simple repro:
create database versiontest
go
alter database versiontest set allow_snapshot_isolation on
go
use versiontest
go
create table test
(
id int identity(1,1) not null,
crapdata char(4000) not null default ('Crap')
)
go
insert into test default values
go 100
select database_id, OBJECT_NAME(object_id), index_id, index_type_desc, version_record_count, inrow_version_record_count, inrow_diff_version_record_count, offrow_regular_version_record_count, offrow_long_term_version_record_count FROM sys.dm_db_index_physical_stats(db_id(), OBJECT_ID('test', 'U'), default, default, 'detailed')
go
begin tran
update test set crapdata = 'More Crap'
go
select database_id, OBJECT_NAME(object_id), index_id, index_type_desc, version_record_count, inrow_version_record_count, inrow_diff_version_record_count, offrow_regular_version_record_count, offrow_long_term_version_record_count FROM sys.dm_db_index_physical_stats(db_id(), OBJECT_ID('test', 'U'), default, default, 'detailed')
go
rollback
go
select database_id, OBJECT_NAME(object_id), index_id, index_type_desc, version_record_count, inrow_version_record_count, inrow_diff_version_record_count, offrow_regular_version_record_count, offrow_long_term_version_record_count FROM sys.dm_db_index_physical_stats(db_id(), OBJECT_ID('test', 'U'), default, default, 'detailed')
go
use master
go
drop database versiontest
go
tempdb
. Absolutely positive ADR isn't enabled? lol.