30.06.2013 Views

Performance Tuning with SQL Server Dynamic Management Views

Performance Tuning with SQL Server Dynamic Management Views

Performance Tuning with SQL Server Dynamic Management Views

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 4: Transactions<br />

Version store usage<br />

<strong>SQL</strong> <strong>Server</strong> provides two DMVs that store data <strong>with</strong> regard to version store usage on a<br />

given instance, as follows (definitions taken from Books Online).<br />

• sys.dm_tran_version_store – returns a virtual table that displays all version<br />

records in the version store. sys.dm_tran_version_store is inefficient to run<br />

because it queries the entire version store, and the version store can be very large.<br />

Each versioned record is stored as binary data together <strong>with</strong> some tracking or status<br />

information. Similar to records in database tables, version store records are stored<br />

in 8,192-byte pages. If a record exceeds 8,192 bytes, the record will be split across two<br />

different records. Because the versioned record is stored as binary, there are<br />

no problems <strong>with</strong> different collations from different databases. Use sys.dm_tran_<br />

version_store to find the previous versions of the rows in binary representation as<br />

they exist in the version store.<br />

• sys.dm_tran_top_version_generators – returns a virtual table for the objects<br />

that are producing the most versions in the version store. sys.dm_tran_top_<br />

version_generators returns the top 256 aggregated record lengths that are<br />

grouped by the database_id and rowset_id. sys.dm_tran_top_version_<br />

generators retrieves data by querying the dm_tran_version_store virtual table.<br />

sys.dm_tran_top_version_generators is an inefficient view to run because this<br />

view queries the version store, and the version store can be very large. We recommend<br />

that you use this function to find the largest consumers of the version store.<br />

Both are aimed at allowing us to investigate the highest consumers of space <strong>with</strong>in the<br />

version store. Heed the warning in each case that, if the version store is large, queries<br />

against these DMVs can be expensive, and may have performance implications (a classic<br />

case of the "watcher" effect).<br />

164

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!