SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Query performance issue due to Index Spool - Lazy Spool


Query performance issue due to Index Spool - Lazy Spool

Author
Message
muzikfreakster
muzikfreakster
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1157 Visits: 411


I want to check if somebody can help advise on high CPU cost of this top consuming query due to index spool - lazy spool in the query execution plan , can anyone help advise and how to troubleshoot further ?
ChrisM@Work
ChrisM@Work
SSC Guru
SSC Guru (154K reputation)SSC Guru (154K reputation)SSC Guru (154K reputation)SSC Guru (154K reputation)SSC Guru (154K reputation)SSC Guru (154K reputation)SSC Guru (154K reputation)SSC Guru (154K reputation)

Group: General Forum Members
Points: 154117 Visits: 21319
muzikfreakster - Thursday, March 1, 2018 11:10 PM


I want to check if somebody can help advise on high CPU cost of this top consuming query due to index spool - lazy spool in the query execution plan , can anyone help advise and how to troubleshoot further ?

Please post an actual execution plan as a .sqlplan attachment - actual plans carry a wealth of useful information which is unobtainable from a picture.

“Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
Exploring Recursive CTEs by Example Dwain Camps
Grant Fritchey
Grant Fritchey
SSC Guru
SSC Guru (334K reputation)SSC Guru (334K reputation)SSC Guru (334K reputation)SSC Guru (334K reputation)SSC Guru (334K reputation)SSC Guru (334K reputation)SSC Guru (334K reputation)SSC Guru (334K reputation)

Group: General Forum Members
Points: 334668 Visits: 33962
To fully answer what issues may be going on, getting the full plan is going to be the best bet.

To give you some general information, an index spool is a mechanism employed by the optimizer to assist with data processing. It's not the cause of your performance problems. No performance problems come directly from an execution plan. The execution plan is the result of the query, your data structure, the constraints and the statistics available to the optimizer. Problems don't lie with the execution plan. They lie with the code, the stats and your structures. Understanding the execution plan can help you understand why your query and structures lead to poor performance, but it is not the poor performance itself. It's always back to those other objects. The plan simply defines how the query is being met.

An index spool operation can be verify beneficial. It ensures that data is accessed one time from disk and then put into a temporary index for reuse elsewhere in the query. This can result in significant cost savings versus going back to the original data set over and over again.

----------------------------------------------------
The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
Theodore Roosevelt

The Scary DBA
Author of: SQL Server Query Performance Tuning and SQL Server Execution Plans
Product Evangelist for Red Gate Software
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search