public class JoinGraph extends PipelineOp
IPredicate
s (access paths reading on on relations),
shared variables (which identify joins), and IConstraint
s (which may
reject some solutions for those joins). Operators other than standard joins
(including optional joins, sort, order by, etc.) must be handled downstream
from the join graph in a "tail plan".
The JoinGraph
operator works in two phases. On its first invocation,
it constructs a join graph
and identifies a join path having a
low cost join ordering. This join path is converted into a query plan and set
as the JoinGraph.Attributes.QUERY_PLAN
attribute on the IRunningQuery
.
The upstream solutions are then flooded into sub-query that executes the
chosen query plan. The solutions from the sub-query are simply copied to the
output sink of the JoinGraph
operator. Once the query plan has been
identified by the first invocation, subsequent invocations of this operator
simply push more data into the sub-query using the pre-identified query plan.
TODO This approach amounts to bottom-up evaluation of the JGraph
.
Thus, the RTO is not using information from the upstream query when it
decides on a query plan. Therefore, we could lift-out the RTO sections of the
query into named subqueries, run them first in parallel, and then INCLUDE
their results into the main query. This would require an AST optimizer to
modify the AST. (Currently the RTO is integrated when the query plan is
generated in AST2BOpUtility
rather than as an AST optimizer.)
http://arxiv.org/PS_cache/arxiv/pdf/0810/0810.4809v1.pdf, XQuery Join
Graph Isolation.
,
JGraph
,
Serialized FormModifier and Type | Class and Description |
---|---|
static interface |
JoinGraph.Annotations
Known annotations.
|
static interface |
JoinGraph.Attributes
IQueryAttributes names for the JoinGraph . |
DEFAULT_INITIAL_CAPACITY
Constructor and Description |
---|
JoinGraph(BOp[] args,
Map<String,Object> anns) |
JoinGraph(BOp[] args,
NV... anns) |
JoinGraph(JoinGraph op)
Deep copy constructor.
|
Modifier and Type | Method and Description |
---|---|
FutureTask<Void> |
eval(BOpContext<IBindingSet> context)
Return a
FutureTask which computes the operator against the
evaluation context. |
IConstraint[] |
getConstraints() |
Set<IVariable<?>> |
getDoneSet()
Return the set of variables that are known to have already been
materialized at the point in the overall query plan where the RTO is
being executed.
|
int |
getLimit() |
int |
getNEdges() |
Path |
getPath(IRunningQuery q)
Return the computed join path.
|
PipelineOp |
getQueryPlan(IRunningQuery q)
Return the query plan to be executed based on the RTO determined join
ordering.
|
Map<PathIds,EdgeSample> |
getSamples(IRunningQuery q)
Return the samples associated with the computed join path.
|
SampleIndex.SampleType |
getSampleType() |
IPredicate<?>[] |
getVertices() |
assertAtOnceJavaHeapOp, assertMaxParallelOne, getChunkCapacity, getChunkOfChunksCapacity, getChunkTimeout, getMaxMemory, getMaxParallel, isAtOnceEvaluation, isBlockedEvaluation, isLastPassRequested, isPipelinedEvaluation, isReorderSolutions, isSharedState, newStats
__replaceArg, _clearProperty, _set, _setProperty, annotations, annotationsCopy, annotationsEqual, annotationsRef, argIterator, args, argsCopy, arity, clearAnnotations, clearProperty, deepCopy, deepCopy, get, getProperty, setArg, setProperty, setUnboundProperty, toArray, toArray
annotationsEqual, annotationsToString, annotationsToString, annotationValueToString, checkArgs, clone, equals, getEvaluationContext, getId, getProperty, getRequiredProperty, hashCode, indent, isController, mutation, shortenName, toShortString, toString, toString
public JoinGraph(JoinGraph op)
op
- public IPredicate<?>[] getVertices()
JoinGraph.Annotations.VERTICES
public IConstraint[] getConstraints()
JoinGraph.Annotations.CONSTRAINTS
public int getLimit()
JoinGraph.Annotations.LIMIT
public int getNEdges()
JoinGraph.Annotations.NEDGES
public SampleIndex.SampleType getSampleType()
JoinGraph.Annotations.SAMPLE_TYPE
public Set<IVariable<?>> getDoneSet()
JoinGraph.Annotations.DONE_SET
public Path getPath(IRunningQuery q)
JoinGraph.Attributes.PATH
public Map<PathIds,EdgeSample> getSamples(IRunningQuery q)
Annotations#SAMPLES
public PipelineOp getQueryPlan(IRunningQuery q)
JoinGraph.Attributes.QUERY_PLAN
public FutureTask<Void> eval(BOpContext<IBindingSet> context)
PipelineOp
FutureTask
which computes the operator against the
evaluation context. The caller is responsible for executing the
FutureTask
(this gives them the ability to hook the completion of
the computation).eval
in class PipelineOp
context
- The evaluation context.FutureTask
which will compute the operator's
evaluation.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.