<?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: Parallel Execution</title>
	<atom:link href="http://jonathanlewis.wordpress.com/2006/12/28/parallel-execution/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com/2006/12/28/parallel-execution/</link>
	<description>Just another Oracle weblog</description>
	<lastBuildDate>Tue, 18 Jun 2013 04:32:58 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2006/12/28/parallel-execution/#comment-42354</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Sun, 13 Nov 2011 15:17:51 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/12/28/parallel-execution/#comment-42354</guid>
		<description><![CDATA[Ganesh,

There is no single answer to your question about plans switching between hash joins and nested loop joins.

The only parallel paths (as drivers) are the tablescan and the index fast full scan - and you will often find that when scans can run in parallel Oracle will switch from an index-based nested loop join to a hash join because the cost of the necessary tablescans or index fast full scans has dropped.

HOWEVER - it is possible for an execution path to start with a parallel tablescan and then - for each row of the scan - do an indexed access into the second table, so parallel doesn&#039;t preclude nested loops; in fact, it is &lt;b&gt;possible&lt;/b&gt; (particularly with locally partitioned indexes in place) that for a serial hash join to turn into a parallel nested loop because each slave &quot;assumes&quot; it will be accessing one partition through the local index partition.]]></description>
		<content:encoded><![CDATA[<p>Ganesh,</p>
<p>There is no single answer to your question about plans switching between hash joins and nested loop joins.</p>
<p>The only parallel paths (as drivers) are the tablescan and the index fast full scan &#8211; and you will often find that when scans can run in parallel Oracle will switch from an index-based nested loop join to a hash join because the cost of the necessary tablescans or index fast full scans has dropped.</p>
<p>HOWEVER &#8211; it is possible for an execution path to start with a parallel tablescan and then &#8211; for each row of the scan &#8211; do an indexed access into the second table, so parallel doesn&#8217;t preclude nested loops; in fact, it is <b>possible</b> (particularly with locally partitioned indexes in place) that for a serial hash join to turn into a parallel nested loop because each slave &#8220;assumes&#8221; it will be accessing one partition through the local index partition.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ganesh</title>
		<link>http://jonathanlewis.wordpress.com/2006/12/28/parallel-execution/#comment-42188</link>
		<dc:creator><![CDATA[ganesh]]></dc:creator>
		<pubDate>Tue, 25 Oct 2011 00:59:10 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/12/28/parallel-execution/#comment-42188</guid>
		<description><![CDATA[Hi Jonathan,

Allocating parallelism for the select query will the Optimizer change explain/execution plan from hash join to nested loop or vice versa.... If so, would you please explain why?

I understand the cost will come down because of the (parallel slave) multiple processes to go after the necessary data instead of just one process.]]></description>
		<content:encoded><![CDATA[<p>Hi Jonathan,</p>
<p>Allocating parallelism for the select query will the Optimizer change explain/execution plan from hash join to nested loop or vice versa&#8230;. If so, would you please explain why?</p>
<p>I understand the cost will come down because of the (parallel slave) multiple processes to go after the necessary data instead of just one process.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2006/12/28/parallel-execution/#comment-36620</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Wed, 30 Jun 2010 08:40:18 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/12/28/parallel-execution/#comment-36620</guid>
		<description><![CDATA[Kumar,

Oracle has various pieces of code that try to restrain parallel execution count, it&#039;s probably still a good idea for 10g to work on the basis of setting the degree/instances value for every table and index to 1 and then using parallle() and parallel_index() hints to set the degree of parallelism you want.  

It&#039;s also sensible to limit the number of concurrent queries that are allowed to run in parallel - and that&#039;s harder to control, of course, unless you are already using some type of scheduler program to run the big queries.]]></description>
		<content:encoded><![CDATA[<p>Kumar,</p>
<p>Oracle has various pieces of code that try to restrain parallel execution count, it&#8217;s probably still a good idea for 10g to work on the basis of setting the degree/instances value for every table and index to 1 and then using parallle() and parallel_index() hints to set the degree of parallelism you want.  </p>
<p>It&#8217;s also sensible to limit the number of concurrent queries that are allowed to run in parallel &#8211; and that&#8217;s harder to control, of course, unless you are already using some type of scheduler program to run the big queries.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kumar</title>
		<link>http://jonathanlewis.wordpress.com/2006/12/28/parallel-execution/#comment-36565</link>
		<dc:creator><![CDATA[kumar]]></dc:creator>
		<pubDate>Fri, 25 Jun 2010 07:14:13 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/12/28/parallel-execution/#comment-36565</guid>
		<description><![CDATA[Jonathan,

I have silly question. 
        1. How do i find the parent process for a parallel slave?
        2. My partition table have 3800 partitions. How can I restrict parallel for a single query 
           like at max 10 slaves for a query. I am using oracle 10204.

Thanks]]></description>
		<content:encoded><![CDATA[<p>Jonathan,</p>
<p>I have silly question.<br />
        1. How do i find the parent process for a parallel slave?<br />
        2. My partition table have 3800 partitions. How can I restrict parallel for a single query<br />
           like at max 10 slaves for a query. I am using oracle 10204.</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2006/12/28/parallel-execution/#comment-35354</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Fri, 29 Jan 2010 18:28:00 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/12/28/parallel-execution/#comment-35354</guid>
		<description><![CDATA[The expression &lt;em&gt;&quot;one set of PX slaves&quot;&lt;/em&gt; is not the same as &lt;em&gt;&quot;one slave&quot;&lt;/em&gt;. 

This plan has &lt;em&gt;&quot;multiple parallel execution slaves executing together&quot;&lt;/em&gt;.]]></description>
		<content:encoded><![CDATA[<p>The expression <em>&#8220;one set of PX slaves&#8221;</em> is not the same as <em>&#8220;one slave&#8221;</em>. </p>
<p>This plan has <em>&#8220;multiple parallel execution slaves executing together&#8221;</em>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rajeshwaran, Jeyabal</title>
		<link>http://jonathanlewis.wordpress.com/2006/12/28/parallel-execution/#comment-35349</link>
		<dc:creator><![CDATA[Rajeshwaran, Jeyabal]]></dc:creator>
		<pubDate>Thu, 28 Jan 2010 15:06:54 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/12/28/parallel-execution/#comment-35349</guid>
		<description><![CDATA[So, having one set of parallel execution slaves is same as having the process executing in Serial process. Am i right?  I think parallel execution benefit is having multiple parallel execution slaves executing together. 
 Please correct me if i am wrong.]]></description>
		<content:encoded><![CDATA[<p>So, having one set of parallel execution slaves is same as having the process executing in Serial process. Am i right?  I think parallel execution benefit is having multiple parallel execution slaves executing together.<br />
 Please correct me if i am wrong.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2006/12/28/parallel-execution/#comment-35337</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Wed, 27 Jan 2010 20:10:19 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/12/28/parallel-execution/#comment-35337</guid>
		<description><![CDATA[First a correction to vocabulary: the TQ represents a &quot;table queue&quot; (or virtual table) used to pass data from one layer of processes to the next; it&#039;s not representative of a set of Slave processes.  It is true, though, that in your example you do have only one set of parallel execution slaves.

In effect, the plan breaks a single nested loop join into a number of nested loop joins using non-overlapping chunks (block ranges) of the EMP table.  Each PX slave takes one block range at a time. There is only one set of PX slaves, and as they produce data (at line 3) they pass it up to the query co-ordinator by writing into the virtual table TQ10000, and the query co-ordinator reads the virtual table and passed the data to the end-user.

In answer to your question (a) - id 4 is the parent of id 5. Having said that, I have never figured out exactly when Oracle decides to report a line as PCWC or PCWP - it&#039;s not easy since lines are often combined with both parent and child, and this makes the choice seem arbitrary.  In this case, I believe that the lines with id 3, 4 and 6 are combined with both parent and child, and line id 2 is both parallel to serial and parallel combined with child. (Lines 5 and 7 can only be parallel combined with parent since they have no child operations).
]]></description>
		<content:encoded><![CDATA[<p>First a correction to vocabulary: the TQ represents a &#8220;table queue&#8221; (or virtual table) used to pass data from one layer of processes to the next; it&#8217;s not representative of a set of Slave processes.  It is true, though, that in your example you do have only one set of parallel execution slaves.</p>
<p>In effect, the plan breaks a single nested loop join into a number of nested loop joins using non-overlapping chunks (block ranges) of the EMP table.  Each PX slave takes one block range at a time. There is only one set of PX slaves, and as they produce data (at line 3) they pass it up to the query co-ordinator by writing into the virtual table TQ10000, and the query co-ordinator reads the virtual table and passed the data to the end-user.</p>
<p>In answer to your question (a) &#8211; id 4 is the parent of id 5. Having said that, I have never figured out exactly when Oracle decides to report a line as PCWC or PCWP &#8211; it&#8217;s not easy since lines are often combined with both parent and child, and this makes the choice seem arbitrary.  In this case, I believe that the lines with id 3, 4 and 6 are combined with both parent and child, and line id 2 is both parallel to serial and parallel combined with child. (Lines 5 and 7 can only be parallel combined with parent since they have no child operations).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rajeshwaran, Jeyabal</title>
		<link>http://jonathanlewis.wordpress.com/2006/12/28/parallel-execution/#comment-35331</link>
		<dc:creator><![CDATA[Rajeshwaran, Jeyabal]]></dc:creator>
		<pubDate>Wed, 27 Jan 2010 14:40:14 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/12/28/parallel-execution/#comment-35331</guid>
		<description><![CDATA[[sourcecode]
scott@IRADSDB&gt; select /*+ parallel(e,4) parallel(d,4) */ dname,ename,sal
  2  from emp e,dept d
  3  where e.deptno = d.deptno;

Execution Plan
----------------------------------------------------------
Plan hash value: 1036174697

------------------------------------------------------------------------------------------------------------------------
&#124; Id  &#124; Operation                      &#124; Name     &#124; Rows  &#124; Bytes &#124; Cost (%CPU)&#124; Time     &#124;    TQ  &#124;IN-OUT&#124; PQ Distrib &#124;
------------------------------------------------------------------------------------------------------------------------
&#124;   0 &#124; SELECT STATEMENT               &#124;          &#124;    14 &#124;   364 &#124;     2   (0)&#124; 00:00:01 &#124;        &#124;      &#124;            &#124;
&#124;   1 &#124;  PX COORDINATOR                &#124;          &#124;       &#124;       &#124;            &#124;          &#124;        &#124;      &#124;            &#124;
&#124;   2 &#124;   PX SEND QC (RANDOM)          &#124; :TQ10000 &#124;    14 &#124;   364 &#124;     2   (0)&#124; 00:00:01 &#124;  Q1,00 &#124; P-&gt;S &#124; QC (RAND)  &#124;
&#124;   3 &#124;    NESTED LOOPS                &#124;          &#124;    14 &#124;   364 &#124;     2   (0)&#124; 00:00:01 &#124;  Q1,00 &#124; PCWP &#124;            &#124;
&#124;   4 &#124;     PX BLOCK ITERATOR          &#124;          &#124;       &#124;       &#124;            &#124;          &#124;  Q1,00 &#124; PCWC &#124;            &#124;
&#124;   5 &#124;      TABLE ACCESS FULL         &#124; EMP      &#124;    14 &#124;   182 &#124;     2   (0)&#124; 00:00:01 &#124;  Q1,00 &#124; PCWP &#124;            &#124;
&#124;   6 &#124;     TABLE ACCESS BY INDEX ROWID&#124; DEPT     &#124;     1 &#124;    13 &#124;     1   (0)&#124; 00:00:01 &#124;  Q1,00 &#124; PCWP &#124;            &#124;
&#124;*  7 &#124;      INDEX UNIQUE SCAN         &#124; PK_DEPT  &#124;     1 &#124;       &#124;     0   (0)&#124; 00:00:01 &#124;  Q1,00 &#124; PCWP &#124;            &#124;
------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------
   7 - access(&quot;E&quot;.&quot;DEPTNO&quot;=&quot;D&quot;.&quot;DEPTNO&quot;)
[/sourcecode]
1) Can you please help me how to read this Parallel Execution plan? 
    (a) looking at the step 5 in plan TABLE ACCESS FULL is done by Paralle combined with Parent (PCWP) is that parent for this operation is Step 3 in plan? 
    (b) Looking at TQ column in plan that only one Slave process (Q1,00) is allocated for this Execution? 
    
  Please correct me if i am wrong.]]></description>
		<content:encoded><![CDATA[<pre class="brush: plain; title: ; notranslate">
scott@IRADSDB&gt; select /*+ parallel(e,4) parallel(d,4) */ dname,ename,sal
  2  from emp e,dept d
  3  where e.deptno = d.deptno;

Execution Plan
----------------------------------------------------------
Plan hash value: 1036174697

------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                      | Name     | Rows  | Bytes | Cost (%CPU)| Time     |    TQ  |IN-OUT| PQ Distrib |
------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT               |          |    14 |   364 |     2   (0)| 00:00:01 |        |      |            |
|   1 |  PX COORDINATOR                |          |       |       |            |          |        |      |            |
|   2 |   PX SEND QC (RANDOM)          | :TQ10000 |    14 |   364 |     2   (0)| 00:00:01 |  Q1,00 | P-&gt;S | QC (RAND)  |
|   3 |    NESTED LOOPS                |          |    14 |   364 |     2   (0)| 00:00:01 |  Q1,00 | PCWP |            |
|   4 |     PX BLOCK ITERATOR          |          |       |       |            |          |  Q1,00 | PCWC |            |
|   5 |      TABLE ACCESS FULL         | EMP      |    14 |   182 |     2   (0)| 00:00:01 |  Q1,00 | PCWP |            |
|   6 |     TABLE ACCESS BY INDEX ROWID| DEPT     |     1 |    13 |     1   (0)| 00:00:01 |  Q1,00 | PCWP |            |
|*  7 |      INDEX UNIQUE SCAN         | PK_DEPT  |     1 |       |     0   (0)| 00:00:01 |  Q1,00 | PCWP |            |
------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------
   7 - access(&quot;E&quot;.&quot;DEPTNO&quot;=&quot;D&quot;.&quot;DEPTNO&quot;)
</pre>
<p>1) Can you please help me how to read this Parallel Execution plan?<br />
    (a) looking at the step 5 in plan TABLE ACCESS FULL is done by Paralle combined with Parent (PCWP) is that parent for this operation is Step 3 in plan?<br />
    (b) Looking at TQ column in plan that only one Slave process (Q1,00) is allocated for this Execution? </p>
<p>  Please correct me if i am wrong.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rizu</title>
		<link>http://jonathanlewis.wordpress.com/2006/12/28/parallel-execution/#comment-31558</link>
		<dc:creator><![CDATA[Rizu]]></dc:creator>
		<pubDate>Wed, 23 Jul 2008 13:04:06 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/12/28/parallel-execution/#comment-31558</guid>
		<description><![CDATA[Thanks Jonathan,
I&#039;ve found the culprit, which happens to be the log switch; log switch every minute, isn&#039;t it real high rate? I&#039;ve added 4 more log groups to it. Will also increase logfile size. Thanks again, for your detailed description.]]></description>
		<content:encoded><![CDATA[<p>Thanks Jonathan,<br />
I&#8217;ve found the culprit, which happens to be the log switch; log switch every minute, isn&#8217;t it real high rate? I&#8217;ve added 4 more log groups to it. Will also increase logfile size. Thanks again, for your detailed description.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2006/12/28/parallel-execution/#comment-31555</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Wed, 23 Jul 2008 09:01:29 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2006/12/28/parallel-execution/#comment-31555</guid>
		<description><![CDATA[Rizu,
I&#039;ve deleted the comment where you posted your &quot;Top 5 Timed Events&quot;, and copied the data (with a little formatting to try to make it more readable) into the previous post.

The first thing I would do in your case is to look at the SECOND event in the list.  &lt;i&gt;&quot;Log file switch (checkpoint incomplete)&quot;&lt;/i&gt; is a strong indicator that your log files are probably too small (or perhaps you don&#039;t have enough of them).

If you increase the size of your log files (see http://jonathanlewis.wordpress.com/2007/04/12/log-file-switch/ and the post it links to) you can probably get rid of all that wait time.

If the log file switch wait time comes from one layer of PX slaves, it is possible that a lot of the &quot;send blocked&quot; wait are coming from the PX slaves that are trying to feed them - so eliminating the log file switch may eliminate a large fraction (perhaps most, and given the layering of PX slaves) of the &quot;send blocked&quot; wait time.]]></description>
		<content:encoded><![CDATA[<p>Rizu,<br />
I&#8217;ve deleted the comment where you posted your &#8220;Top 5 Timed Events&#8221;, and copied the data (with a little formatting to try to make it more readable) into the previous post.</p>
<p>The first thing I would do in your case is to look at the SECOND event in the list.  <i>&#8220;Log file switch (checkpoint incomplete)&#8221;</i> is a strong indicator that your log files are probably too small (or perhaps you don&#8217;t have enough of them).</p>
<p>If you increase the size of your log files (see <a href="http://jonathanlewis.wordpress.com/2007/04/12/log-file-switch/" rel="nofollow">http://jonathanlewis.wordpress.com/2007/04/12/log-file-switch/</a> and the post it links to) you can probably get rid of all that wait time.</p>
<p>If the log file switch wait time comes from one layer of PX slaves, it is possible that a lot of the &#8220;send blocked&#8221; wait are coming from the PX slaves that are trying to feed them &#8211; so eliminating the log file switch may eliminate a large fraction (perhaps most, and given the layering of PX slaves) of the &#8220;send blocked&#8221; wait time.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
