<?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: Group By</title>
	<atom:link href="http://jonathanlewis.wordpress.com/2008/12/21/group-by/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com/2008/12/21/group-by/</link>
	<description>Just another Oracle weblog</description>
	<lastBuildDate>Sat, 18 May 2013 11:04:10 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Subquery Factoring &#171; Oracle Scratchpad</title>
		<link>http://jonathanlewis.wordpress.com/2008/12/21/group-by/#comment-44836</link>
		<dc:creator><![CDATA[Subquery Factoring &#171; Oracle Scratchpad]]></dc:creator>
		<pubDate>Wed, 01 Feb 2012 17:53:32 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=830#comment-44836</guid>
		<description><![CDATA[[...] subquery (which should, therefore, produce the same plan) but then unnests the subquery and uses &#8220;group by placement&#8221; to resolve the plan as a hash join followed by hash aggregation. This gives us two completely [...]]]></description>
		<content:encoded><![CDATA[<p>[...] subquery (which should, therefore, produce the same plan) but then unnests the subquery and uses &#8220;group by placement&#8221; to resolve the plan as a hash join followed by hash aggregation. This gives us two completely [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2008/12/21/group-by/#comment-40184</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Thu, 31 Mar 2011 14:31:55 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=830#comment-40184</guid>
		<description><![CDATA[I was doing a presentation in Ireland yesterday about things you might see, or have to plan for, when upgrading to 11gR2. This was a follow-on from the previous speaker who had mentioned a problem with &quot;group by&quot; queries returning the wrong results after the upgrade.

He&#039;s sent me a follow-up email with some details - and this looks like the best place to publish them.

&lt;ul&gt;&lt;em&gt;
Recently the database was upgraded to 11.2.0.1.
Since then, a query returns wrong results (zero rows).
When disabling the hidden parameter &quot;_optimizer_group_by_placement&quot;, the query retrieves correct results.
&lt;/em&gt;&lt;/ul&gt;

There are cases in 11.2.0.1 where &lt;em&gt;&quot;group by placement&quot;&lt;/em&gt; goes wrong when aggregation is applied to complex views (it isn&#039;t a general problem).

Patch 10100766 is relevant (currently only available for AIX) and this seems to address bugs 9022839 (reported as fixed in 11.2.0.2) and 10028651.]]></description>
		<content:encoded><![CDATA[<p>I was doing a presentation in Ireland yesterday about things you might see, or have to plan for, when upgrading to 11gR2. This was a follow-on from the previous speaker who had mentioned a problem with &#8220;group by&#8221; queries returning the wrong results after the upgrade.</p>
<p>He&#8217;s sent me a follow-up email with some details &#8211; and this looks like the best place to publish them.</p>
<ul><em><br />
Recently the database was upgraded to 11.2.0.1.<br />
Since then, a query returns wrong results (zero rows).<br />
When disabling the hidden parameter &#8220;_optimizer_group_by_placement&#8221;, the query retrieves correct results.<br />
</em></ul>
<p>There are cases in 11.2.0.1 where <em>&#8220;group by placement&#8221;</em> goes wrong when aggregation is applied to complex views (it isn&#8217;t a general problem).</p>
<p>Patch 10100766 is relevant (currently only available for AIX) and this seems to address bugs 9022839 (reported as fixed in 11.2.0.2) and 10028651.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Internal Views &#171; Oracle Scratchpad</title>
		<link>http://jonathanlewis.wordpress.com/2008/12/21/group-by/#comment-39747</link>
		<dc:creator><![CDATA[Internal Views &#171; Oracle Scratchpad]]></dc:creator>
		<pubDate>Sun, 27 Feb 2011 18:12:20 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=830#comment-39747</guid>
		<description><![CDATA[[...] For reference notes for a couple of these cases:   Join Factorization Group by Placement [...]]]></description>
		<content:encoded><![CDATA[<p>[...] For reference notes for a couple of these cases:   Join Factorization Group by Placement [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2008/12/21/group-by/#comment-38077</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Sat, 04 Dec 2010 14:57:37 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=830#comment-38077</guid>
		<description><![CDATA[goldenorbit,

If you read the train of comments you now have a sample of code you can experiment with to learn more about the pros and cons of hash aggregation.

I&#039;m not surprised that a DBA that&#039;s set a (hidden) parameter is scared to remove it on a production system. But you could try persuading them to test a few queries with the &#039;use_hash_aggregation&#039; hint.

Are you sure that people who &quot;add an order by&quot; are doing so to disable the feature - if so then there&#039;s no guarantee that it will work. They&#039;d be better off (temporarily) using the &#039;no_use_hash_aggregation&#039; hint. Most people who add an &quot;order by&quot; do so because they forgot that a &quot;group by&quot; doesn&#039;t imply an &quot;order by&quot;.

If you think there is a patch for hash aggregation, I suggest you get one of your doubting DBAs to raise an SR for it.]]></description>
		<content:encoded><![CDATA[<p>goldenorbit,</p>
<p>If you read the train of comments you now have a sample of code you can experiment with to learn more about the pros and cons of hash aggregation.</p>
<p>I&#8217;m not surprised that a DBA that&#8217;s set a (hidden) parameter is scared to remove it on a production system. But you could try persuading them to test a few queries with the &#8216;use_hash_aggregation&#8217; hint.</p>
<p>Are you sure that people who &#8220;add an order by&#8221; are doing so to disable the feature &#8211; if so then there&#8217;s no guarantee that it will work. They&#8217;d be better off (temporarily) using the &#8216;no_use_hash_aggregation&#8217; hint. Most people who add an &#8220;order by&#8221; do so because they forgot that a &#8220;group by&#8221; doesn&#8217;t imply an &#8220;order by&#8221;.</p>
<p>If you think there is a patch for hash aggregation, I suggest you get one of your doubting DBAs to raise an SR for it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: goldenorbit</title>
		<link>http://jonathanlewis.wordpress.com/2008/12/21/group-by/#comment-38061</link>
		<dc:creator><![CDATA[goldenorbit]]></dc:creator>
		<pubDate>Fri, 03 Dec 2010 23:50:08 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=830#comment-38061</guid>
		<description><![CDATA[Hi Jonathan,

Don&#039;t get me wrong. There are several blogs explaining how &quot;hash group by&quot; behave differently than &quot;sort group by&quot;, but I have been trying to search &amp; read a lot to get the positive benchmark proof for hash group by (during the past 2 years), that single line in ORACLE 10gR2 white paper is the only official statement I can use so far. If I just post my question by referring a statement from some personal blog, you might not pay attention to the topic, right?

There are blogs talking about the problems for &quot;hash group by&quot;, even with a general statement saying that &quot;hash group by&quot; is a good feature, but I have not yet found any dedicated article to explain if/why &quot;group hash by&quot; is faster &amp; useful. 

I kept wondering if I miss-used &quot;group hash by&quot; or there&#039;s a bug fix for it that I was not ware of. I have encountered 3 DW RAC 20TB+ (2 x 10g and 1 x 11g), &quot;group hash by&quot; are disabled in all 4 implementations by DBA, and I can&#039;t convince them to enable it. 

Some people add &quot;order by&quot; to their query to avoid &quot;hash group by&quot;, some people disable the feature at session level, some people continue running the SQL without noticing any difference... I hope to leverage the popularity of your blog to ask: &lt;b&gt; is there anyone out there who has strong proof that &quot;hash group by&quot; is really good? what patch is required? &lt;/b&gt;

Thank you.]]></description>
		<content:encoded><![CDATA[<p>Hi Jonathan,</p>
<p>Don&#8217;t get me wrong. There are several blogs explaining how &#8220;hash group by&#8221; behave differently than &#8220;sort group by&#8221;, but I have been trying to search &amp; read a lot to get the positive benchmark proof for hash group by (during the past 2 years), that single line in ORACLE 10gR2 white paper is the only official statement I can use so far. If I just post my question by referring a statement from some personal blog, you might not pay attention to the topic, right?</p>
<p>There are blogs talking about the problems for &#8220;hash group by&#8221;, even with a general statement saying that &#8220;hash group by&#8221; is a good feature, but I have not yet found any dedicated article to explain if/why &#8220;group hash by&#8221; is faster &amp; useful. </p>
<p>I kept wondering if I miss-used &#8220;group hash by&#8221; or there&#8217;s a bug fix for it that I was not ware of. I have encountered 3 DW RAC 20TB+ (2 x 10g and 1 x 11g), &#8220;group hash by&#8221; are disabled in all 4 implementations by DBA, and I can&#8217;t convince them to enable it. </p>
<p>Some people add &#8220;order by&#8221; to their query to avoid &#8220;hash group by&#8221;, some people disable the feature at session level, some people continue running the SQL without noticing any difference&#8230; I hope to leverage the popularity of your blog to ask: <b> is there anyone out there who has strong proof that &#8220;hash group by&#8221; is really good? what patch is required? </b></p>
<p>Thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: orainternals</title>
		<link>http://jonathanlewis.wordpress.com/2008/12/21/group-by/#comment-38036</link>
		<dc:creator><![CDATA[orainternals]]></dc:creator>
		<pubDate>Thu, 02 Dec 2010 14:54:57 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=830#comment-38036</guid>
		<description><![CDATA[Hello Jonathan
  
   Greetings! 
   
   &lt;a href=&quot;orainternals.wordpress.com&quot; rel=&quot;nofollow&quot;&gt; Orainternal &lt;/a&gt; is my blog :-)

   Yes, you are correct, my blog entry is more about scientific approach than disabling &quot;Group by hash aggregation&quot;. It seems to me that, in some corner cases, HASH GROUP BY feature has a bug (10.2.0.3 and 10.2.0.4), due to which memory is allocated and de-allocated excessively leading to longer run time. Of course, this is not going to show up in sqltrace or any other conventional tools, only a pstack loop pointed to the issue. My intention was to introduce those tools to approach the problem scientifically. I remember seeing a similar bug in MOS, but that bug was specific to queries involving FILTER step with GROUP BY operation in a subquery branch (and I can&#039;t find the bug anymore). My client didn&#039;t prefer to follow up the issue with support all the way, we resolved the issue with a profile and closed the problem.

   In my blog entry, I also said &quot;Note that, I am not saying hash group by feature is bad. Rather, we seem to have encountered an unfortunate bug which caused performance issues at this client. I think, Hash Grouping is a good feature as the efficiency of grouping operations can be improved if you have ample amount of memory. That’s the reason why we disabled this feature at the statement level, NOT at the instance level.&quot; in line with you.

Cheers 
Riyaj]]></description>
		<content:encoded><![CDATA[<p>Hello Jonathan</p>
<p>   Greetings! </p>
<p>   <a href="orainternals.wordpress.com" rel="nofollow"> Orainternal </a> is my blog :-)</p>
<p>   Yes, you are correct, my blog entry is more about scientific approach than disabling &#8220;Group by hash aggregation&#8221;. It seems to me that, in some corner cases, HASH GROUP BY feature has a bug (10.2.0.3 and 10.2.0.4), due to which memory is allocated and de-allocated excessively leading to longer run time. Of course, this is not going to show up in sqltrace or any other conventional tools, only a pstack loop pointed to the issue. My intention was to introduce those tools to approach the problem scientifically. I remember seeing a similar bug in MOS, but that bug was specific to queries involving FILTER step with GROUP BY operation in a subquery branch (and I can&#8217;t find the bug anymore). My client didn&#8217;t prefer to follow up the issue with support all the way, we resolved the issue with a profile and closed the problem.</p>
<p>   In my blog entry, I also said &#8220;Note that, I am not saying hash group by feature is bad. Rather, we seem to have encountered an unfortunate bug which caused performance issues at this client. I think, Hash Grouping is a good feature as the efficiency of grouping operations can be improved if you have ample amount of memory. That’s the reason why we disabled this feature at the statement level, NOT at the instance level.&#8221; in line with you.</p>
<p>Cheers<br />
Riyaj</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2008/12/21/group-by/#comment-38025</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Thu, 02 Dec 2010 08:22:03 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=830#comment-38025</guid>
		<description><![CDATA[goldenorbit,

Why don&#039;t you try reading things carefully and thinking about them, rather than looking at one line that seems to confirm you prejudices ?

The white paper gives you one example of a query where the 10.2 hash aggregations operates much more efficiently than the 10.1 sort aggregation. You are insisting that this means hash aggregation must always be faster than sort aggregation in all cases and versions. Don&#039;t forget that the paper also points out that the 10.2 simple sort algorithm is faster than the 10.1 simple sorting algorithm -  might this also be relevant to sort aggregation in later releases ?

Your results in show figures for sort and hash aggregration with degree 4, 8, and 16.  At degree 8 the performance is significantly better than at degree 4 OR 16 - and the hash aggregation is 25% faster than the sort aggregation at that degree.  (It&#039;s a few percent worse at degree 4 and a few percent better at degree 16).  Shouldn&#039;t the drop from 8 minutes to 5:30 at degree eight give you reason to wonder where the time is going ?  I note also that the plan suggests you are aggregating 288 Million rows down to 71M - as I pointed out in my comment on the other thread where you raised your point ( http://jonathanlewis.wordpress.com/2010/11/19/quiz-night-9/#comment-37904 ), the relative performance of sort and hash aggregation is dependent on the data pattern and level of aggregation - and the relatively small reduction of volume in your example offers the hash aggregation little room for improvement over the sort aggregate.

You might point out to your DBAs that the link on orainternals (which is about 10g, not 11g) has the conclusion that the feature is too good to miss in general, so they only disable it for specific statements.]]></description>
		<content:encoded><![CDATA[<p>goldenorbit,</p>
<p>Why don&#8217;t you try reading things carefully and thinking about them, rather than looking at one line that seems to confirm you prejudices ?</p>
<p>The white paper gives you one example of a query where the 10.2 hash aggregations operates much more efficiently than the 10.1 sort aggregation. You are insisting that this means hash aggregation must always be faster than sort aggregation in all cases and versions. Don&#8217;t forget that the paper also points out that the 10.2 simple sort algorithm is faster than the 10.1 simple sorting algorithm &#8211;  might this also be relevant to sort aggregation in later releases ?</p>
<p>Your results in show figures for sort and hash aggregration with degree 4, 8, and 16.  At degree 8 the performance is significantly better than at degree 4 OR 16 &#8211; and the hash aggregation is 25% faster than the sort aggregation at that degree.  (It&#8217;s a few percent worse at degree 4 and a few percent better at degree 16).  Shouldn&#8217;t the drop from 8 minutes to 5:30 at degree eight give you reason to wonder where the time is going ?  I note also that the plan suggests you are aggregating 288 Million rows down to 71M &#8211; as I pointed out in my comment on the other thread where you raised your point ( <a href="http://jonathanlewis.wordpress.com/2010/11/19/quiz-night-9/#comment-37904" rel="nofollow">http://jonathanlewis.wordpress.com/2010/11/19/quiz-night-9/#comment-37904</a> ), the relative performance of sort and hash aggregation is dependent on the data pattern and level of aggregation &#8211; and the relatively small reduction of volume in your example offers the hash aggregation little room for improvement over the sort aggregate.</p>
<p>You might point out to your DBAs that the link on orainternals (which is about 10g, not 11g) has the conclusion that the feature is too good to miss in general, so they only disable it for specific statements.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: goldenorbit</title>
		<link>http://jonathanlewis.wordpress.com/2008/12/21/group-by/#comment-38013</link>
		<dc:creator><![CDATA[goldenorbit]]></dc:creator>
		<pubDate>Thu, 02 Dec 2010 02:09:43 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=830#comment-38013</guid>
		<description><![CDATA[Thanks for the reply, Greg. The reason that I posted the question here to leverage Jonathan&#039;s popularity to get more feedback. 

Since HASH GROUP BY was introduced, it has at least 2 bugs reported: wrong result 4604970 and excessive temp space usage 7716219 (don&#039;t remember the links). 

As you can see from the old twp-dss-performance-10gr2-0705-128049.pdf, ORACLE did claim that hash aggregation should bring major performance improvement in 10gR2. But even the above bugs should have been patched by now, my DBA still insist disabling hash group by, and I still don&#039;t have a benchmark proof to convince them that hash group by is way faster than sort group by, so this feature can be enabled. 

See my quick test result here https://docs.google.com/document/pub?id=133amtsexvyaB06m1VCu8add8CPQ139Iqv7jGlFknjE8

There is another recent post http://orainternals.wordpress.com/2010/09/30/group-by-hash-aggregation/]]></description>
		<content:encoded><![CDATA[<p>Thanks for the reply, Greg. The reason that I posted the question here to leverage Jonathan&#8217;s popularity to get more feedback. </p>
<p>Since HASH GROUP BY was introduced, it has at least 2 bugs reported: wrong result 4604970 and excessive temp space usage 7716219 (don&#8217;t remember the links). </p>
<p>As you can see from the old twp-dss-performance-10gr2-0705-128049.pdf, ORACLE did claim that hash aggregation should bring major performance improvement in 10gR2. But even the above bugs should have been patched by now, my DBA still insist disabling hash group by, and I still don&#8217;t have a benchmark proof to convince them that hash group by is way faster than sort group by, so this feature can be enabled. </p>
<p>See my quick test result here <a href="https://docs.google.com/document/pub?id=133amtsexvyaB06m1VCu8add8CPQ139Iqv7jGlFknjE8" rel="nofollow">https://docs.google.com/document/pub?id=133amtsexvyaB06m1VCu8add8CPQ139Iqv7jGlFknjE8</a></p>
<p>There is another recent post <a href="http://orainternals.wordpress.com/2010/09/30/group-by-hash-aggregation/" rel="nofollow">http://orainternals.wordpress.com/2010/09/30/group-by-hash-aggregation/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Rahn</title>
		<link>http://jonathanlewis.wordpress.com/2008/12/21/group-by/#comment-38010</link>
		<dc:creator><![CDATA[Greg Rahn]]></dc:creator>
		<pubDate>Thu, 02 Dec 2010 00:10:43 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=830#comment-38010</guid>
		<description><![CDATA[This query transformation (group-by placement) is available in 11g.  

[sourcecode language=&quot;sql&quot;]
explain plan for
select cal_mnth_nbr, sum(purch_amt) tot_purch_amt
from order_fact
join date_dim using (cal_dt)
where cal_yr_nbr = 2008
group by cal_mnth_nbr;
select * from table(dbms_xplan.display(format=&gt;&#039;basic rows predicate&#039;));

-------------------------------------------------------
&#124; Id  &#124; Operation               &#124; Name        &#124; Rows  &#124;
-------------------------------------------------------
&#124;   0 &#124; SELECT STATEMENT        &#124;             &#124;     8 &#124;
&#124;   1 &#124;  HASH GROUP BY          &#124;             &#124;     8 &#124;
&#124;*  2 &#124;   HASH JOIN             &#124;             &#124;   349 &#124;
&#124;*  3 &#124;    TABLE ACCESS FULL    &#124; DATE_DIM    &#124;   349 &#124;
&#124;   4 &#124;    VIEW                 &#124; VW_GBC_5    &#124;   366 &#124;
&#124;   5 &#124;     HASH GROUP BY       &#124;             &#124;   366 &#124;
&#124;   6 &#124;      PARTITION RANGE ALL&#124;             &#124;  5611M&#124;
&#124;   7 &#124;       TABLE ACCESS FULL &#124; ORDER_FACT  &#124;  5611M&#124;
-------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - access(&quot;ITEM_1&quot;=&quot;DATE_DIM&quot;.&quot;CAL_DT&quot;)
   3 - filter(&quot;DATE_DIM&quot;.&quot;CAL_YR_NBR&quot;=2008)

## from optimizer trace
GBP: Costing transformed query.
GBP: Transformed query 
******* UNPARSED QUERY IS *******
SELECT
  &quot;DATE_DIM&quot;.&quot;CAL_MNTH_NBR&quot; &quot;CAL_MNTH_NBR&quot;,
  SUM(&quot;VW_GBC_5&quot;.&quot;ITEM_2&quot;) &quot;TOT_PURCH_AMT&quot;
FROM
  (
    SELECT
      &quot;ORDER_FACT&quot;.&quot;CAL_DT&quot; &quot;ITEM_1&quot;,
      SUM(&quot;ORDER_FACT&quot;.&quot;PURCH_AMT&quot;) &quot;ITEM_2&quot;
    FROM
      &quot;ORDER_FACT&quot; &quot;ORDER_FACT&quot;
    GROUP BY
      &quot;ORDER_FACT&quot;.&quot;CAL_DT&quot;
  )
  &quot;VW_GBC_5&quot;,
  &quot;DATE_DIM&quot; &quot;DATE_DIM&quot;
WHERE
  &quot;VW_GBC_5&quot;.&quot;ITEM_1&quot; = &quot;DATE_DIM&quot;.&quot;CAL_DT&quot;
GROUP BY
  &quot;DATE_DIM&quot;.&quot;CAL_MNTH_NBR&quot;

[/sourcecode]]]></description>
		<content:encoded><![CDATA[<p>This query transformation (group-by placement) is available in 11g.  </p>
<pre class="brush: sql; title: ; notranslate">
explain plan for
select cal_mnth_nbr, sum(purch_amt) tot_purch_amt
from order_fact
join date_dim using (cal_dt)
where cal_yr_nbr = 2008
group by cal_mnth_nbr;
select * from table(dbms_xplan.display(format=&gt;'basic rows predicate'));

-------------------------------------------------------
| Id  | Operation               | Name        | Rows  |
-------------------------------------------------------
|   0 | SELECT STATEMENT        |             |     8 |
|   1 |  HASH GROUP BY          |             |     8 |
|*  2 |   HASH JOIN             |             |   349 |
|*  3 |    TABLE ACCESS FULL    | DATE_DIM    |   349 |
|   4 |    VIEW                 | VW_GBC_5    |   366 |
|   5 |     HASH GROUP BY       |             |   366 |
|   6 |      PARTITION RANGE ALL|             |  5611M|
|   7 |       TABLE ACCESS FULL | ORDER_FACT  |  5611M|
-------------------------------------------------------

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

   2 - access(&quot;ITEM_1&quot;=&quot;DATE_DIM&quot;.&quot;CAL_DT&quot;)
   3 - filter(&quot;DATE_DIM&quot;.&quot;CAL_YR_NBR&quot;=2008)

## from optimizer trace
GBP: Costing transformed query.
GBP: Transformed query 
******* UNPARSED QUERY IS *******
SELECT
  &quot;DATE_DIM&quot;.&quot;CAL_MNTH_NBR&quot; &quot;CAL_MNTH_NBR&quot;,
  SUM(&quot;VW_GBC_5&quot;.&quot;ITEM_2&quot;) &quot;TOT_PURCH_AMT&quot;
FROM
  (
    SELECT
      &quot;ORDER_FACT&quot;.&quot;CAL_DT&quot; &quot;ITEM_1&quot;,
      SUM(&quot;ORDER_FACT&quot;.&quot;PURCH_AMT&quot;) &quot;ITEM_2&quot;
    FROM
      &quot;ORDER_FACT&quot; &quot;ORDER_FACT&quot;
    GROUP BY
      &quot;ORDER_FACT&quot;.&quot;CAL_DT&quot;
  )
  &quot;VW_GBC_5&quot;,
  &quot;DATE_DIM&quot; &quot;DATE_DIM&quot;
WHERE
  &quot;VW_GBC_5&quot;.&quot;ITEM_1&quot; = &quot;DATE_DIM&quot;.&quot;CAL_DT&quot;
GROUP BY
  &quot;DATE_DIM&quot;.&quot;CAL_MNTH_NBR&quot;

</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Rahn</title>
		<link>http://jonathanlewis.wordpress.com/2008/12/21/group-by/#comment-38009</link>
		<dc:creator><![CDATA[Greg Rahn]]></dc:creator>
		<pubDate>Wed, 01 Dec 2010 23:43:27 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=830#comment-38009</guid>
		<description><![CDATA[There is no correlation that can be drawn from one-pass distinct sampling (dbms_stats.auto_sample_size in 11g) and a potential performance delta between SORT GROUP BY and HASH GROUP BY.

The only reason that comes to mind to disable hash group-by aggregation is a wrong results bug.]]></description>
		<content:encoded><![CDATA[<p>There is no correlation that can be drawn from one-pass distinct sampling (dbms_stats.auto_sample_size in 11g) and a potential performance delta between SORT GROUP BY and HASH GROUP BY.</p>
<p>The only reason that comes to mind to disable hash group-by aggregation is a wrong results bug.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
