• Paul White (2/27/2010)


    Chris,

    Turns out all that is needed to get rid of the index spool is to define the clustered index as UNIQUE. Given that information, a better plan is produced (without the extra index spool), and the recursive CTE now starts to return results after four seconds on my laptop. Well done!

    Paul

    Heh nice work Paul!

    I figured it would be sufficient to bring the time down to a few seconds - it only took half an hour with Jeff's modified sample generator - but this is the icing on the cake. I'll try this on the pagination query at work. Thanks!


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]