Have I erased all the cache content ?

  • Dear all,

    I am doing some bench mark on SQL Server, I would like to ask you 2 questions :

    (1)I want to erase all the cache content (cold buffer cache) before each time I want to test my SQL statements, are these steps enough ?

    CHECKPOINT

    DBCC DROPCLEANBUFFERS

    DBCC FREEPROCCACHE

    (2)Is the execution time of a stored procedure always shorter than that of a Transact-SQL statement (they have the same login of course) ?

  • onlo (6/22/2008)


    Dear all,

    I am doing some bench mark on SQL Server, I would like to ask you 2 questions :

    (1)I want to erase all the cache content (cold buffer cache) before each time I want to test my SQL statements, are these steps enough ?

    CHECKPOINT

    DBCC DROPCLEANBUFFERS

    DBCC FREEPROCCACHE

    Yes. The drop clean buffers clears the clean pages out of the data cache and the free proccache drops all of the compiled plans.

    (2)Is the execution time of a stored procedure always shorter than that of a Transact-SQL statement (they have the same login of course) ?

    No. They should be much the same unless you have strange parameter sniffing occurring.

    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
  • Thanks

Viewing 3 posts - 1 through 2 (of 2 total)

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