SQL Server Interview Question #232

What is an index spool?

Advanced Indexing Senior Advanced

Detailed Explanation

An Index Spool is an execution-plan operator that creates a temporary indexed worktable, usually in tempdb, so intermediate data can be accessed efficiently multiple times during query execution.

Spools can be beneficial optimizer strategies, but an expensive repeated spool may indicate that the permanent indexing strategy or query structure deserves investigation.

A spool should not automatically be considered a problem; inspect its cost, row counts, rewinds/rebinds, and the surrounding operators.