public class JoinGraph extends PipelineOp
IPredicates (access paths reading on on relations),
shared variables (which identify joins), and IConstraints (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 Form| Modifier 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, toArrayannotationsEqual, annotationsToString, annotationsToString, annotationValueToString, checkArgs, clone, equals, getEvaluationContext, getId, getProperty, getRequiredProperty, hashCode, indent, isController, mutation, shortenName, toShortString, toString, toStringpublic JoinGraph(JoinGraph op)
op - public IPredicate<?>[] getVertices()
JoinGraph.Annotations.VERTICESpublic IConstraint[] getConstraints()
JoinGraph.Annotations.CONSTRAINTSpublic int getLimit()
JoinGraph.Annotations.LIMITpublic int getNEdges()
JoinGraph.Annotations.NEDGESpublic SampleIndex.SampleType getSampleType()
JoinGraph.Annotations.SAMPLE_TYPEpublic Set<IVariable<?>> getDoneSet()
JoinGraph.Annotations.DONE_SETpublic Path getPath(IRunningQuery q)
JoinGraph.Attributes.PATHpublic Map<PathIds,EdgeSample> getSamples(IRunningQuery q)
Annotations#SAMPLESpublic PipelineOp getQueryPlan(IRunningQuery q)
JoinGraph.Attributes.QUERY_PLANpublic FutureTask<Void> eval(BOpContext<IBindingSet> context)
PipelineOpFutureTask 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 PipelineOpcontext - The evaluation context.FutureTask which will compute the operator's
evaluation.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.