public class AST2BOpRTO extends AST2BOpJoins
Note: The RTO currently uses bottom-up evaluation to solve the join graph and generate a sub-query plan with an optimized join ordering. It uses left-to-right evaluation to pass pipeline solutions through the optimized subquery.
JoinGraph
,
JGraph
Modifier and Type | Class and Description |
---|---|
static interface |
AST2BOpRTO.Annotations |
Modifier and Type | Field and Description |
---|---|
static org.apache.log4j.Logger |
log |
Constructor and Description |
---|
AST2BOpRTO() |
Modifier and Type | Method and Description |
---|---|
static PipelineOp |
compileJoinGraph(QueryEngine queryEngine,
JoinGraph joinGraph,
Path path)
Compile a join graph into a query plan.
|
protected static PipelineOp |
convertRTOJoinGraph(PipelineOp left,
JoinGroupNode joinGroup,
Set<IVariable<?>> doneSet,
AST2BOpContext ctx,
AtomicInteger start)
Inspect the remainder of the join group.
|
static EdgeSample |
cutoffJoin(QueryEngine queryEngine,
JoinGraph joinGraph,
int limit,
IPredicate<?>[] predicates,
IConstraint[] constraints,
boolean pathIsComplete,
SampleBase sourceSample)
Cutoff join of the last vertex in the join path.
|
join
addChunkedMaterializationStep, addMaterializationSteps1, addMaterializationSteps2, addMaterializationSteps3, addNonConditionalMaterializationSteps, getJoinConstraints, getJoinConstraints, getJoinConstraints2
applyQueryHints, applyQueryHints, leftOrEmpty
protected static PipelineOp convertRTOJoinGraph(PipelineOp left, JoinGroupNode joinGroup, Set<IVariable<?>> doneSet, AST2BOpContext ctx, AtomicInteger start)
Note: Two predicates in a join group is not enough for the RTO to provide a different join ordering. Both the static optimizer and the RTO will always choose the AP with the smaller cardinality to run first. If there are only 2 predicates, then the other predicate will run second. You need at least three predicates before the RTO could provide a different answer.
public static PipelineOp compileJoinGraph(QueryEngine queryEngine, JoinGraph joinGraph, Path path)
queryEngine
- The QueryEngine
on which the RTO has been executing
and on which the returned query plan may be executed.joinGraph
- The operator that executed the RTO.path
- The join path that was selected for full execution by the RTO
based on deep sampling of the join graph.JoinGraph.Annotations#JOIN_GROUP
into the ordering
specified in the Path
and make sure that
convertJoinGroup() did not attempt to recursively reapply the
RTO. This will get rid of one of the few remaining uses of
PartitionedJoinGroup
.public static EdgeSample cutoffJoin(QueryEngine queryEngine, JoinGraph joinGraph, int limit, IPredicate<?>[] predicates, IConstraint[] constraints, boolean pathIsComplete, SampleBase sourceSample) throws Exception
The caller is responsible for protecting against needless re-sampling. This includes cases where a sample already exists at the desired sample limit and cases where the sample is already exact.
queryEngine
- The query engine.joinGraph
- The pipeline operator that is executing the RTO. This defines
the join graph (vertices, edges, and constraints) and also
provides access to the AST and related metadata required to
execute the join graph.limit
- The limit for the cutoff join.predicates
- The path segment, which must include the target vertex as the
last component of the path segment.constraints
- The constraints declared for the join graph (if any). The
appropriate constraints will be applied based on the variables
which are known to be bound as of the cutoff join for the last
vertex in the path segment.pathIsComplete
- true
iff all vertices in the join graph are
incorporated into this path.sourceSample
- The input sample for the cutoff join. When this is a one-step
estimation of the cardinality of the edge, then this sample is
taken from the VertexSample
. When the edge (vSource,
vTarget) extends some Path
, then this is taken from
the EdgeSample
for that Path
.Exception
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.