org.eclipse.rdf4j.query.algebra.evaluation.impl

## Class QueryJoinOptimizer.JoinVisitor

- java.lang.Object
- - org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor<RuntimeException>
  - - org.eclipse.rdf4j.query.algebra.evaluation.impl.QueryJoinOptimizer.JoinVisitor

- All Implemented Interfaces:
    QueryModelVisitor<RuntimeException>
  Enclosing class:
    QueryJoinOptimizer

      protected class QueryJoinOptimizer.JoinVisitor
      extends AbstractQueryModelVisitor<RuntimeException>

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `JoinVisitor()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected List<Var>` | `getConstantVars(Iterable<Var> vars)`
    `protected List<Extension>` | `getExtensions(List<TupleExpr> expressions)`
    `protected int` | `getForeignVarFreq(List<Var> ownUnboundVars, Map<Var,Integer> varFreqMap)`
    `protected <L extends List<TupleExpr>> L` | `getJoinArgs(TupleExpr tupleExpr, L joinArgs)`
    `protected List<Var>` | `getStatementPatternVars(TupleExpr tupleExpr)`
    `protected List<TupleExpr>` | `getSubSelects(List<TupleExpr> expressions)`
    `protected double` | `getTupleExprCardinality(TupleExpr tupleExpr, Map<TupleExpr,Double> cardinalityMap, Map<TupleExpr,List<Var>> varsMap, Map<Var,Integer> varFreqMap, Set<String> boundVars)`
    `protected List<Var>` | `getUnboundVars(Iterable<Var> vars)`
    `protected <M extends Map<Var,Integer>> M` | `getVarFreqMap(List<Var> varList, M varFreqMap)`
    `void` | `meet(Join node)`
    `void` | `meet(LeftJoin leftJoin)`
    `protected List<TupleExpr>` | `reorderSubselects(List<TupleExpr> subselects)` Determines an optimal ordering of subselect join arguments, based on variable bindings.
    `protected TupleExpr` | `selectNextTupleExpr(List<TupleExpr> expressions, Map<TupleExpr,Double> cardinalityMap, Map<TupleExpr,List<Var>> varsMap, Map<Var,Integer> varFreqMap, Set<String> boundVars)` Selects from a list of tuple expressions the next tuple expression that should be evaluated.

    - ### Methods inherited from class org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor

      `meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meetBinaryTupleOperator, meetBinaryValueOperator, meetCompareSubQueryValueOperator, meetNAryValueOperator, meetNode, meetOther, meetSubQueryValueOperator, meetUnaryTupleOperator, meetUnaryValueOperator, meetUpdateExpr`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### JoinVisitor

          protected JoinVisitor()

  - ### Method Detail

    - #### meet

          public void meet(LeftJoin leftJoin)

      Specified by:
        `meet` in interface `QueryModelVisitor<RuntimeException>`
      Overrides:
        `meet` in class `AbstractQueryModelVisitor<RuntimeException>`

    - #### meet

          public void meet(Join node)

      Specified by:
        `meet` in interface `QueryModelVisitor<RuntimeException>`
      Overrides:
        `meet` in class `AbstractQueryModelVisitor<RuntimeException>`

    - #### getJoinArgs

          protected <L extends List<TupleExpr>> L getJoinArgs(TupleExpr tupleExpr,
                                                              L joinArgs)

    - #### getStatementPatternVars

          protected List<Var> getStatementPatternVars(TupleExpr tupleExpr)

    - #### getVarFreqMap

          protected <M extends Map<Var,Integer>> M getVarFreqMap(List<Var> varList,
                                                                 M varFreqMap)

    - #### getExtensions

          protected List<Extension> getExtensions(List<TupleExpr> expressions)

    - #### getSubSelects

          protected List<TupleExpr> getSubSelects(List<TupleExpr> expressions)

    - #### reorderSubselects

          protected List<TupleExpr> reorderSubselects(List<TupleExpr> subselects)

      Determines an optimal ordering of subselect join arguments, based on variable bindings. An ordering is considered optimal if for each consecutive element it holds that first of all its shared variables with all previous elements is maximized, and second, the union of all its variables with all previous elements is maximized.

      Example: reordering

             [f] [a b c] [e f] [a d] [b e]

      should result in:

             [a b c] [a d] [b e] [e f] [f]

      Parameters:
        `subselects` - the original ordering of expressions
      Returns:
        the optimized ordering of expressions

    - #### selectNextTupleExpr

          protected TupleExpr selectNextTupleExpr(List<TupleExpr> expressions,
                                                  Map<TupleExpr,Double> cardinalityMap,
                                                  Map<TupleExpr,List<Var>> varsMap,
                                                  Map<Var,Integer> varFreqMap,
                                                  Set<String> boundVars)

      Selects from a list of tuple expressions the next tuple expression that should be evaluated. This method selects the tuple expression with highest number of bound variables, preferring variables that have been bound in other tuple expressions over variables with a fixed value.

    - #### getTupleExprCardinality

          protected double getTupleExprCardinality(TupleExpr tupleExpr,
                                                   Map<TupleExpr,Double> cardinalityMap,
                                                   Map<TupleExpr,List<Var>> varsMap,
                                                   Map<Var,Integer> varFreqMap,
                                                   Set<String> boundVars)

    - #### getConstantVars

          protected List<Var> getConstantVars(Iterable<Var> vars)

    - #### getUnboundVars

          protected List<Var> getUnboundVars(Iterable<Var> vars)

    - #### getForeignVarFreq

          protected int getForeignVarFreq(List<Var> ownUnboundVars,
                                          Map<Var,Integer> varFreqMap)

Copyright © 2015-2020 Eclipse Foundation. All Rights Reserved.