PREEMPTIVE_OS_LOOKUPACCOUNTSID is SQL Server asking Windows to turn a SID into an account name, which for domain accounts can mean a round trip to a domain controller. It becomes a bottleneck when code does it over and over, or when the domain controller is far away. Run the check to read the average and catch the caller.Microsoft lists it as internal use only. It is the Windows LookupAccountSid function, with an example when building the login token for a new connection, so Windows logins pass through it routinely. While the call runs, the thread is in preemptive mode, outside SQL Server’s scheduler.
Is It a Problem?
Occasional lookups are routine; our SQL Server 2025 lab had about 5,000 waits averaging under a millisecond in a day. Get Wait Statistics does not filter it out, so if it ranks, you will see it. The pattern that makes it a bottleneck: in one reported case it was the top wait because code kept calling SUSER_SNAME() for a SID, and each call went to a domain controller on the other side of the Atlantic. Long waits otherwise point at the domain controllers themselves.
The baseline to monitor is its average wait per call over an interval rather than the cumulative totals.
Common Causes
SUSER_SNAME(sid)or similar SID translation called per row or per execution.- Slow, overloaded or distant domain controllers.
- DNS or site configuration sending lookups to the wrong domain controller.
- Security tooling resolving large numbers of SIDs.
The Check To Run
Rank it against everything else with Get Wait Statistics, then read the average next to the other directory waits:
SELECT
wait_type,
waiting_tasks_count,
wait_time_ms,
CAST(wait_time_ms * 1.0 / NULLIF(waiting_tasks_count, 0) AS DECIMAL(12, 2)) AS avg_wait_ms,
max_wait_time_ms
FROM sys.dm_os_wait_stats
WHERE wait_type IN (
N'PREEMPTIVE_OS_LOOKUPACCOUNTSID',
N'PREEMPTIVE_OS_AUTHENTICATIONOPS',
N'PREEMPTIVE_OS_DSGETDCNAME')
ORDER BY wait_time_ms DESC;
While it is happening, catch the caller and look for SID translation in its text:
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_LOOKUPACCOUNTSID'
ORDER BY r.wait_time DESC;
Both need VIEW SERVER STATE.
What To Do
- Fix the pattern: translate SIDs once and join or cache the result, instead of calling per row.
- For audit reports, store the name mappings on a schedule rather than resolving them live.
- If the average per call is high, give the infrastructure team the numbers;
nltest /dsgetdc:YourDomainshows which domain controller the server uses.
The PREEMPTIVE_OS Security and Directory Waits
Each of these is SQL Server calling out to Windows for authentication or directory work, and many of those calls go to a domain controller. They tend to rise together when AD is slow. If one is near the top of your waits, read it next to the waits that usually matter.
- PREEMPTIVE_OS_AUTHENTICATIONOPSAuthentication. Windows security calls made while authenticating logins and building tokens.Worth a look when it climbs
- Group Lookup waitsGroup membership. NETGROUPGETUSERS, NETUSERGETGROUPS and the other calls that ask Windows who belongs to which group.Worth a look when it climbs
- PREEMPTIVE_OS_LOOKUPACCOUNTSIDSID to name. Translating a security identifier into an account name, often via a domain controller.Worth a look when it climbs. This page.
- PREEMPTIVE_OS_DSGETDCNAMEFinding a DC. Locating a domain controller before the directory question can be asked.Worth a look when it climbs
- PREEMPTIVE_OS_LOGONUSERLogon as a stored identity. The Windows LogonUser call, used when SQL Server must log on with a stored Windows credential.Worth a look when it climbs
- Security waitsOther security APIs. The AUTHZ and security context calls that do not have a page of their own.Worth a look when it climbs
- Crypto waitsCryptography. Windows crypto API calls, for certificates, keys and TLS.Usually noise
Where To Go Next
If PREEMPTIVE_OS_LOOKUPACCOUNTSID is climbing, these are the next places to look.
- PREEMPTIVE_OS_AUTHENTICATIONOPS, the main authentication wait.
- The waits that usually matter, ranked, with what each one is telling you.
- Performance & Troubleshooting, the scripts and guides for this part of the stack.
Leave a Reply