Query is extremely slow due to Lazy Index Spool

2019-08-21 15:32发布

问题:

On a powerful machine the SQL Server query is running too slowly.

In the execution plan I can see that most of the time spent goes to a "Lazy Index Spooling" process. In the query some aggregate functions are being used for calculation of values.

How can I speed-up the query (machine resources are enough)?

Thanks in advance.