<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: SQL Profiler: 'active' vs 'elapsed' vs 'exec' times in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/sql-profiler-active-vs-elapsed-vs-exec-times/qaa-p/13838769#M4869612</link>
    <description>&lt;P&gt;Thanks Breck.  &lt;/P&gt;
&lt;P&gt;I've already got some useful queries based on various connection-level properties but I'm interested in capturing the statement execution times.  &lt;/P&gt;
&lt;P&gt;I've had some success in past using the 'diagnostic tracing' facilities and querying the sa_tmp_diagnostic_* tables but the version 17 documentation says that diagnostic tracing is now deprecated in favour of the SQL Profiler, which is why I'm looking at it now.&lt;/P&gt;
&lt;P&gt;I've looked at both the SQL Any Monitor and the Cockpit but neither have the features I'm after.  I'd be interested in having a look at Foxhound - is there a trial/evaluation version?&lt;/P&gt;</description>
    <pubDate>Wed, 10 May 2017 11:05:05 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2017-05-10T11:05:05Z</dc:date>
    <item>
      <title>SQL Profiler: 'active' vs 'elapsed' vs 'exec' times</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-profiler-active-vs-elapsed-vs-exec-times/qaq-p/13838767</link>
      <description>&lt;P&gt;SQL Anywhere 17.0.6.2757&lt;/P&gt;
&lt;P&gt;I've just started looking at the SQL Profile and I'm a bit confused by the various timing counters it uses.  &lt;/P&gt;
&lt;P&gt;I've been doing 'targeted' sessions and in the initial dialog I have set 'Statement is active for at least 1 second' (and no other criteria).  After leaving it running for a while some rows appear on the 'statements' tab as in the screenshot below [edit: couldn't get embedded image to work so changed to hyperlink]:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://drive.google.com/file/d/0B26a_o0237eLZEV2clR2Y2dERjA/view?usp=sharing" target="_blank"&gt;screenshot&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Initially I had assumed that the avg + max 'exec' columns corresponded to the 'Statement is active for at least 1 second' filter I am using so I didn't understand why the top statement was being shown with an avg exec of 114ms.  I then double-clicked on the top statement in the lower pane and could see various other properties include 'active_time' and 'elapsed_time', which are described in the help file as follows:&lt;/P&gt;
&lt;P&gt;active_time : Time in seconds that the database server spent executing the statement.&lt;/P&gt;
&lt;P&gt;elapsed_time : Wall clock time in seconds between the first fetch and most recent fetch of the cursor.  &lt;/P&gt;
&lt;P&gt;So it looks like the 'exec' times from the list actually correspond to 'elapsed_time' rather that 'active_time', even though the latter seems more important from a performance point of view and also appears to be used by the 'Statement is active for at least N second' filter.  Is this correct?&lt;/P&gt;
&lt;P&gt;I can't see anyway of changing the available columns in the list (e.g. to include avg active_time).  Is there any way of extracting this information using a SQL query?&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2017 05:39:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-profiler-active-vs-elapsed-vs-exec-times/qaq-p/13838767</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-05-10T05:39:11Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Profiler: 'active' vs 'elapsed' vs 'exec' times</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-profiler-active-vs-elapsed-vs-exec-times/qaa-p/13838768#M4869611</link>
      <description>&lt;P&gt;You have asked several questions. I will only &lt;STRONG&gt;attemp&lt;/STRONG&gt;t to give a &lt;STRONG&gt;partial&lt;/STRONG&gt; answer to &lt;STRONG&gt;one&lt;/STRONG&gt; question...&lt;/P&gt;
