Execution plan

  • Hi Team,

    How to get  execution plan of a SQL which has executed two days back?

    And how to compare two execution plans?

  • krishnabudampati - Monday, May 29, 2017 5:36 AM

    Hi Team,

    How to get  execution plan of a SQL which has executed two days back?

    And how to compare two execution plans?

    Grab this book SQL Server Execution Plans, 2nd Edition by Grant Fritchey
    😎

  • krishnabudampati - Monday, May 29, 2017 5:36 AM

    How to get  execution plan of a SQL which has executed two days back?

    Unless that plan is still in cache, you don't. SQL doesn't keep historical record of plans (well, not in 2014). You can try querying sys.dm_exec_cached_plans and sys.dm_exec_query_plan, however if the plan is not the one you're looking for, there will be no way to get it.

    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

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

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