seniorT-SQL

What is SQL Server memory grant spill and how does it impact query execution?

Updated May 17, 2026

Short answer

Memory grant spill occurs when a query receives insufficient memory and spills intermediate data to tempdb.

Deep explanation

Operators like sort and hash join require memory grants. If the granted memory is insufficient, SQL Server spills intermediate results to tempdb worktables. This introduces IO overhead and slows execution significantly. Spills often occur due to poor cardinality estimation or parameter sniffing. SQL Server may later adjust grants using memory grant feedback, but initial executions can still suffer.

Unlock with a Pro subscription to view this section.

View pricing

Real-world example

No real-world example available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Common mistakes

No common mistakes listed yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Follow-up questions

No follow-up questions available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

More T-SQL interview questions

View all →