SQL Server 计划缓存那些事儿
查询计划缓存内容
SELECT qs.plan_handle, a.attrlist,* FROM sys.dm_exec_query_stats qs CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) est CROSS APPLY (SELECT epa.attribute + '=' + convert(nvarchar(127), epa.value) + ' ' FROM sys.dm_exec_plan_attributes(qs.plan_handle) epa WHERE epa.is_cache_key = 1 ORDER BY epa.attribute FOR XML PATH('')) AS a(attrlist) WHERE est.text LIKE '%WHERE OrderDate > @orderdate%' AND est.text NOT LIKE '%sys.dm_exec_plan_attributes%'
如何清除特定语句的执行计划缓存?
DBCC FREEPROCCACHE(0x060001002903DC0B4001B887000000000000000000000000)
摘要:https://blog.51cto.com/ultrasql/1626692