It means that the rows from the input (which appears to the right of the
Table Spool/Eager Spool operator) are stored in a hidden temporary table
available only to the query at hand. This temporary table can be read
several times during the query. For example, in a GROUP BY query with the
CUBE option, the base aggregations that the GROUP BY generates are stored in
such a table, and that table is read several times during the query and
sorted in several different ways to calculate the various supper aggregates
that the CUBE option generates. You'll have one Table Spool/Eager Spool for
the write operation, and one for each read.
As for lessening the costs...the optimizer decided to create the spool table
to generate a more efficient plan than other plans it considered. I don't
think there's a way to lessen the cost of table spools (other than
optimizing the use of tempdb in general by making sure tempdb is on a fast
raid system, and that tempdb is not a bottleneck in your system and so
on...). With that in mind, maybe you should focus on whether indexing is
sufficient, or whether your query is written in the most efficient way.
--
BG
Hi-Tech College, Israel
http://sql.hi-tech.co.il
"Cole Shelton" <csh...@swbell.net> wrote in message
news:3ABA09D4...@swbell.net...