<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Monitoring on My New Hugo Site</title>
    <link>https://sqltools.se/monitoring/index.html</link>
    <description>Recent content in Monitoring on My New Hugo Site</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Sat, 17 Dec 2022 19:36:32 +0100</lastBuildDate><atom:link href="https://sqltools.se/monitoring/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Work With Execution Plans in Cache</title>
      <link>https://sqltools.se/monitoring/work-with-execution-plans-in-cache/index.html</link>
      <pubDate>Thu, 22 Dec 2022 12:30:10 +0100</pubDate>
      <guid>https://sqltools.se/monitoring/work-with-execution-plans-in-cache/index.html</guid>
      <description>Find query plan for a query Use this query if you like find info about cached execution plans. It display the query text as well as the showplanxml that can bee viewed as a grafical execution plan in management studio.
SELECT c.usecounts ,c.cacheobjtype ,c.objtype ,t.text ,x.query_plan ,qs.creation_time ,qs.last_execution_time ,qs.max_elapsed_time ,qs.max_logical_reads ,qs.total_elapsed_time/qs.execution_count AS [Average_elapsed_time] FROM sys.dm_exec_cached_plans c JOIN sys.dm_exec_query_stats qs ON qs.plan_handle = c.plan_handle CROSS APPLY sys.dm_exec_sql_text(c.plan_handle) t CROSS APPLY sys.dm_exec_query_plan(c.plan_handle) x WHERE t.</description>
    </item>
  </channel>
</rss>