sys.dm_tran_top_version_generators (Transact-SQL)
Returns a virtual table for the objects that are producing the most versions in the version store.sys.dm_tran_top_version_generators returns the top 256 aggregated record lengths that are grouped by the database_id and rowset_id.sys.dm_tran_top_version_generators retrieves data by querying the dm_tran_version_store virtual table.sys.dm_tran_top_version_generators is an inefficient view to run because this view queries the version store, and the version store can be very large.Firma Microsoft zaleca, aby użyć tej funkcja, aby znaleźć największe konsumentów magazynu wersja.
sys.dm_tran_top_version_generators
Zwracana tabela
Nazwa kolumna |
Typ danych |
Description |
---|---|---|
database_id |
int |
Identyfikator bazy danych. |
rowset_id |
bigint |
Identyfikator zestawu zestaw wierszy. |
aggregated_record_length_in_bytes |
int |
Suma długości rekordu dla każdego database_id and para rowset_id magazynu wersja. |
Uprawnienia
Wymaga uprawnienia VIEW SERVER STATE na serwerze.
Remarks
Ponieważ sys.dm_tran_top_version_generators być może trzeba odczytać liczby stron, ponieważ skanuje magazynu wersja całej systemem sys.dm_tran_top_version_generators mogą zakłócać działanie systemu.
Przykłady
W poniższym przykładzie użyto Scenariusz testów systemem cztery jednoczesnych transakcji, każdy identyfikowane przez numer sekwencji transakcji (XSN) w bazie danych, które zawiera opcje ALLOW_SNAPSHOT_ISOLATION i READ_COMMITTED_SNAPSHOT ustawiona na ON.Uruchomione są następujące operacje:
57 XSN jest operacją aktualizacji w obszarze izolacji możliwy do serializacji.
58 XSN jest taka sama, jak 57 XSN.
XSN-59 jest operacją select w izolacji migawka.
60 XSN jest taka sama, jak XSN-59).
Następująca kwerenda jest wykonywana.
SELECT
database_id,
rowset_id,
aggregated_record_length_in_bytes
FROM sys.dm_tran_top_version_generators;
Here is the result set.
database_id rowset_id aggregated_record_length_in_bytes
----------- -------------------- ---------------------------------
9 72057594038321152 87
9 72057594038386688 33
The output shows that all versions are created by database_id9 and that the versions generate from two tables.