存儲過程執行計劃緩存查詢
阿新 • • 發佈:2018-07-31
bstr where 1=1 desc .text ast 計劃 oss 計劃緩存 outer
SELECT st.Text,
SUBSTRING(
st.Text, (qs.statement_start_offset/2)+1,
((CASE qs.statement_end_offset
WHEN -1 THEN DATALENGTH(st.Text)
ELSE qs.statement_end_offset
END - qs.statement_start_offset)/2)+1
),
qp.query_plan,
qs.plan_handle,
qs.sql_handle,
DB_NAME(st.dbid) as dbname,
qs.creation_time,
qs.last_execution_time,
getdate() as currenttime,
qs.execution_count,
qs.last_worker_time,
qs.last_physical_reads,
qs.last_logical_reads,
qs.last_elapsed_time
FROM sys.dm_exec_query_stats qs
CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) as st
OUTER APPLY sys.dm_exec_query_plan(qs.plan_handle) as qp
WHERE 1=1
and st.text like ‘%Grants_SumGrantsFromVesting%‘
order by creation_time desc
存儲過程執行計劃緩存查詢