Collections:
What Is fn_virtualfilestats()
What Is fn_virtualfilestats() function view in SQL Server?
✍: FYIcenter.com
fn_virtualfilestats() is a Transact-SQL
function view that
returns I/O statistics for database files, including log files.
In SQL Server, this information is also available from the
sys.dm_io_virtual_file_stats dynamic management view.
fn_virtualfilestats() function has the following calling syntax:
fn_virtualfilestats ( { database_id | NULL } , { file_id | NULL } )
If you call it with NULL arguments, it will return I/O statistics for all files of all databases on this server.
fn_virtualfilestats() returns the following output fields on each data files:
Among all output fields, NumberReads, BytesRead, NumberWrites and BytesWritten are very useful to helpful for us to calculate the I/O performance.
For example, the following query returns I/O statistics of the first physical files in the current database:
select * from fn_virtualfilestats(DB_ID(), 1) DBID FILEID NUMBERREADS BYTESREAD NUMBERWRITES BYTESWRITTEN ... 6 1 3 114156 41344335872 1077341 39180853248 ...
⇒ Join sys.allocation_units with fn_virtualfilestats()
⇐ Find the File IDs of a Given Table
2019-06-29, 2158🔥, 0💬
Popular Posts:
How to expand IPv6 addresses? In order to help your programming or testing tasks, FYIcenter.com has ...
How to generate IPv6 Addresses? To help you to obtain some IPv6 addresses for testing purpose, FYIce...
How to turn off HTTP response compression in SoapUI? HTTP response compression reduces the data size...
How to generate test credit card numbers? Test credit card numbers are frequently needed in testing ...
How to perform UUDecode (Unix-to-Unix Decode)? UUEncode is Unix-to-Unix encoding used on Unix system...