• GilaMonster (9/12/2012)


    SQLSACT (9/12/2012)


    So when the same query executes again, the results can be found in memory, right?

    Results, no. The data pages that the previous execution used, yes (providing they haven't been aged out of cache)

    So is it safe to say that when the same query executes again, it's not actually doing another Clustered Index Seek

    because the results are already in memory?

    No, it would be completely incorrect to say that. When the query executes again it does a clustered index seek to find the data. The pages may be in memory rather than disk, but it's still a clustered index seek to find the matching rows.

    Thanks

    Would the following be roughly what's happening

    >> Select statement is submitted

    >> Clustered Index Seek

    >> Pages are read from disk and brought into Memory.

    >> Same Select statement is submitted

    >> Clustered Index Seek

    After this point is where I begin to lose the plot.

    Is the whole Clustered Index brought into memory when the first Select statement is submitted or just the pages that contain the results of the select statement?

    Thanks