Re running of queries

  • When I run my query in a large table for the first time it takes a long time but subsequent running of the same query takes lesser time.. Is it because same pages are used?what would be the reason for this?

  • Data caching and plan caching

    First execution data has to be pulled from disk and plan has to be compiled. 2nd execution both data and plan come from cache.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Can you point me to some documents where I can know about execution plan and how query is actually executed.

  • duggal.priyanka06 (1/31/2012)


    Can you point me to some documents where I can know about execution plan and how query is actually executed.

    Get the book SQL Server Internals for SQL Server 2008 OR Inside SQL Server for SQL Server 2005.

    Get the book SQL Server Execution Plans by Grant Fritchey to learn about execution plans (available on this same site in books section).


    Sujeet Singh

  • Divine Flame (1/31/2012)


    Get the book SQL Server Execution Plans by Grant Fritchey to learn about execution plans (available on this same site in books section).

    The free PDF is here: http://www.red-gate.com/our-company/about/book-store/assets/sql-server-execution-plans.pdf

    I believe Grant is rewriting this, but it is still a good introduction to the topic.

  • thanks all for your replies

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply