PAGELATCH_SH

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

(Back to main page…)

Description:

This wait type is when a thread is waiting for access to a data file page in memory so that it can read the page structure (SH = SHare mode). The Latches Whitepaper in the sidebar on the right has a description of all latch modes and their compatibility with other latch modes.

(Books Online description: “Occurs when a task is waiting on a latch for a buffer that is not in an I/O request. The latch request is in Shared mode.”)

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:

Pre-2005/2005

Removed in SQL Server version:

N/A

Extended Events wait_type value:

The map_key value in sys.dm_xe_map_values is 50 in all versions through 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:

See the PAGELATCH_EX wait type for more details.

Note that you may see a wait resource of (0:0:0) in the output from some queries. This is normal – see this post for an explanation.

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

  1. Reading a page in an index (in this case, while traversing from the root to the leaf level, searching for the insertion point of a new record)
  2. Reading the allocation status of a page from a PFS page (in this case, while performing a scan of a heap)
  3. Reading a page in an index (in this case, while finding a LOB value)

And many more similar stacks where pages in memory are being read.

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

  1. SOS_Task::PostWait+90
    EventInternal::Wait+1f9
    LatchBase::Suspend+633
    LatchBase::AcquireInternal+415
    BUF::AcquireLatch+78
    BPool::Get+ea
    BTreeMgr::Seek+4a0
    BTreeMgr::GetHPageIdWithKey+32d
    IndexPageManager::GetPageWithKey+e6
    IndexDataSetSession::LocatePageForInsert+202
    IndexDataSetSession::InsertSmallRecord+dac
    IndexDataSetSession::SetDataInternal+99b8
    DatasetSession::SetData+16d
    RowsetNewSS::SetData+6a
    CValRow::SetDataX+63
    CQScanUpdateNew::GetRow+23a
    CQueryScan::GetRow+81
    CXStmtQuery::ErsqExecuteQuery+36a
    CXStmtDML::XretDMLExecute+2f3
    CXStmtDML::XretExecute+ad
    CMsqlExecContext::ExecuteStmts<1,1>+400
  2. SOS_Task::PostWait+9e
    EventInternal::Wait+1fb
    LatchBase::Suspend+633
    LatchBase::AcquireInternal+415
    BUF::AcquireLatch+78
    BPool::Get+10f
    PFSPageRef::Fix+b2
    AllocScan::ProcessExtent+1a7
    AllocScan::GetNextScanExtent+500
    AllocScan::MoveToStartOfScan+192
    AllocScan::GetNextScanPage+18e
    AllocationOrderPageScanner::GetNextPage+a4
    HeapPageManager::GetNextPage+181
    HeapDataSetSession::GetNextRowValuesInternal+51f
    RowsetNewSS::FetchNextRow+197
    CQScanTableScanNew::GetRow+f2
    CQScanUpdateNew::GetRow+76
    CQueryScan::GetRow+81
    CXStmtQuery::ErsqExecuteQuery+36d
    CXStmtDML::XretDMLExecute+31c
    CXStmtDML::XretExecute+ad
    CMsqlExecContext::ExecuteStmts<1,1>+427
  3. SOS_Task::PostWait+90
    EventInternal::Wait+1f9
    LatchBase::Suspend+633
    LatchBase::AcquireInternal+415
    BUF::AcquireLatch+78
    BPool::Get+ea
    BTreeMgr::Seek+4a0
    BTreeMgr::GetHPageIdWithKey+32d
    IndexPageManager::GetPageWithKey+e6
    GetRowForKeyValue+264
    IndexDataSetSession::GetRowByKeyValue+126
    IndexDataSetSession::FetchRowByKeyValueInternal+210
    DatasetSession::FetchRowByKeyValueNoLock+d0
    RowsetNewSS::FetchRowByKeyValue+4fd
    LobStorageProvider::GetLobValueForRead+74
    CBlobHandleFactoryMain::PilbGetILockBytesInternal+1a3
    CBlobHandleHelper::CopyBlobHandleIntoTempOrInlined+45
    CBlobHandleManagerCommon::PxvarPreprocessInternal+126
    CValExchangeLargeObject::SetDataX+88
    CQScanXProducerNew::CopyRow+a3
    CQScanXProducerNew::GetRowHelper+2e3