PAGEIOLATCH_KP 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

Is It a Problem?

Practically never; expect zero or close to it. It was zero on our SQL Server 2025 lab. Get Wait Statistics does not filter it out, so if it ranks, you will see it. If it ever records long waits, read it as part of the whole family: pages stuck in I/O, which is storage, not latching.


What It Means

Microsoft describes it as a task waiting on a latch for a buffer that is in an I/O request, with the request in keep mode, and says long waits might indicate problems with the disk subsystem. The wait type exists mainly so every latch mode has a PAGEIOLATCH_* wait of its own.


When It Does Matter

When I/O latching hurts, the time shows in PAGEIOLATCH_SH and PAGEIOLATCH_EX with high averages, and the check is storage latency per file:

SELECT
    DB_NAME(vfs.database_id) AS database_name,
    mf.type_desc,
    mf.physical_name,
    vfs.num_of_reads,
    CAST(vfs.io_stall_read_ms * 1.0 / NULLIF(vfs.num_of_reads, 0) AS DECIMAL(12, 2)) AS avg_read_ms,
    vfs.num_of_writes,
    CAST(vfs.io_stall_write_ms * 1.0 / NULLIF(vfs.num_of_writes, 0) AS DECIMAL(12, 2)) AS avg_write_ms
FROM sys.dm_io_virtual_file_stats(NULL, NULL) AS vfs
JOIN sys.master_files AS mf
    ON mf.database_id = vfs.database_id AND mf.file_id = vfs.file_id
ORDER BY vfs.io_stall_read_ms + vfs.io_stall_write_ms DESC;

The baseline to monitor is each file’s average read and write time against its own history; the counters are cumulative since restart, so compare two readings. The query needs VIEW SERVER STATE.


The PAGEIOLATCH Family

Each latch mode on a page that is in an I/O request has its own wait type, and the IO in the name means storage is involved. Judge them by the average wait, which tracks storage latency. The main page is PAGEIOLATCH_SH.

  • PAGEIOLATCH_SHShared. Waiting for a page to be read from disk so it can be read.The main page for this family
  • PAGEIOLATCH_EXExclusive. A page in an I/O request, latched in exclusive mode.A full page of its own
  • PAGEIOLATCH_UPUpdate. Usually an allocation page being read so it can be changed.Worth a look when it climbs
  • PAGEIOLATCH_KPKeep. Keep mode on a page in an I/O request; exists for completeness.Usually noise. This page.
  • PAGEIOLATCH_DTDestroy. Destroy mode on a page in an I/O request; exists for completeness.Usually noise
  • PAGEIOLATCH_NLNull. Documented for information only, not supported.Usually noise

Where To Go Next

PAGEIOLATCH_KP is usually zero. If you are chasing a real problem, start with the waits that cost you time.

Comments

Leave a Reply

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