How Eager Index Spools Cause Performance Problems
Going Further
If this is the kind of SQL Server stuff you love learning about, you’ll love my training. Blog readers get 25% off the Everything Bundle — over 100 hours of performance tuning content. Need hands-on help? I offer consulting engagements from targeted investigations to ongoing retainers. Want a quick sanity check before committing to a full engagement? Schedule a call — no commitment required.
I followed along and took it one step further, indexing the Users table as you mentioned:
CREATE index ix_users_rep on dbo.users (reputation, id) include (displayname) with (maxdop=8, sort_in_tempdb = on);
That further reduced my query time from 12 ms to effectively 0 ms. This has been a great series, thanks for publishing it.
Very good! Thanks for watching, and for the kind words.