Author: Peter Whyte

  • LATCH_DT Wait Type in SQL Server

    ⏳Part of the SQL Server Wait Types Library, every wait type explained.Related deep dive: PAGELATCH_EX Wait TypeRelated pillar: Performance & Troubleshooting LATCH_DT is a wait for a latch in Destroy (DT) mode on an internal SQL Server structure that is not a data or index page. Destroy mode is the strongest latch mode, taken when…

  • LATCH_EX Wait Type in SQL Server

    ⏳Part of the SQL Server Wait Types Library, every wait type explained.Related deep dive: PAGELATCH_EX, TempDB Allocation ContentionRelated pillar: Performance & Troubleshooting LATCH_EX is a wait for an exclusive latch on an internal SQL Server structure that is not a data or index page. SQL Server uses latches to protect all kinds of in-memory structures.…

  • LATCH_KP Wait Type in SQL Server

    ⏳Part of the SQL Server Wait Types Library, every wait type explained.Related deep dive: PAGELATCH_EX Wait TypeRelated pillar: Performance & Troubleshooting LATCH_KP is a wait for a Keep (KP) mode latch on an internal SQL Server structure that is not a data or index page. Keep mode is the lightest latch: it pins a structure…

  • LATCH_NL Wait Type in SQL Server

    ⏳Part of the SQL Server Wait Types Library, every wait type explained.Related deep dive: PAGELATCH_EX Wait TypeRelated pillar: Performance & Troubleshooting LATCH_NL is the wait type for a Null (NL) mode latch on a non-page internal structure. NL is the no-op of latch modes, and this wait exists purely so the full set of modes…

  • DBA Scripts: Get Index Fragmentation

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Maintenance & Automation › Index Maintenance Index fragmentation is one of those topics where the received wisdom, “rebuild your indexes every weekend”, causes almost as many problems as it solves. Rebuilding an index that doesn’t need it wastes a maintenance window, takes a…

  • LATCH_SH Wait Type in SQL Server

    ⏳Part of the SQL Server Wait Types Library, every wait type explained.Related deep dive: PAGELATCH_EX, TempDB Allocation ContentionRelated pillar: Performance & Troubleshooting LATCH_SH is the shared (read) counterpart to LATCH_EX. It is a wait for a shared latch on an internal SQL Server structure that is not a data or index page. Threads take a…

  • LATCH_UP Wait Type in SQL Server

    ⏳Part of the SQL Server Wait Types Library, every wait type explained.Related deep dive: PAGELATCH_EX Wait TypeRelated pillar: Performance & Troubleshooting LATCH_UP is a wait for an update-mode (UP) latch on an internal SQL Server structure that is not a data or index page. Update mode sits between shared and exclusive: the holder intends to…

  • LOGBUFFER Wait Type in SQL Server

    ⏳Part of the SQL Server Wait Types Library, every wait type explained.Related deep dive: WRITELOGRelated pillar: Storage & Capacity LOGBUFFER occurs when a session generating log records has to wait for free space in a log buffer. SQL Server stages log records in small in-memory log buffers (up to 60KB each) before flushing them to…

  • LOGMGR_FLUSH Wait Type in SQL Server

    ⏳Part of the SQL Server Wait Types Library, every wait type explained.Related deep dive: WRITELOG Wait TypeRelated pillar: Backup & Recovery LOGMGR_FLUSH is a wait recorded when a thread generating a transaction log record has to pause until the current log flush completes. From SQL Server 2016 onward the engine runs multiple background log writer…

  • PAGEIOLATCH_UP Wait Type in SQL Server

    ⏳Part of the SQL Server Wait Types Library, every wait type explained.Related deep dive: PAGEIOLATCH_SH Wait TypeRelated pillar: Storage & Capacity PAGEIOLATCH_UP is a wait for an update-mode latch on a page that is currently in an I/O request, usually a thread reading a non-table page (typically an allocation bitmap like PFS, GAM, or SGAM)…