Execution plan for table spool

sakuraime 2,346 Reputation points
2021-07-05T15:11:43.723+00:00

Anyone saw any execution plan starting with a table spool ? and also it cost is grater than 100%
111897-image.png

SQL Server | Other
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Erland Sommarskog 121.8K Reputation points MVP Volunteer Moderator
    2021-07-05T21:56:53.623+00:00

    Spools typically appears in two places of a plan. One where it is being written to, and one where it is read.

    Keep in mind that the costs are estimates, and nothing you should pay that much attention to.

    0 comments No comments

  2. CathyJi-MSFT 22,396 Reputation points Microsoft External Staff
    2021-07-06T06:22:31.203+00:00

    Hi @sakuraime ,

    Spool is a physical operator that shows up in the execution plan. Query optimizer uses spools when it thinks that it’s better to put data in the temp table rather than hitting a table again and again using seeks and scans.

    Check if below blog could help you.

    Spools in Execution Plan. Are they bad?


  3. Tom Phillips 17,771 Reputation points
    2021-07-06T17:05:41.79+00:00

    There are many reasons for the total to be >100% on the estimated plan. There was a problem in SSMS which caused this. However, it is still possible. Make sure you have the current version of SSMS installed.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.