What’s in PREEMPTIVE_OS_FILEOPS wait type?

This one wait type is one of the many hundreds which came up new with SQL Server 2008.

As my colleague Denzil Ribeiro found in the code, this one in particular is one that accounts the time SQL Server threads have waited for file system operations to complete. SQL Server workers switch preemptive before calling file system operations, so that if the API doesn’t return in a timely fashion it doesn’t hang its SQLOS scheduler.

Some of that APIs include CreateFile, DeleteFile, GetVolumePathName, GetVolumeNameForVolumeMountPoint, GetVolumeInformation, lots of file operations for Filestreams, or fulltext related file operations.

As an additional clarifying note from my side, this doesn’t mean SQL Server 2005 didn’t transfer the thread to preemptive mode for the duration of the call to those APIs. Only that SQLOS didn’t provide the means to tell it what specific wait type we wanted to account that duration under. Starting with SQL Server 2008 SQLOS allows that.

And that explains why the number of wait types almost duplicated from 2005 to 2008. Developers from SQL product group had been provided with this new tool to easily obtain aggregated and very accurate measures of the time SQL threads were spending calling different Windows APIs.

Comments (1)
  1. FLauffer says:

    Great post! Thanks

Comments are closed.

Skip to main content