(Republishing, or using this info in a commercial product/website, is prohibited without permission. All other uses are permitted. If in doubt, please ask.)

LCK_M_SCH_M_LOW_PRIORITY

(Back to main page…)

Description:

This wait type is when a thread is running an online index or partition switch operation and is blocked by other operations while waiting for the final Schema Modification (also called Schema Modify) lock. In this case, the WAIT_AT_LOW_PRIORITY option has been specified and the MAX_DURATION time has not yet expired.

You can read more about the WAIT_AT_LOW_PRIORITY option here.

(Books Online description: “Occurs when a task is waiting to acquire a Schema Modify lock with Low Priority. (Related to the low priority wait option of ALTER TABLE and ALTER INDEX.)”)

Questions/comments on this wait type? Click here to send Paul an email, especially if you have any information to add to this topic.

Added in SQL Server version:

2014

Removed in SQL Server version:

N/A

Extended Events wait_type value:

The map_key value in sys.dm_xe_map_values is 934 in 2014 RTM. After 2014 RTM, you must check the DMV to get the latest value as some map_key values have changed in later builds.

Other information:

I have not seen this wait type be a noticeable contention point.

The duration of each wait of this type will be at most what the MAX_DURATION option is set to for the online index/partition switch operation, after which either the online index/partition switch operation will abort or it will force those operations blocking it to roll back (resulting in an LCK_M_SCH_M_ABORT_BLOCKERS wait while the rollbacks complete).

Known occurrences in SQL Server (list number matches call stack list):

  1. Waiting for the Schema Modification lock during an online index operation (same stack as for LCK_M_SCH_M_LOW_PRIORITY except for a different location in the MDL::LockObjectLocal function)
  2. Waiting for the Schema Modification lock during a partition switch operation (same stack as for LCK_M_SCH_M_LOW_PRIORITY except for a different location in the MDL::LockObjectLocal function)

Abbreviated call stacks (list number matches known occurrences list):

  1. SOS_Task::PostWait+0x9e
    EventInternal<SuspendQueueSLock>::Wait+0x1fb
    LockOwner::Sleep+0x485
    lck_lockInternal+0x10ed
    MDL::LockObjectLocal+0x4c5
    CMEDCacheEntryFactory::AcquireLock+0x61
    CMEDCatalogObject::GetCachedObjectById+0xe2
    CMEDProxyDatabase::GetObjectByObjectId+0x91
    CIndexDDL::CleanupIndices+0xcb
    CIndexDDL::Rebuild+0xa25
    RegularIndexRebuildHelper+0x35e
    CISRegularIndex::Rebuild+0x8f
    CStmtAlterIndex::XretExecute+0x16e3
    CMsqlExecContext::ExecuteStmts<1,1>+0x427
    CMsqlExecContext::FExecute+0xa43
    CSQLSource::Execute+0x86c
    process_request+0xa57
    process_commands+0x4a3
    SOS_Task::Param::Execute+0x21e
    SOS_Scheduler::RunTask+0xab
  2. SOS_Task::PostWait+0x9e
    EventInternal<SuspendQueueSLock>::Wait+0x1fb
    LockOwner::Sleep+0x485
    lck_lockInternal+0x10ed
    MDL::LockObjectLocal+0x4c5
    CMEDCacheEntryFactory::AcquireLock+0x61
    CMEDCatalogObject::GetCachedObjectById+0xe2
    CMEDProxyDatabase::GetObjectByObjectId+0x91
    CStmtAlterTable::XretExecute+0xb89
    CMsqlExecContext::ExecuteStmts<1,1>+0x427
    CMsqlExecContext::FExecute+0xa43
    CSQLSource::Execute+0x86c
    process_request+0xa57
    process_commands+0x4a3
    SOS_Task::Param::Execute+0x21e
    SOS_Scheduler::RunTask+0xab