Lazy spool | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Lazy spool

iam new to sql server DBA
I got this when iam trying with "DISPLAY ESTIMATED EXECUTION PLAN" Thanks In Advance Malathi Rao
The Lazy Spool logical operator stores each row from its input in a hidden temporary object stored in the tempdb database. If the operator is rewound (for example, by a Nested Loops operator) but no rebinding is needed, the spooled data is used instead of rescanning the input. If rebinding is needed, the spooled data is discarded and the spool object is rebuilt by rescanning the (rebound) input. The Lazy Spool operator builds its spool file in a "lazy" manner, that is, each time the spool’s parent operator asks for a row, the spool operator gets a row from its input operator and stores it in the spool, rather than consuming all rows at once. Lazy Spool is a logical operator.
In the case of a lazy spool (LS), the spool only stores the individual rows that are requested by its parent, not all of them. Many times, this is cheaper than retrieving all of the rows from its child. In this case it is better to check the TEMPDB contention too. Satya SKJ
Microsoft SQL Server MVP
Writer, Contributing Editor & Moderator
This posting is provided AS IS with no rights for the sake of knowledge sharing. Knowledge is of two kinds. We know a subject ourselves or we know where we can find information on it.