PREEMPTIVE_OS_GETPROCADDRESS Wait Type in SQL Server

⏳Part of the SQL Server Wait Types Library, every wait type explained.Related deep dive: SOS_SCHEDULER_YIELD Wait TypeRelated pillar: Performance & Troubleshooting

Is It a Problem?

The lookup itself is quick; our SQL Server 2025 lab had about 3,900 waits totalling half a second in a day. Get Wait Statistics does not filter it out, so if it ranks, you will see it. There is one quirk to know when it shows real time, below.


What It Means

Microsoft lists it as internal use only. It is the Windows GetProcAddress function, used to find an extended stored procedure’s address inside its DLL, so every extended procedure call passes through it. While the call runs, the thread is in preemptive mode, outside SQL Server’s scheduler. There is a recorded SQL Server 2008 bug where the procedure’s whole execution time was counted under this wait, with anecdotal reports that it still happens on later versions. So a big number here can really mean extended procedures ran for a long time.


When It Does Matter

When it carries serious time, read it like MSQL_XP: which extended procedures run, how long, and whether an external dependency has stopped answering. Catch the caller:

SELECT
    r.session_id,
    r.wait_type,
    r.wait_time AS wait_ms,
    s.login_name,
    s.program_name,
    t.text AS running_sql
FROM sys.dm_exec_requests AS r
JOIN sys.dm_exec_sessions AS s ON s.session_id = r.session_id
OUTER APPLY sys.dm_exec_sql_text(r.sql_handle) AS t
WHERE r.wait_type LIKE N'PREEMPTIVE_OS_%'
ORDER BY r.wait_time DESC;

The MSQL_XP page lists the registered procedures and their DLLs. The baseline to monitor is its wait time per interval next to MSQL_XP. The query needs VIEW SERVER STATE.


The PREEMPTIVE_OS Call Waits

Each of these is SQL Server calling a Windows function outside the file and security groups: networking, pipes, the registry, the event log, DLLs and the cluster. The time is spent in Windows. If one is near the top of your waits, read it next to the waits that usually matter.

  • Network waitsDNS and sockets. GETADDRINFO name lookups and Winsock calls; slow DNS shows here.Worth a look when it climbs
  • PREEMPTIVE_OS_PIPEOPSPipes. Windows pipe functions, such as xp_cmdshell reading its command output.Worth a look when it climbs
  • PREEMPTIVE_OS_WAITFORSINGLEOBJECTClient sync. Synchronising with an external client process; often seen with ASYNC_NETWORK_IO.Worth a look when it climbs
  • PREEMPTIVE_OS_QUERYREGISTRYRegistry. Windows registry functions.Worth a look when it climbs
  • PREEMPTIVE_OS_REPORTEVENTEvent log. The Windows ReportEvent function, writing to the event log.Worth a look when it climbs
  • PREEMPTIVE_OS_GETPROCADDRESSXP entry points. Finding an extended stored procedure’s address in its DLL.Worth a look when it climbs. This page.
  • Library waitsDLL loading. Loading and unloading DLLs in the SQL Server process.Usually noise
  • Cluster waitsFailover cluster. Windows failover cluster API calls.Usually noise
  • Miscellaneous waitsEverything else. The remaining single-call waits, such as VSS, FILESTREAM device and service calls.Worth a look when it climbs

Where To Go Next

PREEMPTIVE_OS_GETPROCADDRESS follows extended procedure calls. If you are chasing a real problem, start with the waits that cost you time.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *