Cache - Hit & Miss

  • Hi,

    I was wondering if someone could explain something to me.

    In the attached script I am running 2 ad-hoc queries and the 2 parameterised queries.

    When I monitor the cache hits and misses I see the following behaviour.

    Ad-hoc query 1 (abc value) - Cache miss and then insert - This makes sense

    Ad-hoc query 2 (def value) - Cache miss and then insert - This makes sense as well

    Parameterised query 1 (abc value) - Cache miss and then insert - Also makes sense

    Parameterised query 2 (def value) - Cache miss and cache hit - This doesn't make sense, I know I'm get the plan reuse from the hit, but why do I have a miss in there?

    I know this is normal behaviour or so I've read in a number of places, but why is that?

    Any help would be appreciated.

    Thanks

  • http://sqlinthewild.co.za/index.php/2010/07/27/hit-and-miss/

    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 Gail, that makes a lot more sense now.

    Nic

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

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