fn_filestats()

version: 1.0.0.1

last updated: 13 April 2005

platform: MSDE 2000 and SQL Server 2000 running Windows NT 4.0 and higher


Description:

fn_filestats() is an inline table-valued function that provides information about the utilization of the disk I/O subsystems as they are used by SQL Server. This function uses fn_virtualfilestats() as the foundation and adds additional calculated and aggregated columns which make it easier to interpret the state of your disk I/O system.

Column nameDescription

DbName  

Database name

DbId  

Database ID

FileId  

File ID, can be correlated to the actual file name using:

select filename from <DbName>.dbo.sysfiles where fileid = FileId

NumberReads  

Number of I/O read operations performed per file (measured from the start of the service)

NumberWrites  

Number of I/O write operations performed per file (measured from the start of the service)

BytesRead  

Total number of bytes read per file (measured from the start of the service)

BytesWritten  

Total number of bytes written per file (measured from the start of the service)

IoStallMS  

Total number of milliseconds wait time (stalled) for I/O operations to complete per file (measured from the start of the service)
Note: In SQL Server 2000 file I/O stalls are measured for reads and writes operations combined.

TotalIO  

Total number of I/O operations per file (calculated as NumberReads + NumberWrites) per file

TotalBytes  

Total bytes read and written per file (calculated as BytesRead + BytesWritten) per file

AvgStallPerIO  

The average stall (wait) per I/O operation, this is calculated as IoStallMS / TotalIO

AvgBytesPerIO  

The average amount of bytes per I/O operation, this is calcualted as TotalBytes / TotalIO

%IO  

Relative distribution of number I/O operation across all files, this tells you how many % of all the I/O operations with an instance take place in a given file

%Bytes  

Relative distribution of number bytes read and written across all files, this tells you how many % of all the bytes read and written within an instance occur in a given file

%Stall  

Relative distribution of number disk I/O waits/stalls across all files, this tells you how many % of all the stalls are related to a given file.

 


Example:

select * from ::fn_filestats()

select * from ::fn_filestats() where DbName = N'AdventureWorks2000'

select * from ::fn_filestats() where [%Stall] > 10


Download:

Questions or problems regarding this web site should be directed to Web Master.
Copyright © 1991-2005 SQLDev.Net. All rights reserved.
Last modified: 04/06/05.