plan cache last flush time?

  • Is there any way to determine the last time the plan cache was flushed?

    Thanks in advance for the help.

  • Except for certain operations the flush the cache, it's pretty much being constantly flushed, depending on the pressure on memory. But, to my knowledge, there's no way to know for sure. One thing you can do though, is run a query against one of the DMOs that uses the cache and look at the creation date for the entry. The oldest one will show you the last time the entire cache was flushed. One example is sys.dm_exec_query_stats.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Are you looking for a deliberate flush, like a DBCC comment? The default trace might help.

  • Yes, I was looking for a diliberate flush with DBCC FREE...CACHE. Sorry I should have been more specific.

    Thanks again for the help.

  • Error log should have an entry for DBCC FREE...CACHE

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

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