In file relrewrite.h:

class RelAggrFuncPushDown : public RelRewriteRule

Rewrite Rule that pushes method applications on an aggregate down from a SPJ to a GBY node

Inheritance:


Public Methods

virtual XxxErrCode ApplyRule (RelQueryNode *InNode, XxxBool &Success, RelQueryNode *&OutNode)
applying this rule to a RelQueryNode

Private Methods

ValExprRefList* findAggrMethodPushDown (XxxValueExpression **exp, XxxValueExpression **ancestor, int childNumber)
Identifies all subexpressions of exp, that are method applications to constants or unknowns referencing childNumber
XxxErrCode pushDownAggrMethods (RelQueryNode *Parent, RelQueryNode *Child, XxxBool &Success)
Application of the RelAggrFuncPushDown rewrite to a given SPJ operator and a given GBY operator child
XxxErrCode substituteColumnValues (XxxValueExpression* &exp, XxxValueExprList* TargetList)
Substitutes all column references of an expression that is pushed down to the child

Inherited from RelRewriteRule:


Documentation

Rewrite Rule that pushes method applications on an aggregate down from a SPJ to a GBY node. select x.a.imag() from ( select csum(y.f1) as a from C2 y group by y.f2) x; becomes: select x.XXX_GEN_ID_1 from ( select csum(y.f1) as a, csum(y.f1).imag() as XXX_GEN_ID_1 from .... ) For more examples, see the rewrite test suites.
virtual XxxErrCode ApplyRule(RelQueryNode *InNode, XxxBool &Success, RelQueryNode *&OutNode)
applying this rule to a RelQueryNode

class ValExprRefList
Used to extract the positions of XxxValueExpressions that will be pushed down. Positions of XxxValueExpression* are XxxValueExpression**

class GeneratedIDString
Used to generate fresh id strings for the introduced column references in the parent SPJ node

XxxErrCode pushDownAggrMethods(RelQueryNode *Parent, RelQueryNode *Child, XxxBool &Success)
Application of the RelAggrFuncPushDown rewrite to a given SPJ operator and a given GBY operator child. For a given Parent (SPJ operator) and its child (GBY operator), this identifies all subexpressions in the targetlist that are method applications to an aggregate. It substitutes new Unknowns for them and adds them as new targets to the child node.

XxxErrCode substituteColumnValues(XxxValueExpression* &exp, XxxValueExprList* TargetList)
Substitutes all column references of an expression that is pushed down to the child. Recursive in exp. Column references are assumed to refer to the child's target list, and are simply replaced by a replication of the corresponding target expression.

ValExprRefList* findAggrMethodPushDown(XxxValueExpression **exp, XxxValueExpression **ancestor, int childNumber)
Identifies all subexpressions of exp, that are method applications to constants or unknowns referencing childNumber. Recursive in exp. ancestor denotes the greatest superexpression of exp that consists of method applications to constants or unknowns referencing childNumber. Initially, ancestor should be NULL.


This class has no child classes.
Author:
Tobias Mayr (mayr@cs.cornell.edu)
Version:
April '98
See Also:
suites/rewrite/aggregate_push_down.run

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de