<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Plan timing</title>
	<atom:link href="http://jonathanlewis.wordpress.com/2012/11/19/plan-timing/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com/2012/11/19/plan-timing/</link>
	<description>Just another Oracle weblog</description>
	<lastBuildDate>Wed, 22 May 2013 12:40:08 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: kgandhi80</title>
		<link>http://jonathanlewis.wordpress.com/2012/11/19/plan-timing/#comment-53772</link>
		<dc:creator><![CDATA[kgandhi80]]></dc:creator>
		<pubDate>Mon, 25 Feb 2013 12:06:27 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=9924#comment-53772</guid>
		<description><![CDATA[Hi Jonathan
When  automatic degree policy is set to AUTO. the parallel degree policy is derived from Elapsed time .
Many times the estimate is wrong and queries doesnt use parallel degree.
Can you give some examples of how elapsed time are determined in explain plan ,just like you did for cost in your book]]></description>
		<content:encoded><![CDATA[<p>Hi Jonathan<br />
When  automatic degree policy is set to AUTO. the parallel degree policy is derived from Elapsed time .<br />
Many times the estimate is wrong and queries doesnt use parallel degree.<br />
Can you give some examples of how elapsed time are determined in explain plan ,just like you did for cost in your book</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: srivenu kadiyala</title>
		<link>http://jonathanlewis.wordpress.com/2012/11/19/plan-timing/#comment-51645</link>
		<dc:creator><![CDATA[srivenu kadiyala]]></dc:creator>
		<pubDate>Mon, 26 Nov 2012 16:48:41 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=9924#comment-51645</guid>
		<description><![CDATA[I completely missed the missing bracket. I expected to see the &quot;greater than&quot; and &quot;lesser than&quot; and was wondering why only the &quot;equality&quot; predicate was present.]]></description>
		<content:encoded><![CDATA[<p>I completely missed the missing bracket. I expected to see the &#8220;greater than&#8221; and &#8220;lesser than&#8221; and was wondering why only the &#8220;equality&#8221; predicate was present.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2012/11/19/plan-timing/#comment-51628</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Sun, 25 Nov 2012 09:27:42 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=9924#comment-51628</guid>
		<description><![CDATA[Given the imbalance in the brackets, I think there&#039;s some extra part of the predicate that&#039;s gone missing while the text was being copied. Possibly because of the problem of &quot;greater than&quot; and &quot;less than&quot; symbols, but maybe just a line lost in cutting and pasting.  (Notice that the &quot;between&quot; predicate from the query doesn&#039;t seem to be present in the predicate section of the plan.)]]></description>
		<content:encoded><![CDATA[<p>Given the imbalance in the brackets, I think there&#8217;s some extra part of the predicate that&#8217;s gone missing while the text was being copied. Possibly because of the problem of &#8220;greater than&#8221; and &#8220;less than&#8221; symbols, but maybe just a line lost in cutting and pasting.  (Notice that the &#8220;between&#8221; predicate from the query doesn&#8217;t seem to be present in the predicate section of the plan.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: srivenu kadiyala</title>
		<link>http://jonathanlewis.wordpress.com/2012/11/19/plan-timing/#comment-51627</link>
		<dc:creator><![CDATA[srivenu kadiyala]]></dc:creator>
		<pubDate>Sun, 25 Nov 2012 06:13:26 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=9924#comment-51627</guid>
		<description><![CDATA[Hi Jonathan,
I was just wondering about this predicate information for line 5 in the old plan.

   5 - filter((&quot;BW&quot;.&quot;BEGIN_TMSP&quot;=:B1)  

thanks &amp; regards
srivenu]]></description>
		<content:encoded><![CDATA[<p>Hi Jonathan,<br />
I was just wondering about this predicate information for line 5 in the old plan.</p>
<p>   5 &#8211; filter((&#8220;BW&#8221;.&#8221;BEGIN_TMSP&#8221;=:B1)  </p>
<p>thanks &amp; regards<br />
srivenu</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Plan Order &#171; Oracle Scratchpad</title>
		<link>http://jonathanlewis.wordpress.com/2012/11/19/plan-timing/#comment-51583</link>
		<dc:creator><![CDATA[Plan Order &#171; Oracle Scratchpad]]></dc:creator>
		<pubDate>Wed, 21 Nov 2012 18:53:34 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=9924#comment-51583</guid>
		<description><![CDATA[[...] previous post reminded me of another (fairly special) case where the order of operations in an execution plan [...]]]></description>
		<content:encoded><![CDATA[<p>[...] previous post reminded me of another (fairly special) case where the order of operations in an execution plan [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin Meade</title>
		<link>http://jonathanlewis.wordpress.com/2012/11/19/plan-timing/#comment-51582</link>
		<dc:creator><![CDATA[Kevin Meade]]></dc:creator>
		<pubDate>Wed, 21 Nov 2012 15:51:43 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=9924#comment-51582</guid>
		<description><![CDATA[Yes you are correct, I mis-read.  You want the original index.
[sourcecode]
10:50:58 SQL&gt; @showindexes rrs_shr rrs_etl_batch_window

INDEX_NAME                     COLUMN_NAME                    INDEX_TYPE                  UNIQUENES TABLESPACE_NAME
------------------------------ ------------------------------ --------------------------- --------- --------------------
IAK1_RRS_ETL_BATCH_WINDOW      SNAPSHOT_DT                    NORMAL                      NONUNIQUE RRS_SHR_TS

IAK2_RRS_ETL_BATCH_WINDOW      OBJECT_NM                      NORMAL                      NONUNIQUE RRS_SHR_TS
                               SNAPSHOT_DT                    NORMAL                      NONUNIQUE RRS_SHR_TS
                               RPTG_WINDOW_TYPE               NORMAL                      NONUNIQUE RRS_SHR_TS
                               BEGIN_TMSP                     NORMAL                      NONUNIQUE RRS_SHR_TS
                               END_TMSP                       NORMAL                      NONUNIQUE RRS_SHR_TS

IDX$$_57E20001                 OBJECT_NM                      NORMAL                      NONUNIQUE RRS_SHR_TS
                               RPTG_WINDOW_TYPE               NORMAL                      NONUNIQUE RRS_SHR_TS
                               END_TMSP                       NORMAL                      NONUNIQUE RRS_SHR_TS

IDX1_RRS_ETL_BATCH_WINDOW      OBJECT_NM                      NORMAL                      NONUNIQUE RRS_SHR_TS
                               END_TMSP                       NORMAL                      NONUNIQUE RRS_SHR_TS
                               SNAPSHOT_DT                    NORMAL                      NONUNIQUE RRS_SHR_TS

IPK_RRS_ETL_BATCH_WINDOW       RRS_ETL_BATCH_WINDOW_PK_ID     NORMAL                      UNIQUE    RRS_SHR_TS

IUK1_RRS_ETL_BATCH_WINDOW      OBJECT_ID                      NORMAL                      UNIQUE    RRS_SHR_TS
                               SNAPSHOT_DT                    NORMAL                      UNIQUE    RRS_SHR_TS


15 rows selected.

Elapsed: 00:00:00.51
10:51:06 SQL&gt;
[/sourcecode]
]]></description>
		<content:encoded><![CDATA[<p>Yes you are correct, I mis-read.  You want the original index.</p>
<pre class="brush: plain; title: ; notranslate">
10:50:58 SQL&amp;gt; @showindexes rrs_shr rrs_etl_batch_window

INDEX_NAME                     COLUMN_NAME                    INDEX_TYPE                  UNIQUENES TABLESPACE_NAME
------------------------------ ------------------------------ --------------------------- --------- --------------------
IAK1_RRS_ETL_BATCH_WINDOW      SNAPSHOT_DT                    NORMAL                      NONUNIQUE RRS_SHR_TS

IAK2_RRS_ETL_BATCH_WINDOW      OBJECT_NM                      NORMAL                      NONUNIQUE RRS_SHR_TS
                               SNAPSHOT_DT                    NORMAL                      NONUNIQUE RRS_SHR_TS
                               RPTG_WINDOW_TYPE               NORMAL                      NONUNIQUE RRS_SHR_TS
                               BEGIN_TMSP                     NORMAL                      NONUNIQUE RRS_SHR_TS
                               END_TMSP                       NORMAL                      NONUNIQUE RRS_SHR_TS

IDX$$_57E20001                 OBJECT_NM                      NORMAL                      NONUNIQUE RRS_SHR_TS
                               RPTG_WINDOW_TYPE               NORMAL                      NONUNIQUE RRS_SHR_TS
                               END_TMSP                       NORMAL                      NONUNIQUE RRS_SHR_TS

IDX1_RRS_ETL_BATCH_WINDOW      OBJECT_NM                      NORMAL                      NONUNIQUE RRS_SHR_TS
                               END_TMSP                       NORMAL                      NONUNIQUE RRS_SHR_TS
                               SNAPSHOT_DT                    NORMAL                      NONUNIQUE RRS_SHR_TS

IPK_RRS_ETL_BATCH_WINDOW       RRS_ETL_BATCH_WINDOW_PK_ID     NORMAL                      UNIQUE    RRS_SHR_TS

IUK1_RRS_ETL_BATCH_WINDOW      OBJECT_ID                      NORMAL                      UNIQUE    RRS_SHR_TS
                               SNAPSHOT_DT                    NORMAL                      UNIQUE    RRS_SHR_TS


15 rows selected.

Elapsed: 00:00:00.51
10:51:06 SQL&amp;gt;
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: srivenu kadiyala</title>
		<link>http://jonathanlewis.wordpress.com/2012/11/19/plan-timing/#comment-51581</link>
		<dc:creator><![CDATA[srivenu kadiyala]]></dc:creator>
		<pubDate>Wed, 21 Nov 2012 15:46:18 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=9924#comment-51581</guid>
		<description><![CDATA[I think you misunderstood my question. Can you give me the details of the index IDX1_RRS_ETL_BATCH_WINDOW]]></description>
		<content:encoded><![CDATA[<p>I think you misunderstood my question. Can you give me the details of the index IDX1_RRS_ETL_BATCH_WINDOW</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin Meade</title>
		<link>http://jonathanlewis.wordpress.com/2012/11/19/plan-timing/#comment-51579</link>
		<dc:creator><![CDATA[Kevin Meade]]></dc:creator>
		<pubDate>Wed, 21 Nov 2012 13:46:46 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=9924#comment-51579</guid>
		<description><![CDATA[Sure, In the end we found one possible solution.  This particular query was the perverbial (it ran in a few minutes on TEST, but never finishes in PROD) query.  As I write this, there is someone trying to finish a run of this query in PROD and it has been going for 12 hours.  In any event, there are two things:

I offered up this index and this query rewrite which gives this plan.  My testing during the day saw this complete in 15 minutes.  These guys ran it @8pm last night and it finished for them in 32 seconds.  I can&#039;t for the life of me figure out how they got 32 seconds when the best I could do was 15 minutes so I asked for some clarification on how they determined their answer set was correct and if they did anything else.  For now though:

I believe the solution comes from the scalar subquery initially being woofully inefficient since Oracle does not have the metadata to know that this subquery will always return one and only one row.  I confirmed this with the app team and data analysts since there are (shame) not constraints on these tables.  After using the ROWNUM tricks, Oracle stops looking down the index once he finds the hit he wants because by the nature of the data their will always be one row and only one row that batches the date bracketing, for each key.  I always supected the scalar was the issues because removing it from the query yielded a 2 second query every time.  So doing something to &quot;FIX&quot; how the scalar subquery was being processed seemed like the right approach.

BY THE WAY, anyone know how to format in this forum.  I like this place and figure on contributing but I feel bad about posted hard to read stuff.

Notice the use of ROWNUM in two places.  Yes a hack but it gives me what I want without (given the nature of the data) changing the semantics of the query.
[sourcecode]
09:46:27 SQL&gt; create index kevi1 on RRS_SHR.RRS_ETL_BATCH_WINDOW (RPTG_WINDOW_TYPE,OBJECT_NM,BEGIN_TMSP,END_TMSP,SNAPSHOT_DT)
10:18:32   2  nologging
10:18:32   3  /

Index created.

Elapsed: 00:00:03.50

10:18:36 SQL&gt; create table kevtemp5
10:19:38   2  nologging
10:19:38   3  as
10:19:38   4  SELECT SRCE_EFF_START_TMSP, 
10:19:38   5         AGGREGATECLAIMUID 
10:19:38   6  FROM (
10:19:38   7       SELECT  A.AGGREGATECLAIMUID, 
10:19:38   8               A.SNAPSHOT_DT, 
10:19:38   9               MAX(A.SRCE_EFF_START_TMSP) SRCE_EFF_START_TMSP
10:19:38  10       FROM (SELECT PI.AGGREGATECLAIMUID, 
10:19:38  11                    PI.SRCE_EFF_START_TMSP, 
10:19:38  12                    (SELECT BW.SNAPSHOT_DT
10:19:38  13                     FROM RRS_SHR.RRS_ETL_BATCH_WINDOW BW, RRS_SHR.RRS_LOAD_STATUS RLS
10:19:38  14                     WHERE RLS.ASTG_LOAD_STATUS = &#039;STARTED&#039;   
10:19:38  15                     AND RLS.SNAPSHOT_DT = BW.SNAPSHOT_DT
10:19:38  16                     AND BW.RPTG_WINDOW_TYPE = &#039;D&#039;    
10:19:38  17                     AND BW.OBJECT_NM = &#039;R_AGGREGATE_CLAIM_SEED&#039;    
10:19:38  18                     AND PI.SRCE_EFF_START_TMSP BETWEEN BW.BEGIN_TMSP AND BW.END_TMSP
10:19:38  19                     and rownum = 1
10:19:38  20                    ) AS SNAPSHOT_DT
10:19:38  21             FROM RRS_PSTG.P_PCD_AGGREGATECLAIM PI
10:19:38  22             WHERE PI.BATCH_ID IN 
10:19:38  23                   (SELECT src_batch_id
10:19:38  24                    FROM batch_processing_queue
10:19:38  25                    WHERE dm_batch_id = batch_id_pkg.get_current_batch_id(&#039;PCD&#039;,&#039;ATM&#039;)
10:19:38  26                   )
10:19:38  27             and rownum &gt;= 1
10:19:38  28            ) A
10:19:38  29            GROUP BY A.AGGREGATECLAIMUID, A.SNAPSHOT_DT
10:19:38  30       )
10:19:38  31  /

Table created.

Elapsed: 00:14:21.17
10:34:00 SQL&gt; 

PLAN_TABLE_OUTPUT
-------------------------------------------------------------------------------------------------------------------
Plan hash value: 2256974412

------------------------------------------------------------------------------------------------------------------
&#124; Id  &#124; Operation                  &#124; Name                        &#124; Rows  &#124; Bytes &#124;TempSpc&#124; Cost (%CPU)&#124; Time     &#124;
------------------------------------------------------------------------------------------------------------------
&#124;   0 &#124; CREATE TABLE STATEMENT     &#124;                             &#124;  1576K&#124;    36M&#124;       &#124; 15014   (1)&#124; 00:03:01 &#124;
&#124;   1 &#124;  LOAD AS SELECT            &#124; KEVTEMP5                    &#124;       &#124;       &#124;       &#124;            &#124;          &#124;
&#124;   2 &#124;   HASH GROUP BY            &#124;                             &#124;  1576K&#124;    36M&#124;    54M&#124; 13995   (1)&#124; 00:02:48 &#124;
&#124;*  3 &#124;    COUNT STOPKEY           &#124;                             &#124;       &#124;       &#124;       &#124;            &#124;          &#124;
&#124;   4 &#124;     NESTED LOOPS           &#124;                             &#124;     2 &#124;   130 &#124;       &#124;     3   (0)&#124; 00:00:01 &#124;
&#124;*  5 &#124;      INDEX RANGE SCAN      &#124; KEVI1                       &#124;    13 &#124;   624 &#124;       &#124;     3   (0)&#124; 00:00:01 &#124;
&#124;*  6 &#124;      INDEX UNIQUE SCAN     &#124; IUK2_RRS_LOAD_STATUS        &#124;     1 &#124;    17 &#124;       &#124;     0   (0)&#124; 00:00:01 &#124;
&#124;   7 &#124;    VIEW                    &#124;                             &#124;  1581K&#124;    36M&#124;       &#124;  2887   (1)&#124; 00:00:35 &#124;
&#124;   8 &#124;     COUNT                  &#124;                             &#124;       &#124;       &#124;       &#124;            &#124;          &#124;
&#124;*  9 &#124;      FILTER                &#124;                             &#124;       &#124;       &#124;       &#124;            &#124;          &#124;
&#124;* 10 &#124;       HASH JOIN RIGHT SEMI &#124;                             &#124;  1581K&#124;    39M&#124;       &#124;  1791   (2)&#124; 00:00:22 &#124;
&#124;* 11 &#124;        INDEX RANGE SCAN    &#124; IAK1_BATCH_PROCESSING_QUEUE &#124;   205 &#124;  1640 &#124;       &#124;     2   (0)&#124; 00:00:01 &#124;
&#124;  12 &#124;        INDEX FAST FULL SCAN&#124; JGACI1_AGGREGATECLAIM       &#124;  1581K&#124;    27M&#124;       &#124;  1780   (1)&#124; 00:00:22 &#124;
------------------------------------------------------------------------------------------------------------------

Query Block Name / Object Alias (identified by operation id):
-------------------------------------------------------------

   1 - SEL$F5BB74E1
   3 - SEL$4
   5 - SEL$4        / BW@SEL$4
   6 - SEL$4        / RLS@SEL$4
   7 - SEL$26A4F268 / A@SEL$2
   8 - SEL$26A4F268
  11 - SEL$26A4F268 / BATCH_PROCESSING_QUEUE@SEL$5
  12 - SEL$26A4F268 / PI@SEL$3

Outline Data
-------------

  /*+
      BEGIN_OUTLINE_DATA
      USE_NL(@&quot;SEL$4&quot; &quot;RLS&quot;@&quot;SEL$4&quot;)
      LEADING(@&quot;SEL$4&quot; &quot;BW&quot;@&quot;SEL$4&quot; &quot;RLS&quot;@&quot;SEL$4&quot;)
      INDEX(@&quot;SEL$4&quot; &quot;RLS&quot;@&quot;SEL$4&quot; (&quot;RRS_LOAD_STATUS&quot;.&quot;SNAPSHOT_DT&quot; &quot;RRS_LOAD_STATUS&quot;.&quot;ASTG_LOAD_STATUS&quot;))
      INDEX(@&quot;SEL$4&quot; &quot;BW&quot;@&quot;SEL$4&quot; (&quot;RRS_ETL_BATCH_WINDOW&quot;.&quot;RPTG_WINDOW_TYPE&quot; &quot;RRS_ETL_BATCH_WINDOW&quot;.&quot;OBJECT_NM&quot;
              &quot;RRS_ETL_BATCH_WINDOW&quot;.&quot;BEGIN_TMSP&quot; &quot;RRS_ETL_BATCH_WINDOW&quot;.&quot;END_TMSP&quot;
              &quot;RRS_ETL_BATCH_WINDOW&quot;.&quot;SNAPSHOT_DT&quot;))
      SWAP_JOIN_INPUTS(@&quot;SEL$26A4F268&quot; &quot;BATCH_PROCESSING_QUEUE&quot;@&quot;SEL$5&quot;)
      USE_HASH(@&quot;SEL$26A4F268&quot; &quot;BATCH_PROCESSING_QUEUE&quot;@&quot;SEL$5&quot;)
      LEADING(@&quot;SEL$26A4F268&quot; &quot;PI&quot;@&quot;SEL$3&quot; &quot;BATCH_PROCESSING_QUEUE&quot;@&quot;SEL$5&quot;)
      INDEX(@&quot;SEL$26A4F268&quot; &quot;BATCH_PROCESSING_QUEUE&quot;@&quot;SEL$5&quot; (&quot;BATCH_PROCESSING_QUEUE&quot;.&quot;DM_BATCH_ID&quot;
              &quot;BATCH_PROCESSING_QUEUE&quot;.&quot;SRC_BATCH_ID&quot;))
      INDEX_FFS(@&quot;SEL$26A4F268&quot; &quot;PI&quot;@&quot;SEL$3&quot; (&quot;P_PCD_AGGREGATECLAIM&quot;.&quot;BATCH_ID&quot;
              &quot;P_PCD_AGGREGATECLAIM&quot;.&quot;AGGREGATECLAIMUID&quot; &quot;P_PCD_AGGREGATECLAIM&quot;.&quot;SRCE_EFF_START_TMSP&quot;))
      USE_HASH_AGGREGATION(@&quot;SEL$F5BB74E1&quot;)
      NO_ACCESS(@&quot;SEL$F5BB74E1&quot; &quot;A&quot;@&quot;SEL$2&quot;)
      OUTLINE(@&quot;SEL$2&quot;)
      OUTLINE(@&quot;SEL$1&quot;)
      OUTLINE(@&quot;SEL$5&quot;)
      OUTLINE(@&quot;SEL$3&quot;)
      MERGE(@&quot;SEL$2&quot;)
      OUTLINE_LEAF(@&quot;SEL$F5BB74E1&quot;)
      UNNEST(@&quot;SEL$5&quot;)
      OUTLINE_LEAF(@&quot;SEL$26A4F268&quot;)
      OUTLINE_LEAF(@&quot;SEL$4&quot;)
      ALL_ROWS
      DB_VERSION(&#039;11.2.0.2&#039;)
      OPTIMIZER_FEATURES_ENABLE(&#039;11.2.0.2&#039;)
      IGNORE_OPTIM_EMBEDDED_HINTS
      END_OUTLINE_DATA
  */

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - filter(ROWNUM=1)
   5 - access(&quot;BW&quot;.&quot;RPTG_WINDOW_TYPE&quot;=&#039;D&#039; AND &quot;BW&quot;.&quot;OBJECT_NM&quot;=&#039;R_AGGREGATE_CLAIM_SEED&#039; AND
              &quot;BW&quot;.&quot;END_TMSP&quot;&gt;=:B1 AND &quot;BW&quot;.&quot;BEGIN_TMSP&quot;=:B1)
   6 - access(&quot;RLS&quot;.&quot;SNAPSHOT_DT&quot;=&quot;BW&quot;.&quot;SNAPSHOT_DT&quot; AND &quot;RLS&quot;.&quot;ASTG_LOAD_STATUS&quot;=&#039;STARTED&#039;)
   9 - filter(ROWNUM&gt;=1)
  10 - access(&quot;PI&quot;.&quot;BATCH_ID&quot;=&quot;SRC_BATCH_ID&quot;)
  11 - access(&quot;DM_BATCH_ID&quot;=&quot;BATCH_ID_PKG&quot;.&quot;GET_CURRENT_BATCH_ID&quot;(&#039;PCD&#039;,&#039;ATM&#039;))

Column Projection Information (identified by operation id):
-----------------------------------------------------------

   1 - SYSDEF[4], SYSDEF[32720], SYSDEF[1], SYSDEF[96], SYSDEF[32720]
   2 - (#keys=2) &quot;A&quot;.&quot;AGGREGATECLAIMUID&quot;[NUMBER,22], &quot;A&quot;.&quot;SNAPSHOT_DT&quot;[DATE,7],
       MAX(&quot;A&quot;.&quot;SRCE_EFF_START_TMSP&quot;)[7]
   3 - &quot;BW&quot;.ROWID[ROWID,10], &quot;BW&quot;.&quot;OBJECT_NM&quot;[VARCHAR2,30], &quot;BW&quot;.&quot;SNAPSHOT_DT&quot;[DATE,7],
       &quot;BW&quot;.&quot;BEGIN_TMSP&quot;[DATE,7], &quot;BW&quot;.&quot;END_TMSP&quot;[DATE,7], &quot;BW&quot;.&quot;RPTG_WINDOW_TYPE&quot;[VARCHAR2,2],
       &quot;RLS&quot;.ROWID[ROWID,10], &quot;RLS&quot;.&quot;SNAPSHOT_DT&quot;[DATE,7], &quot;RLS&quot;.&quot;ASTG_LOAD_STATUS&quot;[VARCHAR2,15], ROWNUM[4]
   4 - (#keys=0) &quot;BW&quot;.ROWID[ROWID,10], &quot;BW&quot;.&quot;OBJECT_NM&quot;[VARCHAR2,30], &quot;BW&quot;.&quot;SNAPSHOT_DT&quot;[DATE,7],
       &quot;BW&quot;.&quot;BEGIN_TMSP&quot;[DATE,7], &quot;BW&quot;.&quot;END_TMSP&quot;[DATE,7], &quot;BW&quot;.&quot;RPTG_WINDOW_TYPE&quot;[VARCHAR2,2],
       &quot;RLS&quot;.ROWID[ROWID,10], &quot;RLS&quot;.&quot;SNAPSHOT_DT&quot;[DATE,7], &quot;RLS&quot;.&quot;ASTG_LOAD_STATUS&quot;[VARCHAR2,15]
   5 - &quot;BW&quot;.ROWID[ROWID,10], &quot;BW&quot;.&quot;OBJECT_NM&quot;[VARCHAR2,30], &quot;BW&quot;.&quot;SNAPSHOT_DT&quot;[DATE,7],
       &quot;BW&quot;.&quot;BEGIN_TMSP&quot;[DATE,7], &quot;BW&quot;.&quot;END_TMSP&quot;[DATE,7], &quot;BW&quot;.&quot;RPTG_WINDOW_TYPE&quot;[VARCHAR2,2]
   6 - &quot;RLS&quot;.ROWID[ROWID,10], &quot;RLS&quot;.&quot;SNAPSHOT_DT&quot;[DATE,7], &quot;RLS&quot;.&quot;ASTG_LOAD_STATUS&quot;[VARCHAR2,15]
   7 - &quot;A&quot;.&quot;AGGREGATECLAIMUID&quot;[NUMBER,22], &quot;A&quot;.&quot;SRCE_EFF_START_TMSP&quot;[DATE,7], &quot;A&quot;.&quot;SNAPSHOT_DT&quot;[DATE,7]
   8 - &quot;SRC_BATCH_ID&quot;[NUMBER,22], &quot;PI&quot;.&quot;BATCH_ID&quot;[NUMBER,22], &quot;SYS_ALIAS_1&quot;.ROWID[ROWID,10],
       &quot;PI&quot;.&quot;AGGREGATECLAIMUID&quot;[NUMBER,22], &quot;PI&quot;.&quot;SRCE_EFF_START_TMSP&quot;[DATE,7], ROWNUM[4]
   9 - &quot;SRC_BATCH_ID&quot;[NUMBER,22], &quot;PI&quot;.&quot;BATCH_ID&quot;[NUMBER,22], &quot;SYS_ALIAS_1&quot;.ROWID[ROWID,10],
       &quot;PI&quot;.&quot;AGGREGATECLAIMUID&quot;[NUMBER,22], &quot;PI&quot;.&quot;SRCE_EFF_START_TMSP&quot;[DATE,7]
  10 - (#keys=1) &quot;SRC_BATCH_ID&quot;[NUMBER,22], &quot;PI&quot;.&quot;BATCH_ID&quot;[NUMBER,22], &quot;SYS_ALIAS_1&quot;.ROWID[ROWID,10],
       &quot;PI&quot;.&quot;AGGREGATECLAIMUID&quot;[NUMBER,22], &quot;PI&quot;.&quot;SRCE_EFF_START_TMSP&quot;[DATE,7]
  11 - &quot;BATCH_PROCESSING_QUEUE&quot;.ROWID[ROWID,10], &quot;DM_BATCH_ID&quot;[NUMBER,22], &quot;SRC_BATCH_ID&quot;[NUMBER,22]
  12 - &quot;SYS_ALIAS_1&quot;.ROWID[ROWID,10], &quot;PI&quot;.&quot;BATCH_ID&quot;[NUMBER,22], &quot;PI&quot;.&quot;SRCE_EFF_START_TMSP&quot;[DATE,7],
       &quot;PI&quot;.&quot;AGGREGATECLAIMUID&quot;[NUMBER,22]

105 rows selected.

Elapsed: 00:00:01.00
[/sourcecode]
]]></description>
		<content:encoded><![CDATA[<p>Sure, In the end we found one possible solution.  This particular query was the perverbial (it ran in a few minutes on TEST, but never finishes in PROD) query.  As I write this, there is someone trying to finish a run of this query in PROD and it has been going for 12 hours.  In any event, there are two things:</p>
<p>I offered up this index and this query rewrite which gives this plan.  My testing during the day saw this complete in 15 minutes.  These guys ran it @8pm last night and it finished for them in 32 seconds.  I can&#8217;t for the life of me figure out how they got 32 seconds when the best I could do was 15 minutes so I asked for some clarification on how they determined their answer set was correct and if they did anything else.  For now though:</p>
<p>I believe the solution comes from the scalar subquery initially being woofully inefficient since Oracle does not have the metadata to know that this subquery will always return one and only one row.  I confirmed this with the app team and data analysts since there are (shame) not constraints on these tables.  After using the ROWNUM tricks, Oracle stops looking down the index once he finds the hit he wants because by the nature of the data their will always be one row and only one row that batches the date bracketing, for each key.  I always supected the scalar was the issues because removing it from the query yielded a 2 second query every time.  So doing something to &#8220;FIX&#8221; how the scalar subquery was being processed seemed like the right approach.</p>
<p>BY THE WAY, anyone know how to format in this forum.  I like this place and figure on contributing but I feel bad about posted hard to read stuff.</p>
<p>Notice the use of ROWNUM in two places.  Yes a hack but it gives me what I want without (given the nature of the data) changing the semantics of the query.</p>
<pre class="brush: plain; title: ; notranslate">
09:46:27 SQL&amp;gt; create index kevi1 on RRS_SHR.RRS_ETL_BATCH_WINDOW (RPTG_WINDOW_TYPE,OBJECT_NM,BEGIN_TMSP,END_TMSP,SNAPSHOT_DT)
10:18:32   2  nologging
10:18:32   3  /

Index created.

Elapsed: 00:00:03.50

10:18:36 SQL&amp;gt; create table kevtemp5
10:19:38   2  nologging
10:19:38   3  as
10:19:38   4  SELECT SRCE_EFF_START_TMSP, 
10:19:38   5         AGGREGATECLAIMUID 
10:19:38   6  FROM (
10:19:38   7       SELECT  A.AGGREGATECLAIMUID, 
10:19:38   8               A.SNAPSHOT_DT, 
10:19:38   9               MAX(A.SRCE_EFF_START_TMSP) SRCE_EFF_START_TMSP
10:19:38  10       FROM (SELECT PI.AGGREGATECLAIMUID, 
10:19:38  11                    PI.SRCE_EFF_START_TMSP, 
10:19:38  12                    (SELECT BW.SNAPSHOT_DT
10:19:38  13                     FROM RRS_SHR.RRS_ETL_BATCH_WINDOW BW, RRS_SHR.RRS_LOAD_STATUS RLS
10:19:38  14                     WHERE RLS.ASTG_LOAD_STATUS = 'STARTED'   
10:19:38  15                     AND RLS.SNAPSHOT_DT = BW.SNAPSHOT_DT
10:19:38  16                     AND BW.RPTG_WINDOW_TYPE = 'D'    
10:19:38  17                     AND BW.OBJECT_NM = 'R_AGGREGATE_CLAIM_SEED'    
10:19:38  18                     AND PI.SRCE_EFF_START_TMSP BETWEEN BW.BEGIN_TMSP AND BW.END_TMSP
10:19:38  19                     and rownum = 1
10:19:38  20                    ) AS SNAPSHOT_DT
10:19:38  21             FROM RRS_PSTG.P_PCD_AGGREGATECLAIM PI
10:19:38  22             WHERE PI.BATCH_ID IN 
10:19:38  23                   (SELECT src_batch_id
10:19:38  24                    FROM batch_processing_queue
10:19:38  25                    WHERE dm_batch_id = batch_id_pkg.get_current_batch_id('PCD','ATM')
10:19:38  26                   )
10:19:38  27             and rownum &amp;gt;= 1
10:19:38  28            ) A
10:19:38  29            GROUP BY A.AGGREGATECLAIMUID, A.SNAPSHOT_DT
10:19:38  30       )
10:19:38  31  /

Table created.

Elapsed: 00:14:21.17
10:34:00 SQL&amp;gt; 

PLAN_TABLE_OUTPUT
-------------------------------------------------------------------------------------------------------------------
Plan hash value: 2256974412

------------------------------------------------------------------------------------------------------------------
| Id  | Operation                  | Name                        | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
------------------------------------------------------------------------------------------------------------------
|   0 | CREATE TABLE STATEMENT     |                             |  1576K|    36M|       | 15014   (1)| 00:03:01 |
|   1 |  LOAD AS SELECT            | KEVTEMP5                    |       |       |       |            |          |
|   2 |   HASH GROUP BY            |                             |  1576K|    36M|    54M| 13995   (1)| 00:02:48 |
|*  3 |    COUNT STOPKEY           |                             |       |       |       |            |          |
|   4 |     NESTED LOOPS           |                             |     2 |   130 |       |     3   (0)| 00:00:01 |
|*  5 |      INDEX RANGE SCAN      | KEVI1                       |    13 |   624 |       |     3   (0)| 00:00:01 |
|*  6 |      INDEX UNIQUE SCAN     | IUK2_RRS_LOAD_STATUS        |     1 |    17 |       |     0   (0)| 00:00:01 |
|   7 |    VIEW                    |                             |  1581K|    36M|       |  2887   (1)| 00:00:35 |
|   8 |     COUNT                  |                             |       |       |       |            |          |
|*  9 |      FILTER                |                             |       |       |       |            |          |
|* 10 |       HASH JOIN RIGHT SEMI |                             |  1581K|    39M|       |  1791   (2)| 00:00:22 |
|* 11 |        INDEX RANGE SCAN    | IAK1_BATCH_PROCESSING_QUEUE |   205 |  1640 |       |     2   (0)| 00:00:01 |
|  12 |        INDEX FAST FULL SCAN| JGACI1_AGGREGATECLAIM       |  1581K|    27M|       |  1780   (1)| 00:00:22 |
------------------------------------------------------------------------------------------------------------------

Query Block Name / Object Alias (identified by operation id):
-------------------------------------------------------------

   1 - SEL$F5BB74E1
   3 - SEL$4
   5 - SEL$4        / BW@SEL$4
   6 - SEL$4        / RLS@SEL$4
   7 - SEL$26A4F268 / A@SEL$2
   8 - SEL$26A4F268
  11 - SEL$26A4F268 / BATCH_PROCESSING_QUEUE@SEL$5
  12 - SEL$26A4F268 / PI@SEL$3

Outline Data
-------------

  /*+
      BEGIN_OUTLINE_DATA
      USE_NL(@&quot;SEL$4&quot; &quot;RLS&quot;@&quot;SEL$4&quot;)
      LEADING(@&quot;SEL$4&quot; &quot;BW&quot;@&quot;SEL$4&quot; &quot;RLS&quot;@&quot;SEL$4&quot;)
      INDEX(@&quot;SEL$4&quot; &quot;RLS&quot;@&quot;SEL$4&quot; (&quot;RRS_LOAD_STATUS&quot;.&quot;SNAPSHOT_DT&quot; &quot;RRS_LOAD_STATUS&quot;.&quot;ASTG_LOAD_STATUS&quot;))
      INDEX(@&quot;SEL$4&quot; &quot;BW&quot;@&quot;SEL$4&quot; (&quot;RRS_ETL_BATCH_WINDOW&quot;.&quot;RPTG_WINDOW_TYPE&quot; &quot;RRS_ETL_BATCH_WINDOW&quot;.&quot;OBJECT_NM&quot;
              &quot;RRS_ETL_BATCH_WINDOW&quot;.&quot;BEGIN_TMSP&quot; &quot;RRS_ETL_BATCH_WINDOW&quot;.&quot;END_TMSP&quot;
              &quot;RRS_ETL_BATCH_WINDOW&quot;.&quot;SNAPSHOT_DT&quot;))
      SWAP_JOIN_INPUTS(@&quot;SEL$26A4F268&quot; &quot;BATCH_PROCESSING_QUEUE&quot;@&quot;SEL$5&quot;)
      USE_HASH(@&quot;SEL$26A4F268&quot; &quot;BATCH_PROCESSING_QUEUE&quot;@&quot;SEL$5&quot;)
      LEADING(@&quot;SEL$26A4F268&quot; &quot;PI&quot;@&quot;SEL$3&quot; &quot;BATCH_PROCESSING_QUEUE&quot;@&quot;SEL$5&quot;)
      INDEX(@&quot;SEL$26A4F268&quot; &quot;BATCH_PROCESSING_QUEUE&quot;@&quot;SEL$5&quot; (&quot;BATCH_PROCESSING_QUEUE&quot;.&quot;DM_BATCH_ID&quot;
              &quot;BATCH_PROCESSING_QUEUE&quot;.&quot;SRC_BATCH_ID&quot;))
      INDEX_FFS(@&quot;SEL$26A4F268&quot; &quot;PI&quot;@&quot;SEL$3&quot; (&quot;P_PCD_AGGREGATECLAIM&quot;.&quot;BATCH_ID&quot;
              &quot;P_PCD_AGGREGATECLAIM&quot;.&quot;AGGREGATECLAIMUID&quot; &quot;P_PCD_AGGREGATECLAIM&quot;.&quot;SRCE_EFF_START_TMSP&quot;))
      USE_HASH_AGGREGATION(@&quot;SEL$F5BB74E1&quot;)
      NO_ACCESS(@&quot;SEL$F5BB74E1&quot; &quot;A&quot;@&quot;SEL$2&quot;)
      OUTLINE(@&quot;SEL$2&quot;)
      OUTLINE(@&quot;SEL$1&quot;)
      OUTLINE(@&quot;SEL$5&quot;)
      OUTLINE(@&quot;SEL$3&quot;)
      MERGE(@&quot;SEL$2&quot;)
      OUTLINE_LEAF(@&quot;SEL$F5BB74E1&quot;)
      UNNEST(@&quot;SEL$5&quot;)
      OUTLINE_LEAF(@&quot;SEL$26A4F268&quot;)
      OUTLINE_LEAF(@&quot;SEL$4&quot;)
      ALL_ROWS
      DB_VERSION('11.2.0.2')
      OPTIMIZER_FEATURES_ENABLE('11.2.0.2')
      IGNORE_OPTIM_EMBEDDED_HINTS
      END_OUTLINE_DATA
  */

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - filter(ROWNUM=1)
   5 - access(&quot;BW&quot;.&quot;RPTG_WINDOW_TYPE&quot;='D' AND &quot;BW&quot;.&quot;OBJECT_NM&quot;='R_AGGREGATE_CLAIM_SEED' AND
              &quot;BW&quot;.&quot;END_TMSP&quot;&amp;gt;=:B1 AND &quot;BW&quot;.&quot;BEGIN_TMSP&quot;=:B1)
   6 - access(&quot;RLS&quot;.&quot;SNAPSHOT_DT&quot;=&quot;BW&quot;.&quot;SNAPSHOT_DT&quot; AND &quot;RLS&quot;.&quot;ASTG_LOAD_STATUS&quot;='STARTED')
   9 - filter(ROWNUM&amp;gt;=1)
  10 - access(&quot;PI&quot;.&quot;BATCH_ID&quot;=&quot;SRC_BATCH_ID&quot;)
  11 - access(&quot;DM_BATCH_ID&quot;=&quot;BATCH_ID_PKG&quot;.&quot;GET_CURRENT_BATCH_ID&quot;('PCD','ATM'))

Column Projection Information (identified by operation id):
-----------------------------------------------------------

   1 - SYSDEF[4], SYSDEF[32720], SYSDEF[1], SYSDEF[96], SYSDEF[32720]
   2 - (#keys=2) &quot;A&quot;.&quot;AGGREGATECLAIMUID&quot;[NUMBER,22], &quot;A&quot;.&quot;SNAPSHOT_DT&quot;[DATE,7],
       MAX(&quot;A&quot;.&quot;SRCE_EFF_START_TMSP&quot;)[7]
   3 - &quot;BW&quot;.ROWID[ROWID,10], &quot;BW&quot;.&quot;OBJECT_NM&quot;[VARCHAR2,30], &quot;BW&quot;.&quot;SNAPSHOT_DT&quot;[DATE,7],
       &quot;BW&quot;.&quot;BEGIN_TMSP&quot;[DATE,7], &quot;BW&quot;.&quot;END_TMSP&quot;[DATE,7], &quot;BW&quot;.&quot;RPTG_WINDOW_TYPE&quot;[VARCHAR2,2],
       &quot;RLS&quot;.ROWID[ROWID,10], &quot;RLS&quot;.&quot;SNAPSHOT_DT&quot;[DATE,7], &quot;RLS&quot;.&quot;ASTG_LOAD_STATUS&quot;[VARCHAR2,15], ROWNUM[4]
   4 - (#keys=0) &quot;BW&quot;.ROWID[ROWID,10], &quot;BW&quot;.&quot;OBJECT_NM&quot;[VARCHAR2,30], &quot;BW&quot;.&quot;SNAPSHOT_DT&quot;[DATE,7],
       &quot;BW&quot;.&quot;BEGIN_TMSP&quot;[DATE,7], &quot;BW&quot;.&quot;END_TMSP&quot;[DATE,7], &quot;BW&quot;.&quot;RPTG_WINDOW_TYPE&quot;[VARCHAR2,2],
       &quot;RLS&quot;.ROWID[ROWID,10], &quot;RLS&quot;.&quot;SNAPSHOT_DT&quot;[DATE,7], &quot;RLS&quot;.&quot;ASTG_LOAD_STATUS&quot;[VARCHAR2,15]
   5 - &quot;BW&quot;.ROWID[ROWID,10], &quot;BW&quot;.&quot;OBJECT_NM&quot;[VARCHAR2,30], &quot;BW&quot;.&quot;SNAPSHOT_DT&quot;[DATE,7],
       &quot;BW&quot;.&quot;BEGIN_TMSP&quot;[DATE,7], &quot;BW&quot;.&quot;END_TMSP&quot;[DATE,7], &quot;BW&quot;.&quot;RPTG_WINDOW_TYPE&quot;[VARCHAR2,2]
   6 - &quot;RLS&quot;.ROWID[ROWID,10], &quot;RLS&quot;.&quot;SNAPSHOT_DT&quot;[DATE,7], &quot;RLS&quot;.&quot;ASTG_LOAD_STATUS&quot;[VARCHAR2,15]
   7 - &quot;A&quot;.&quot;AGGREGATECLAIMUID&quot;[NUMBER,22], &quot;A&quot;.&quot;SRCE_EFF_START_TMSP&quot;[DATE,7], &quot;A&quot;.&quot;SNAPSHOT_DT&quot;[DATE,7]
   8 - &quot;SRC_BATCH_ID&quot;[NUMBER,22], &quot;PI&quot;.&quot;BATCH_ID&quot;[NUMBER,22], &quot;SYS_ALIAS_1&quot;.ROWID[ROWID,10],
       &quot;PI&quot;.&quot;AGGREGATECLAIMUID&quot;[NUMBER,22], &quot;PI&quot;.&quot;SRCE_EFF_START_TMSP&quot;[DATE,7], ROWNUM[4]
   9 - &quot;SRC_BATCH_ID&quot;[NUMBER,22], &quot;PI&quot;.&quot;BATCH_ID&quot;[NUMBER,22], &quot;SYS_ALIAS_1&quot;.ROWID[ROWID,10],
       &quot;PI&quot;.&quot;AGGREGATECLAIMUID&quot;[NUMBER,22], &quot;PI&quot;.&quot;SRCE_EFF_START_TMSP&quot;[DATE,7]
  10 - (#keys=1) &quot;SRC_BATCH_ID&quot;[NUMBER,22], &quot;PI&quot;.&quot;BATCH_ID&quot;[NUMBER,22], &quot;SYS_ALIAS_1&quot;.ROWID[ROWID,10],
       &quot;PI&quot;.&quot;AGGREGATECLAIMUID&quot;[NUMBER,22], &quot;PI&quot;.&quot;SRCE_EFF_START_TMSP&quot;[DATE,7]
  11 - &quot;BATCH_PROCESSING_QUEUE&quot;.ROWID[ROWID,10], &quot;DM_BATCH_ID&quot;[NUMBER,22], &quot;SRC_BATCH_ID&quot;[NUMBER,22]
  12 - &quot;SYS_ALIAS_1&quot;.ROWID[ROWID,10], &quot;PI&quot;.&quot;BATCH_ID&quot;[NUMBER,22], &quot;PI&quot;.&quot;SRCE_EFF_START_TMSP&quot;[DATE,7],
       &quot;PI&quot;.&quot;AGGREGATECLAIMUID&quot;[NUMBER,22]

105 rows selected.

Elapsed: 00:00:01.00
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: srivenu kadiyala</title>
		<link>http://jonathanlewis.wordpress.com/2012/11/19/plan-timing/#comment-51572</link>
		<dc:creator><![CDATA[srivenu kadiyala]]></dc:creator>
		<pubDate>Wed, 21 Nov 2012 06:25:06 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=9924#comment-51572</guid>
		<description><![CDATA[Kevin,
can you give the details of the index IDX1_RRS_ETL_BATCH_WINDOW

Just wondering about the filter predicate on line 5
5 - filter((&quot;BW&quot;.&quot;BEGIN_TMSP&quot;=:B1)

regards
srivenu]]></description>
		<content:encoded><![CDATA[<p>Kevin,<br />
can you give the details of the index IDX1_RRS_ETL_BATCH_WINDOW</p>
<p>Just wondering about the filter predicate on line 5<br />
5 &#8211; filter((&#8220;BW&#8221;.&#8221;BEGIN_TMSP&#8221;=:B1)</p>
<p>regards<br />
srivenu</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin Meade</title>
		<link>http://jonathanlewis.wordpress.com/2012/11/19/plan-timing/#comment-51553</link>
		<dc:creator><![CDATA[Kevin Meade]]></dc:creator>
		<pubDate>Tue, 20 Nov 2012 02:32:25 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=9924#comment-51553</guid>
		<description><![CDATA[Thank you Sir.  I guess I was being lazy.  I should have seen exactly what you have described.  Once I remove the scalar subquery (replace with w/sysdate for example), the query takes about 1 second instead of 4 minutes.  It is obvious where the time is going.

Thank you also for clarifying the deficiency in the query plan.  I surmized there was something it was not showing me, but I was resisting the idea that the sequence of events was in a cart before the horse order.  Getting your description of this gives me the material I need to move forward and to help others around me who need to know.  I thank you for that.  If I get a moment, I will update with success notes once I achieve success in getting the timings I want.  I think this query should run in about 4 seconds or less based on what I know of the rowcounts involved.  I just have to get the right query structure and plan for it etc.

Kevin]]></description>
		<content:encoded><![CDATA[<p>Thank you Sir.  I guess I was being lazy.  I should have seen exactly what you have described.  Once I remove the scalar subquery (replace with w/sysdate for example), the query takes about 1 second instead of 4 minutes.  It is obvious where the time is going.</p>
<p>Thank you also for clarifying the deficiency in the query plan.  I surmized there was something it was not showing me, but I was resisting the idea that the sequence of events was in a cart before the horse order.  Getting your description of this gives me the material I need to move forward and to help others around me who need to know.  I thank you for that.  If I get a moment, I will update with success notes once I achieve success in getting the timings I want.  I think this query should run in about 4 seconds or less based on what I know of the rowcounts involved.  I just have to get the right query structure and plan for it etc.</p>
<p>Kevin</p>
]]></content:encoded>
	</item>
</channel>
</rss>
