Spool operators in query plan…

I came across a question in the relationalserver.performance newsgroup where a customer was wondering about the spools seen in a recursive query execution plan. The query is shown below: USE Northwind;Go WITH EmpChart AS(SELECT EmployeeId, ReportsTo, 1 AS treelevelFROM EmployeesWHERE (Employees.ReportsTo = 2)UNION ALLSELECT e.EmployeeId, e.ReportsTo, treelevel +1FROM Employees eJOIN EmpChart ecON e.ReportsTo=ec.EmployeeID)SELECT * FROM…

3