The RelOpDagBuilder class encapsulates the process of checking query semantics and structuring a query directed acyclic graph (DAG)
![]() | BuildQueryDag (RelViewClass *View, RelQueryNode *&Root) Builds a query DAG, given a query view |
![]() | RelOpDagBuilder (const RelQueryEngine *Engine) Constructor |
![]() | ~RelOpDagBuilder () Destructor |
![]() | Aggregates All expressions referenced which contain an aggregate |
![]() | Arity The number of source relations |
![]() | Ascending An array of booleans corresponding to the ordering expressions; XXX_TRUE if ascending |
![]() | DistinctSelection XXX_TRUE if the selection is distinct |
![]() | Engine A handle on this relational query engine |
![]() | FinalProjection The projection which must be applied at the final SPJ |
![]() | FinalSPJNeeded XXX_TRUE if a final SPJ is needed to project out intermediate fields |
![]() | GroupByProjection The group-by projection list |
![]() | Groupings All group-by expressions |
![]() | GroupSelection The having condition |
![]() | GrpSelExprsRef All value expressions referenced in the HAVING clause |
![]() | InitProjection The list of all items that must be projected from the query inputs |
![]() | Ordering The ordering expressions |
![]() | Selection The selection condition |
![]() | SelectionExprsRef All value expressions referenced in the WHERE clause |
![]() | SourceRelations The source relations specified in the FROM clause |
![]() | UserProjection The projection list specified by the query |
![]() | AddFinalSPJNode (RelQueryNode *&Root) Creates the final SPJ node over the current root, which is passed in |
![]() | AddGroupByNode (RelQueryNode *&Root) Creates the group-by node over the current root, which is passed in |
![]() | AddImpliedProjections () The query may reference expressions that are not explicitly projected; In this case, these expressions must be added to the initial projection and a final projection must be formed to remove them later |
![]() | AddInitialSPJNode (RelQueryNode *&SPJNode, RelQueryNode **FromNodes) Creates the initial SPJ node with the from nodes as inputs |
![]() | AddOrderByNode (RelQueryNode *&Root) Creates the order-by node over the current root, which is passed in |
![]() | BuildFromNodes (RelQueryNode **&FromNodes) Creates query nodes for each of the relational inputs |
![]() | CheckSemantics () Checks the semantics of the information extracted |
![]() | GetViewInfo (const RelViewClass *View) Takes the query view information and organizes it |
![]() | PrintQueryDag (ostream &OStr) Prints the Query DAG to the output stream |
![]() | ReorganizeInfo () Reorganizes the information, changing the "implied expressions" to explicit ones; e |
The RelOpDagBuilder class encapsulates the process of checking query semantics and structuring a query directed acyclic graph (DAG). It generates extra info which it uses to construct a DAG. Note that the redundant RelQueryEngine::ViewToOpDag function is needed since a RelOpDagBuilder is created for every view transformed--a process which can be recursively necessary if a View is a FROM argument. The query graph is structured in the following way: an initial SPJ (select-project-join) node is created which takes all the query inputs as its children. Its projection list is a superset of the actual projection list, including also those attributes necessary for intermediate operations, such as ordering on a non-projected field. If aggregates (with or without grouping) are specified, a Group-By operator is placed above. If ordering is supplied, an Order-by operator is placed above. Finally, if items were projected in which were used only for intermediate operators, a final SPJ operator is placed above which projects these fields out.
XxxValueExprList* UserProjection
XxxValueExprList* InitProjection
XxxValueExprList* GroupByProjection
XxxValueExprList* Groupings
XxxValueExprList* Aggregates
XxxBool FinalSPJNeeded
XxxValueExprList* FinalProjection
XxxBool DistinctSelection
XxxBooleanExpression* Selection
XxxValueExprList* SelectionExprsRef
RelInfo** SourceRelations
int Arity
XxxBooleanExpression* GroupSelection
XxxValueExprList* GrpSelExprsRef
XxxValueExprList* Ordering
XxxBool* Ascending
XxxErrCode GetViewInfo(const RelViewClass *View)
XxxErrCode ReorganizeInfo()
XxxErrCode CheckSemantics()
XxxErrCode AddImpliedProjections()
void PrintQueryDag(ostream &OStr)
XxxErrCode BuildFromNodes(RelQueryNode **&FromNodes)
XxxErrCode AddInitialSPJNode(RelQueryNode *&SPJNode, RelQueryNode **FromNodes)
SPJNode - (output) The initial SPJ node
XxxErrCode AddGroupByNode(RelQueryNode *&Root)
XxxErrCode AddOrderByNode(RelQueryNode *&Root)
XxxErrCode AddFinalSPJNode(RelQueryNode *&Root)
RelOpDagBuilder(const RelQueryEngine *Engine)
~RelOpDagBuilder()
XxxErrCode BuildQueryDag(RelViewClass *View, RelQueryNode *&Root)
Root - The root of the newly contructed tree
this page has been generated automatically by doc++
(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de