com.bigdata.rdf.sparql.ast.optimizers
Class ASTRunFirstRunLastOptimizer

java.lang.Object
  extended by com.bigdata.rdf.sparql.ast.optimizers.ASTRunFirstRunLastOptimizer
All Implemented Interfaces:
IASTOptimizer

public class ASTRunFirstRunLastOptimizer
extends Object
implements IASTOptimizer

This optimizer simply puts each type of IGroupMemberNode within a JoinGroupNode in the right order w.r.t. to the other types.

Basically the ASTRunFirstRunLastOptimizer will look for IJoinNodes that have a query hint of QueryHints.RUN_FIRST=true or RUN_LAST=true. If it finds more than one "run first" or "run last" it will throw an exception. If it finds an optional marked as "run first" it will throw an exception. It will then scan the group and identify the first and last indices for IJoinNodes, and place the run first and run last IJoinNodes at those indices. The static optimizer will also look for a "run first" IJoinNode in a group and make sure that it gets run first in the group (of the statement patterns).


Constructor Summary
ASTRunFirstRunLastOptimizer()
           
 
Method Summary
 IQueryNode optimize(AST2BOpContext context, IQueryNode queryNode, IBindingSet[] bindingSets)
          Optimize the AST.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ASTRunFirstRunLastOptimizer

public ASTRunFirstRunLastOptimizer()
Method Detail

optimize

public IQueryNode optimize(AST2BOpContext context,
                           IQueryNode queryNode,
                           IBindingSet[] bindingSets)
Description copied from interface: IASTOptimizer
Optimize the AST.

Specified by:
optimize in interface IASTOptimizer
Parameters:
context - The evaluation context.
queryNode - The AST (in).
Returns:
The optimized AST.


Copyright © 2006-2012 SYSTAP, LLC. All Rights Reserved.