public class PlanCache
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) java.util.HashMap<java.util.Set<LogicalJoinNode>,java.lang.Integer> |
bestCardinalities |
(package private) java.util.HashMap<java.util.Set<LogicalJoinNode>,java.lang.Double> |
bestCosts |
(package private) java.util.HashMap<java.util.Set<LogicalJoinNode>,java.util.Vector<LogicalJoinNode>> |
bestOrders |
Constructor and Description |
---|
PlanCache() |
Modifier and Type | Method and Description |
---|---|
(package private) void |
addPlan(java.util.Set<LogicalJoinNode> s,
double cost,
int card,
java.util.Vector<LogicalJoinNode> order)
Add a new cost, cardinality and ordering for a particular join set.
|
(package private) int |
getCard(java.util.Set<LogicalJoinNode> s)
Find the cardinality of the best join order in the cache for the specified plan
|
(package private) double |
getCost(java.util.Set<LogicalJoinNode> s)
Find the cost of the best join order in the cache for the specified plan
|
(package private) java.util.Vector<LogicalJoinNode> |
getOrder(java.util.Set<LogicalJoinNode> s)
Find the best join order in the cache for the specified plan
|
java.util.HashMap<java.util.Set<LogicalJoinNode>,java.util.Vector<LogicalJoinNode>> bestOrders
java.util.HashMap<java.util.Set<LogicalJoinNode>,java.lang.Double> bestCosts
java.util.HashMap<java.util.Set<LogicalJoinNode>,java.lang.Integer> bestCardinalities
void addPlan(java.util.Set<LogicalJoinNode> s, double cost, int card, java.util.Vector<LogicalJoinNode> order)
s
- the set of joins for which a new ordering (plan) is being addedcost
- the estimated cost of the specified plancard
- the estimatied cardinality of the specified planorder
- the ordering of the joins in the planjava.util.Vector<LogicalJoinNode> getOrder(java.util.Set<LogicalJoinNode> s)
s
- the set of joins to look up the best order fordouble getCost(java.util.Set<LogicalJoinNode> s)
s
- the set of joins to look up the best cost forint getCard(java.util.Set<LogicalJoinNode> s)
s
- the set of joins to look up the best cardinality for