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 so it cannot be destroyed while the holder looks at it, and it is compatible with every other mode except Destroy (DT). The wait type exists mainly so all five latch modes have LATCH_* entries.

Because KP conflicts only with destruction, waits are inherently rare.

Is It a Problem?

Practically never. A LATCH_KP wait means a thread wanted to pin a structure at the exact moment another thread was destroying it, a vanishingly narrow window. Expect zero or near zero everywhere.

As with all non-page latch waits, any real analysis happens at the latch class level: sys.dm_os_latch_stats groups all modes together per class, and the class names the subsystem.

Common Causes

  • A pin request colliding with a structure teardown, momentarily.
  • Severe churn on one internal structure (the same conditions that raise LATCH_EX/LATCH_DT on its class).

What To Do

  1. Ignore it in isolation.
  2. If latch waits matter on your system, work from sys.dm_os_latch_stats by class; the mode split adds nothing.

How To See It

Rank waits with Get-WaitStatistics, then pivot to latch classes when latching is genuinely the question.


Where To Go Next

LATCH_KP is background noise on a healthy instance. If you are chasing a real problem, start with the waits that actually cost you time.

Related waits: LATCH_DT · LATCH_EX · LATCH_NL

Comments

Leave a Reply

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