Class NewCalculateCostUtil
- java.lang.Object
-
- org.teiid.query.optimizer.relational.rules.NewCalculateCostUtil
-
public class NewCalculateCostUtil extends Object
- Since:
- 4.3
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NewCalculateCostUtil.DependentCostAnalysis
-
Field Summary
Fields Modifier and Type Field Description static int
UNKNOWN_JOIN_SCALING
static float
UNKNOWN_VALUE
-
Constructor Summary
Constructors Constructor Description NewCalculateCostUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static NewCalculateCostUtil.DependentCostAnalysis
computeCostForDepJoin(PlanNode joinNode, boolean leftIndependent, QueryMetadataInterface metadata, CapabilitiesFinder capFinder, CommandContext context)
Computes the cost of a Dependent Join The worst possible cost will arise from a high independent ndv (many dependent sets) and a low dependent ndv (possibly many matches per set) This logic uses the same assumption as criteria in that ndv is used as a divisor of cardinality.static NewCalculateCostUtil.DependentCostAnalysis
computeCostForDepJoin(PlanNode independentNode, PlanNode dependentNode, List independentExpressions, List dependentExpressions, QueryMetadataInterface metadata, CapabilitiesFinder capFinder, CommandContext context)
static Object
getKeyUsed(Collection<? extends Expression> allElements, Set<GroupSymbol> groups, QueryMetadataInterface metadata, Boolean unique)
static boolean
usesKey(Collection<? extends Expression> allElements, Set<GroupSymbol> groups, QueryMetadataInterface metadata, boolean unique)
static boolean
usesKey(Collection<? extends Expression> allElements, QueryMetadataInterface metadata)
TODO: this uses key check is not really accurate, it doesn't take into consideration where we are in the plan.static boolean
usesKey(Criteria crit, QueryMetadataInterface metadata)
-
-
-
Field Detail
-
UNKNOWN_JOIN_SCALING
public static final int UNKNOWN_JOIN_SCALING
- See Also:
- Constant Field Values
-
UNKNOWN_VALUE
public static final float UNKNOWN_VALUE
- See Also:
- Constant Field Values
-
-
Method Detail
-
usesKey
public static boolean usesKey(Criteria crit, QueryMetadataInterface metadata) throws QueryMetadataException, TeiidComponentException
-
usesKey
public static boolean usesKey(Collection<? extends Expression> allElements, QueryMetadataInterface metadata) throws QueryMetadataException, TeiidComponentException
TODO: this uses key check is not really accurate, it doesn't take into consideration where we are in the plan. if a key column is used after a non 1-1 join or a union all, then it may be non-unique.
-
usesKey
public static boolean usesKey(Collection<? extends Expression> allElements, Set<GroupSymbol> groups, QueryMetadataInterface metadata, boolean unique) throws QueryMetadataException, TeiidComponentException
-
getKeyUsed
public static Object getKeyUsed(Collection<? extends Expression> allElements, Set<GroupSymbol> groups, QueryMetadataInterface metadata, Boolean unique) throws QueryMetadataException, TeiidComponentException
-
computeCostForDepJoin
public static NewCalculateCostUtil.DependentCostAnalysis computeCostForDepJoin(PlanNode joinNode, boolean leftIndependent, QueryMetadataInterface metadata, CapabilitiesFinder capFinder, CommandContext context) throws TeiidComponentException, QueryMetadataException, QueryPlannerException
Computes the cost of a Dependent Join The worst possible cost will arise from a high independent ndv (many dependent sets) and a low dependent ndv (possibly many matches per set) This logic uses the same assumption as criteria in that ndv is used as a divisor of cardinality.
-
computeCostForDepJoin
public static NewCalculateCostUtil.DependentCostAnalysis computeCostForDepJoin(PlanNode independentNode, PlanNode dependentNode, List independentExpressions, List dependentExpressions, QueryMetadataInterface metadata, CapabilitiesFinder capFinder, CommandContext context) throws QueryMetadataException, TeiidComponentException, QueryPlannerException
-
-