Skip to main content

What Is a Hash Match and Why Is It Heavy on TempDB?

Senior MS SQL
Quick Answer Hash Match builds a hash table from the smaller input (build phase), then scans the larger input and probes the hash table (probe phase). Build phase requires memory รขโ‚ฌโ€ if underestimated, it spills to TempDB. Heavy on both memory and TempDB I/O. Common when indexes are missing and inputs are large.

Answer

A hash match creates an in-memory hash table for joins and aggregates.

If memory is insufficient ? spills to TempDB ? huge slowdown.

S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice