Class AddExchangesBelowPartialAggregationOverGroupIdRuleSet


  • public class AddExchangesBelowPartialAggregationOverGroupIdRuleSet
    extends Object
    Transforms
       - Exchange
         - [ Projection ]
           - Partial Aggregation
             - GroupId
     
    to
       - Exchange
         - [ Projection ]
           - Partial Aggregation
             - GroupId
               - LocalExchange
                 - RemoteExchange
     

    Rationale: GroupId increases number of rows (number of times equal to number of grouping sets) and then partial aggregation reduces number of rows. However, under certain conditions, exchanging the rows before GroupId (before multiplication) makes partial aggregation more effective, resulting in less data being exchanged afterwards.