&lt;P&gt;"Is there any way of extracting this information using a SQL query?"&lt;/P&gt;
&lt;P&gt;The profiler may be making some measurements on its own, as well as performing value-added calculations on &lt;A href="http://dcx.sap.com/index.html#sqla170/en/html/3bc695906c5f10148aaabe9d8f52d0e5.html*loio3bc695906c5f10148aaabe9d8f52d0e5"&gt;SQL Anywhere connection-level properties listed here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;There may not be any way to query the former (measurements proprietary to the profiler), but you may be able to query the latter (SELECT * FROM sa_connection_properties()).&lt;/P&gt;
&lt;P&gt;The Very Bad News &lt;STRONG&gt;may&lt;/STRONG&gt; be that the Profiler displays a lot of statement-level measurements that fall into the former category (measurements proprietary to the profiler).&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Some&lt;/STRONG&gt; good news may lie in &lt;A href="http://dcx.sap.com/index.html#sqla170/en/html/8176dcc36ce21014a3738c0d1cd90f3a.html*loio8176dcc36ce21014a3738c0d1cd90f3a"&gt;sa_procedure_profile()&lt;/A&gt; and &lt;A href="http://dcx.sap.com/index.html#sqla170/en/html/8176d3b76ce2101488d0c16ff8bd2fc2.html"&gt;sa_procedure_profile_summary()&lt;/A&gt;... but don't get too excited.&lt;/P&gt;
&lt;P&gt;FWIW profilers are &lt;STRONG&gt;heavyweight processes&lt;/STRONG&gt;, with heavy loads placed on both computer and human processors ( your brain, trying to find stuff and figure it out :).&lt;/P&gt;
&lt;P&gt;You may find that a &lt;STRONG&gt;lightweight monitor&lt;/STRONG&gt; is a good place to start, to find the hotspots before bringing out the big guns (profiler). &lt;A href="http://dcx.sap.com/index.html#sqla170/en/html/813988db6ce21014a7f08159ea30c870.html*loio813988db6ce21014a7f08159ea30c870"&gt;SQL Anywhere Monitor&lt;/A&gt; is one, &lt;A href="http://www.risingroad.com/foxhound/index.html"&gt;Foxhound&lt;/A&gt; is another; for a full list see page 3 of &lt;A href="http://www.risingroad.com/foxhound-4-0/Foxhound%204%20Database%20Monitor%20White%20Paper.pdf"&gt;the white paper here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2017 10:37:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-profiler-active-vs-elapsed-vs-exec-times/qaa-p/13838768#M4869611</guid>
      <dc:creator>Breck_Carter</dc:creator>
      <dc:date>2017-05-10T10:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Profiler: 'active' vs 'elapsed' vs 'exec' times</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-profiler-active-vs-elapsed-vs-exec-times/qaa-p/13838769#M4869612</link>
      <description>&lt;P&gt;Thanks Breck.  &lt;/P&gt;
&lt;P&gt;I've already got some useful queries based on various connection-level properties but I'm interested in capturing the statement execution times.  &lt;/P&gt;
&lt;P&gt;I've had some success in past using the 'diagnostic tracing' facilities and querying the sa_tmp_diagnostic_* tables but the version 17 documentation says that diagnostic tracing is now deprecated in favour of the SQL Profiler, which is why I'm looking at it now.&lt;/P&gt;
&lt;P&gt;I've looked at both the SQL Any Monitor and the Cockpit but neither have the features I'm after.  I'd be interested in having a look at Foxhound - is there a trial/evaluation version?&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2017 11:05:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-profiler-active-vs-elapsed-vs-exec-times/qaa-p/13838769#M4869612</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-05-10T11:05:05Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Profiler: 'active' vs 'elapsed' vs 'exec' times</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-profiler-active-vs-elapsed-vs-exec-times/qaa-p/13838770#M4869613</link>
      <description>&lt;P&gt;Luke: Send me an email at breck dot carter at gmail dot com to discuss.&lt;/P&gt;
&lt;P&gt;Please understand Foxhound is &lt;STRONG&gt;not&lt;/STRONG&gt; a tracing or profiling tool, it is a sampling monitor, so it will only give periodic snapshots of activity, and it may not have the features you are after... but it may satisfy your needs in other ways &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2017 15:02:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-profiler-active-vs-elapsed-vs-exec-times/qaa-p/13838770#M4869613</guid>
      <dc:creator>Breck_Carter</dc:creator>
      <dc:date>2017-05-10T15:02:26Z</dc:date>
    </item>
  </channel>
</rss>

