<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>OpenText Analytics Database 26.2.x – GROUP BY paths</title>
    <link>/en/admin/managing-queries/query-plans/query-plan-information-and-structure/group-by-paths/</link>
    <description>Recent content in GROUP BY paths on OpenText Analytics Database 26.2.x</description>
    <generator>Hugo -- gohugo.io</generator>
    
	  <atom:link href="/en/admin/managing-queries/query-plans/query-plan-information-and-structure/group-by-paths/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Admin: GROUPBY HASH query plan</title>
      <link>/en/admin/managing-queries/query-plans/query-plan-information-and-structure/group-by-paths/groupby-hash-query-plan/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/admin/managing-queries/query-plans/query-plan-information-and-structure/group-by-paths/groupby-hash-query-plan/</guid>
      <description>
        
        
        &lt;p&gt;Here&#39;s an example of how &lt;code&gt;GROUPBY HASH&lt;/code&gt; operations look in &lt;code&gt;EXPLAIN&lt;/code&gt; output.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; EXPLAIN SELECT COUNT(DISTINCT annual_income)
     FROM customer_dimension
     WHERE customer_region=&amp;#39;NorthWest&amp;#39;;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The output shows that the optimizer chose the less efficient &lt;code&gt;GROUPBY HASH&lt;/code&gt; path, which means the projection was not presorted on the &lt;code&gt;annual_income&lt;/code&gt; column. If such a projection is available, the optimizer would choose the &lt;code&gt;GROUPBY PIPELINED&lt;/code&gt; algorithm.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Access Path:
+-GROUPBY NOTHING [Cost: 256, Rows: 1 (NO STATISTICS)] (PATH ID: 1)
|  Aggregates: count(DISTINCT customer_dimension.annual_income)
| +---&amp;gt; &lt;span class=&#34;code-input&#34;&gt;GROUPBY HASH&lt;/span&gt; (LOCAL RESEGMENT GROUPS) [Cost: 253, Rows: 10K (NO STATISTICS)] (PATH ID: 2)
| |      Group By: customer_dimension.annual_income
| | +---&amp;gt; STORAGE ACCESS for customer_dimension [Cost: 227, Rows: 50K (NO STATISTICS)] (PATH ID: 3)
| | |      Projection: public.customer_dimension_super
| | |      Materialize: customer_dimension.annual_income
| | |      Filter: (customer_dimension.customer_region = &amp;#39;NorthWest&amp;#39;
...
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Admin: GROUPBY PIPELINED query plan</title>
      <link>/en/admin/managing-queries/query-plans/query-plan-information-and-structure/group-by-paths/groupby-pipelined-query-plan/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/admin/managing-queries/query-plans/query-plan-information-and-structure/group-by-paths/groupby-pipelined-query-plan/</guid>
      <description>
        
        
        &lt;p&gt;If you have a projection that is already sorted on the &lt;code&gt;customer_gender&lt;/code&gt; column, the optimizer chooses the faster &lt;code&gt;GROUPBY PIPELINED&lt;/code&gt; operation:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt; =&amp;gt; EXPLAIN SELECT COUNT(distinct customer_gender) from customer_dimension;
Access Path:
 +-GROUPBY NOTHING [Cost: 22, Rows: 1] (PATH ID: 1)
 |  Aggregates: count(DISTINCT customer_dimension.customer_gender)
 |  Execute on: Query Initiator
 | +---&amp;gt; GROUPBY PIPELINED [Cost: 20, Rows: 10K] (PATH ID: 2)
 | |      Group By: customer_dimension.customer_gender
 | |      Execute on: Query Initiator
 | | +---&amp;gt; STORAGE ACCESS for customer_dimension [Cost: 17, Rows: 50K (3 RLE)] (PATH ID: 3)
 | | |      Projection: public.customer_dimension_DBD_1_rep_vmartdb_design_vmartdb_design_node0001
 | | |      Materialize: customer_dimension.customer_gender
 | | |      Execute on: Query Initiator
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Similarly, the use of an equality predicate, such as in the following query, preserves &lt;code&gt;GROUPBY PIPELINED&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; EXPLAIN SELECT COUNT(DISTINCT annual_income)    FROM customer_dimension
   WHERE customer_gender = &amp;#39;Female&amp;#39;;

 Access Path: +-GROUPBY NOTHING [Cost: 161, Rows: 1] (PATH ID: 1)
 |  Aggregates: count(DISTINCT customer_dimension.annual_income)
 | +---&amp;gt; GROUPBY PIPELINED [Cost: 158, Rows: 10K] (PATH ID: 2)
 | |      Group By: customer_dimension.annual_income
 | | +---&amp;gt; STORAGE ACCESS for customer_dimension [Cost: 144, Rows: 47K] (PATH ID: 3)
 | | |      Projection: public.customer_dimension_DBD_1_rep_vmartdb_design_vmartdb_design_node0001
 | | |      Materialize: customer_dimension.annual_income
 | | |      Filter: (customer_dimension.customer_gender = &amp;#39;Female&amp;#39;)
&lt;/code&gt;&lt;/pre&gt;
&lt;div class=&#34;alert admonition tip&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Tip&lt;/h4&gt;

If &lt;code&gt;EXPLAIN&lt;/code&gt; reports &lt;code&gt;GROUPBY HASH&lt;/code&gt;, modify the projection design to force it to use &lt;code&gt;GROUPBY PIPELINED&lt;/code&gt;.

&lt;/div&gt;

      </description>
    </item>
    
  </channel>
</rss>
