QRY_PROFILE_LIST_MUTEX Wait Type in SQL Server

QRY_PROFILE_LIST_MUTEX is recorded when a thread waits for access to a profile list inside the query profiling statistics mechanism, the infrastructure behind lightweight query execution statistics (live query stats, sys.dm_exec_query_profiles, and the lightweight profiling that later versions enable by default).

Mostly invisible plumbing, with one documented sharp edge.

Is It a Problem?

Normally no, but know the exception: SQL Server 2016 and 2017 had a known issue (KB 4089239) where this wait type featured in a hang when using trace flag 7412, the flag that enabled lightweight profiling before it became default behaviour. If you run those versions with TF 7412 and encounter a hang exhibiting this wait, that KB is your diagnosis, and the fix is the associated CU (or dropping the flag).

On SQL Server 2019 onward, lightweight profiling is default, the flag is obsolete, and the issue does not apply.

Common Causes

  • Normal query profiling infrastructure synchronisation.
  • The 2016/2017 TF 7412 hang scenario on affected builds.

What To Do

  1. On 2016/2017 with TF 7412: confirm your build against KB 4089239 and patch or drop the flag.
  2. Otherwise filter it; profiling overhead questions are about profiling level settings, not this mutex.

How To See It

Rank waits with Get-WaitStatistics; prominence on old builds with TF 7412 is the one pattern that means something.


Part of the SQL Server Wait Types Library.
Related deep dive: SOS_SCHEDULER_YIELD Wait Type.

Comments

Leave a Reply

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