• GilaMonster (9/13/2012)


    First time:

    Query is compiled

    Query is executed

    Query processor asks for rows one by one from the storage engine according to the query operators in the plan

    Storage engine returns the rows from the pages in memory. If the pages are not in memory, it gets them into memory first

    Query processor returns resultset of completed query.

    Second time

    Plan is fetched from cache

    Query is executed

    Query processor asks for rows one by one from the storage engine according to the query operators in the plan

    Storage engine returns the rows from the pages in memory. If the pages are not in memory, it gets them into memory first

    Query processor returns resultset of completed query.

    Thanks

    When SQL Server brings pages into Memory, the pages sit in memory in the same way as they were sitting on disk?

    When the query is submitted for the second time, even though the pages are in memory, are there still reads happening on the disk? Because of the Clustered Index Seek?

    Is this right?

    Thanks