<?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>topic Re: Oracle tkprof  output understanding....  exec and fetch counts are the same. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-tkprof-output-understanding-exec-and-fetch-counts-are-the/m-p/2746567#M834520</link>
    <description>Jack,&lt;BR /&gt;&lt;BR /&gt;There's no reason that the index should not be used with that query.&lt;BR /&gt;&lt;BR /&gt;1) Are you sure the table and index statistics are up to date?&lt;BR /&gt;&lt;BR /&gt;2) Are you using histograms? If so, try rebuilding the stats without them or with only one bucket.&lt;BR /&gt;&lt;BR /&gt;3) What version of Oracle is it?&lt;BR /&gt;&lt;BR /&gt;Also, what's the code of the calling program? It still looks like it's being executed 332 times, though perhaps that's a bug in tkprof.&lt;BR /&gt;&lt;BR /&gt;May the force be with you...&lt;BR /&gt;&lt;BR /&gt;Ryan</description>
    <pubDate>Wed, 19 Jun 2002 14:09:45 GMT</pubDate>
    <dc:creator>Ryan Kogelheide</dc:creator>
    <dc:date>2002-06-19T14:09:45Z</dc:date>
    <item>
      <title>Oracle tkprof  output understanding....  exec and fetch counts are the same.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-tkprof-output-understanding-exec-and-fetch-counts-are-the/m-p/2746559#M834512</link>
      <description>Hi, I executed tkprof against a heavy hitter on my system.&lt;BR /&gt;&lt;BR /&gt;I'm not sure I'm reading the output correct.  Does the following tell me the statement executed 332 times and the code likely only used the first record each time the code executed?  There are 332 fetches also.  A one-to-one ratio for the executions.&lt;BR /&gt;&lt;BR /&gt;I suspect the sql is executed, the row is deleted and then the sql is executed again with a new value of mx_timestamp.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;select rowid rowid_cid199, invent_hist.* &lt;BR /&gt;FROM&lt;BR /&gt; invent_hist WHERE   (mx_timestamp &amp;lt;&amp;gt; 0 and mx_timestamp &amp;lt; 962114678) &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;call     count       cpu    elapsed       disk      query    current        rows&lt;BR /&gt;------- ------  -------- ---------- ---------- ---------- ----------  ----------&lt;BR /&gt;Parse        0      0.00       0.00          0          0          0           0&lt;BR /&gt;Execute    332      0.03       0.10          0          0          0           0&lt;BR /&gt;Fetch      332   1042.40    1702.53    7944425    7955798        664         332&lt;BR /&gt;------- ------  -------- ---------- ---------- ---------- ----------  ----------&lt;BR /&gt;total      664   1042.43    1702.63    7944425    7955798        664         332&lt;BR /&gt;&lt;BR /&gt;Misses in library cache during parse: 0&lt;BR /&gt;Optimizer goal: CHOOSE&lt;BR /&gt;Parsing user id: 21  (MSDUSR)&lt;BR /&gt;&lt;BR /&gt;Rows     Execution Plan&lt;BR /&gt;-------  ---------------------------------------------------&lt;BR /&gt;      0  SELECT STATEMENT   GOAL: CHOOSE&lt;BR /&gt;      0   TABLE ACCESS   GOAL: ANALYZED (FULL) OF 'INVENT_HIST'&lt;BR /&gt;&lt;BR /&gt;********************************************************************************&lt;BR /&gt;</description>
      <pubDate>Mon, 17 Jun 2002 20:26:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-tkprof-output-understanding-exec-and-fetch-counts-are-the/m-p/2746559#M834512</guid>
      <dc:creator>Jack C. Mahaffey</dc:creator>
      <dc:date>2002-06-17T20:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle tkprof  output understanding....  exec and fetch counts are the same.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-tkprof-output-understanding-exec-and-fetch-counts-are-the/m-p/2746560#M834513</link>
      <description>What you say sounds right. I believe tkprof summarizes by looking at sql that uses the same sql area, so if the bind value changes, it's still the same statement. it may be that it does not print it as a bind if it is not explicitly bound (i.e. you're using cursor_sharing=force).&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 18 Jun 2002 09:17:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-tkprof-output-understanding-exec-and-fetch-counts-are-the/m-p/2746560#M834513</guid>
      <dc:creator>Ryan Kogelheide</dc:creator>
      <dc:date>2002-06-18T09:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle tkprof  output understanding....  exec and fetch counts are the same.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-tkprof-output-understanding-exec-and-fetch-counts-are-the/m-p/2746561#M834514</link>
      <description>Well,&lt;BR /&gt;&lt;BR /&gt;the best info is&lt;BR /&gt;&lt;BR /&gt;0 SELECT STATEMENT GOAL: CHOOSE &lt;BR /&gt;0 TABLE ACCESS GOAL: ANALYZED (FULL) OF 'INVENT_HIST' &lt;BR /&gt;&lt;BR /&gt;Create an index on column mx_timestamp, and it will fly like hell.&lt;BR /&gt;&lt;BR /&gt;If it behaves the way you suspect, that would be bad application programming, but if you can not access the source ther will be no way to change that.&lt;BR /&gt;If you create the index, it will also be executed 332 times, but much quicker.&lt;BR /&gt;&lt;BR /&gt;Hope this helps&lt;BR /&gt;Volker</description>
      <pubDate>Tue, 18 Jun 2002 12:08:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-tkprof-output-understanding-exec-and-fetch-counts-are-the/m-p/2746561#M834514</guid>
      <dc:creator>Volker Borowski</dc:creator>
      <dc:date>2002-06-18T12:08:53Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle tkprof  output understanding....  exec and fetch counts are the same.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-tkprof-output-understanding-exec-and-fetch-counts-are-the/m-p/2746562#M834515</link>
      <description>There is an index on mx_timestamp.  It's not used.  I suspect the index is ignored because all the columns are being returned.&lt;BR /&gt;&lt;BR /&gt;I also noticed that there isn't a unique primary key on the table.</description>
      <pubDate>Wed, 19 Jun 2002 11:17:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-tkprof-output-understanding-exec-and-fetch-counts-are-the/m-p/2746562#M834515</guid>
      <dc:creator>Jack C. Mahaffey</dc:creator>
      <dc:date>2002-06-19T11:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle tkprof  output understanding....  exec and fetch counts are the same.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-tkprof-output-understanding-exec-and-fetch-counts-are-the/m-p/2746563#M834516</link>
      <description>It's not using the index because of the &amp;lt;&amp;gt; (not equal will suppress and index)&lt;BR /&gt;&lt;BR /&gt;If the column dosn't have negative numbers, change the query to&lt;BR /&gt;&lt;BR /&gt;WHERE (mx_timestamp &amp;gt; 0 and mx_timestamp &amp;lt; 962114678) &lt;BR /&gt;&lt;BR /&gt;Depending on the range of values, this should do an index range scan. &lt;BR /&gt;</description>
      <pubDate>Wed, 19 Jun 2002 12:19:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-tkprof-output-understanding-exec-and-fetch-counts-are-the/m-p/2746563#M834516</guid>
      <dc:creator>Alwyn Santos</dc:creator>
      <dc:date>2002-06-19T12:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle tkprof  output understanding....  exec and fetch counts are the same.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-tkprof-output-understanding-exec-and-fetch-counts-are-the/m-p/2746564#M834517</link>
      <description>I've made the recommendation of removing the '&amp;lt;&amp;gt;' at first looking at the sql.  The explain plan did not change...&lt;BR /&gt;&lt;BR /&gt;jack...</description>
      <pubDate>Wed, 19 Jun 2002 12:26:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-tkprof-output-understanding-exec-and-fetch-counts-are-the/m-p/2746564#M834517</guid>
      <dc:creator>Jack C. Mahaffey</dc:creator>
      <dc:date>2002-06-19T12:26:04Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle tkprof  output understanding....  exec and fetch counts are the same.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-tkprof-output-understanding-exec-and-fetch-counts-are-the/m-p/2746565#M834518</link>
      <description>You may have to hint the index to get it to work.&lt;BR /&gt;&lt;BR /&gt;select /*+ index(table_name index_name) */  rowid rowid_cid199, invent_hist.* &lt;BR /&gt;FROM invent_hist WHERE (mx_timestamp &amp;lt;&amp;gt; 0 and mx_timestamp &amp;lt; 962114678) &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 19 Jun 2002 12:33:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-tkprof-output-understanding-exec-and-fetch-counts-are-the/m-p/2746565#M834518</guid>
      <dc:creator>Alwyn Santos</dc:creator>
      <dc:date>2002-06-19T12:33:28Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle tkprof  output understanding....  exec and fetch counts are the same.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-tkprof-output-understanding-exec-and-fetch-counts-are-the/m-p/2746566#M834519</link>
      <description>I would expect bind variables to&lt;BR /&gt;show up as :1 :2 etc.&lt;BR /&gt;&lt;BR /&gt;It looks like the query is already &lt;BR /&gt;parsed in the SGA (parse count = 0).&lt;BR /&gt;&lt;BR /&gt;The fetch is executed once for each &lt;BR /&gt;execution.&lt;BR /&gt;&lt;BR /&gt;If they are looping on this statement&lt;BR /&gt;then you should consider using a cursor&lt;BR /&gt;and fetching each row and procesing it&lt;BR /&gt;in a loop. &lt;BR /&gt;&lt;BR /&gt;If the table hasn't been analyzed &lt;BR /&gt;recently, then the statistics may &lt;BR /&gt;not be available to cause use of the&lt;BR /&gt;index.&lt;BR /&gt;&lt;BR /&gt;Try a statement like&lt;BR /&gt;&lt;BR /&gt;SELECT  ROWID rowid_cid199, &lt;BR /&gt;        invent_hist.* &lt;BR /&gt;FROM    invent_hist &lt;BR /&gt;WHERE   mx_timestamp = (&lt;BR /&gt;        SELECT  mx_timestamp&lt;BR /&gt; FROM    invent_hist &lt;BR /&gt; WHERE   mx_timestamp &amp;lt;&amp;gt; 0 &lt;BR /&gt; AND     mx_timestamp &amp;lt; :1) &lt;BR /&gt;</description>
      <pubDate>Wed, 19 Jun 2002 13:59:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-tkprof-output-understanding-exec-and-fetch-counts-are-the/m-p/2746566#M834519</guid>
      <dc:creator>Bill Thorsteinson</dc:creator>
      <dc:date>2002-06-19T13:59:53Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle tkprof  output understanding....  exec and fetch counts are the same.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-tkprof-output-understanding-exec-and-fetch-counts-are-the/m-p/2746567#M834520</link>
      <description>Jack,&lt;BR /&gt;&lt;BR /&gt;There's no reason that the index should not be used with that query.&lt;BR /&gt;&lt;BR /&gt;1) Are you sure the table and index statistics are up to date?&lt;BR /&gt;&lt;BR /&gt;2) Are you using histograms? If so, try rebuilding the stats without them or with only one bucket.&lt;BR /&gt;&lt;BR /&gt;3) What version of Oracle is it?&lt;BR /&gt;&lt;BR /&gt;Also, what's the code of the calling program? It still looks like it's being executed 332 times, though perhaps that's a bug in tkprof.&lt;BR /&gt;&lt;BR /&gt;May the force be with you...&lt;BR /&gt;&lt;BR /&gt;Ryan</description>
      <pubDate>Wed, 19 Jun 2002 14:09:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-tkprof-output-understanding-exec-and-fetch-counts-are-the/m-p/2746567#M834520</guid>
      <dc:creator>Ryan Kogelheide</dc:creator>
      <dc:date>2002-06-19T14:09:45Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle tkprof  output understanding....  exec and fetch counts are the same.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-tkprof-output-understanding-exec-and-fetch-counts-are-the/m-p/2746568#M834521</link>
      <description>Oracle 7.3.4 on HP-UX&lt;BR /&gt;&lt;BR /&gt;Thanks for the SQL ideas.  The explain plans look much better.  I kinda like the idea of a short-term interim fix of having them change the statement to the following:&lt;BR /&gt;&lt;BR /&gt;SELECT ROWID rowid_cid199, &lt;BR /&gt; invent_hist.* &lt;BR /&gt;FROM invent_hist &lt;BR /&gt;WHERE mx_timestamp = ( &lt;BR /&gt; SELECT min(mx_timestamp)&lt;BR /&gt; FROM invent_hist &lt;BR /&gt; WHERE mx_timestamp &amp;gt; 0 &lt;BR /&gt; AND mx_timestamp &amp;lt; 962289620) &lt;BR /&gt;&lt;BR /&gt;This results in only a sql statement change.&lt;BR /&gt;&lt;BR /&gt;I'm bugging the app developers about the performance. &lt;BR /&gt;&lt;BR /&gt;Here's the latest performance of the cursosr for 53 minutes.  Performance really sucks...&lt;BR /&gt;&lt;BR /&gt;call     count       cpu    elapsed       disk      query    current        rows&lt;BR /&gt;------- ------  -------- ---------- ---------- ---------- ----------  ----------&lt;BR /&gt;Parse        0      0.00       0.00          0          0          0           0&lt;BR /&gt;Execute    711      0.10       0.23          0          0          0           0&lt;BR /&gt;Fetch      711   2306.86    2852.25   17801524   17838125       1422         711&lt;BR /&gt;------- ------  -------- ---------- ---------- ---------- ----------  ----------&lt;BR /&gt;total     1422   2306.96    2852.48   17801524   17838125       1422         711&lt;BR /&gt;&lt;BR /&gt;2306 / 60 = 38.43 minutes of cpu overhead&lt;BR /&gt;2852 / 60 = 47.54 minutes of elapsed time&lt;BR /&gt;17801524 * 8192 bytes per block = 145,830,084,608 bytes read from disk io (146 gb)&lt;BR /&gt;17838125 * 8192 = 146,149,920,000 oracle blocks bytes read   (146gb)&lt;BR /&gt;711 records processed&lt;BR /&gt;&lt;BR /&gt;And yes the statistics are updated on a regular basis.&lt;BR /&gt;&lt;BR /&gt;I'm also trying to find out why they are retrieving all the columns.  I'm suggesting a longer term solution to not retrieve all the columns and use a cursor to drive the application to ensure an index is used and data is only retrieved if necessary.&lt;BR /&gt;&lt;BR /&gt;jack...</description>
      <pubDate>Wed, 19 Jun 2002 15:11:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-tkprof-output-understanding-exec-and-fetch-counts-are-the/m-p/2746568#M834521</guid>
      <dc:creator>Jack C. Mahaffey</dc:creator>
      <dc:date>2002-06-19T15:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle tkprof  output understanding....  exec and fetch counts are the same.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-tkprof-output-understanding-exec-and-fetch-counts-are-the/m-p/2746569#M834522</link>
      <description>Hi Jack,&lt;BR /&gt;&lt;BR /&gt;another idea, as 7.x might not be able to use the index with "&amp;gt;" and "&amp;lt;"&lt;BR /&gt;&lt;BR /&gt;SELECT ... WHERE var BETWEEN low: and high: ;&lt;BR /&gt;&lt;BR /&gt;Should take the index even in Oracle 7.x.&lt;BR /&gt;&lt;BR /&gt;What the heck do they want with so many rows ?&lt;BR /&gt;If this table is queuelike (insert/delete) and you ave some GB to be read, consider to reorganize it, because it might be fragmented.&lt;BR /&gt;Select bytes from dba_segments, calculate an average row_length and do a select count(*). Multiply count(*) with average row-length and compare to bytes from dba_segments. If this shows a big diffrence (bytes significantly bigger), go for a reorg.&lt;BR /&gt;&lt;BR /&gt;If you do not need all columns, but only a,b,c consider to create the index as&lt;BR /&gt;&lt;BR /&gt;mx_timestamp,a,b,c because the range youe have for mx_timestamp apears not to be so small, an INDEX_FAST_FULLSCAN might reduce the IO, ...(although I do not remember, if Oracle is capable of fast_fullscans in 7.3).&lt;BR /&gt;&lt;BR /&gt;In addition, I'd like to see the diffrent explains as well.&lt;BR /&gt;&lt;BR /&gt;Volker</description>
      <pubDate>Thu, 20 Jun 2002 09:00:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-tkprof-output-understanding-exec-and-fetch-counts-are-the/m-p/2746569#M834522</guid>
      <dc:creator>Volker Borowski</dc:creator>
      <dc:date>2002-06-20T09:00:30Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle tkprof  output understanding....  exec and fetch counts are the same.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-tkprof-output-understanding-exec-and-fetch-counts-are-the/m-p/2746570#M834523</link>
      <description />
      <pubDate>Thu, 20 Jun 2002 19:14:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-tkprof-output-understanding-exec-and-fetch-counts-are-the/m-p/2746570#M834523</guid>
      <dc:creator>Jack C. Mahaffey</dc:creator>
      <dc:date>2002-06-20T19:14:29Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle tkprof  output understanding....  exec and fetch counts are the same.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-tkprof-output-understanding-exec-and-fetch-counts-are-the/m-p/2746571#M834524</link>
      <description>I'm getting real good at tracing active SQL on a HP-UX server.  Does anyone have any guidance for finding the heavy hitters on a Windows NT, XP, 2000 server?&lt;BR /&gt;&lt;BR /&gt;Can any performance counter be used to find the corresponding spid in v$process?&lt;BR /&gt;&lt;BR /&gt;Note that we don't have the performance pack installed.&lt;BR /&gt;&lt;BR /&gt;jack...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 20 Jun 2002 19:22:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-tkprof-output-understanding-exec-and-fetch-counts-are-the/m-p/2746571#M834524</guid>
      <dc:creator>Jack C. Mahaffey</dc:creator>
      <dc:date>2002-06-20T19:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle tkprof  output understanding....  exec and fetch counts are the same.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-tkprof-output-understanding-exec-and-fetch-counts-are-the/m-p/2746572#M834525</link>
      <description>select /*+ index(table_name index_name) */ rowid rowid_cid199, invent_hist.* &lt;BR /&gt;FROM invent_hist WHERE (mx_timestamp &amp;lt;&amp;gt; 0 and mx_timestamp &amp;lt; 962114678) &lt;BR /&gt;&lt;BR /&gt;Should actually be...&lt;BR /&gt;&lt;BR /&gt;select /*+ index(invent_hist index_name) */ rowid rowid_cid199, invent_hist.* &lt;BR /&gt;FROM invent_hist WHERE (mx_timestamp &amp;gt; 0 and mx_timestamp &amp;lt; 962114678) &lt;BR /&gt;&lt;BR /&gt;* index_name should be changed to the index you want to use.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Also, to find poorly performing queries on NT or any oracle db...&lt;BR /&gt;&lt;BR /&gt;select disk_reads,buffer_gets,executions,sql_text&lt;BR /&gt;from v$sqlarea&lt;BR /&gt;where disk_reads &amp;gt; 10000&lt;BR /&gt; or buffer_gets &amp;gt; 100000&lt;BR /&gt;order by disk_reads,buffer_gets&lt;BR /&gt;/&lt;BR /&gt;&lt;BR /&gt;Concentrate on statements that have high disk read/execution ratio.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 21 Jun 2002 14:28:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-tkprof-output-understanding-exec-and-fetch-counts-are-the/m-p/2746572#M834525</guid>
      <dc:creator>Alwyn Santos</dc:creator>
      <dc:date>2002-06-21T14:28:44Z</dc:date>
    </item>
  </channel>
</rss>

