How to get the query which need to be compiled

  • Hi all,

    I got high numbers in SQL Comiplations/Sec and lower number in SQL re-Compilatios/sec using Perfmon.

    Some articles said that high SQL Comiplations/Sec means low rate of plan reuse. I would like to Capture the queries which need to compile and never be reused. Then I might have a clue why this happens.

    SQL Server 2005, windows 2003. in this instance, there are more than 80 databases.

    Thanks.

    Judy

  • Judy-363345 (11/13/2009)


    Hi all,

    I got high numbers in SQL Comiplations/Sec and lower number in SQL re-Compilatios/sec using Perfmon.

    Some articles said that high SQL Comiplations/Sec means low rate of plan reuse. I would like to Capture the queries which need to compile and never be reused. Then I might have a clue why this happens.

    SQL Server 2005, windows 2003. in this instance, there are more than 80 databases.

    Thanks.

    Judy

    In SQL Profiler SP:Recompile will show you which stored procedures recompile.

    Alex S
  • ... SQL:StmtRecompile for custom SQL.

  • Also check out the Plan cache miss and plan cache insert events (also in profiler)

    I don't recall if the SP:Recompile and TSQL:StmtRecompile show compiles or just recompiles. Test them out.

    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
  • For full details click here

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

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