Index Spool output bigger than input?

  • I'm a little confused. I'm using SQL Sentry Plan Explorer and I can't understand how an Index Spool (Eager Spool) would output more rows than went into it. I've attached a snip of the plan branch. It shows a little over 6 million rows going into the index spool, and over 21 million coming out?!?!

  • That's what a spool is. Put x rows into a temporary structure and read them multiple times. What you're probably seeing is the 21 million is a cumulative count over several executions (and rewinds) of the spool.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Can you upload the full exec plan? I'd love to play with it.

    TIA.

  • Thanks! The number of rows output is exactly equal to the rewinds+rebinds. I just wasn't thinking about it correctly. Thanks very much for clearing that up!

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply