public class Memo extends Object
Each node in a plan is placed in a group, and it's children are replaced with symbolic references to the corresponding groups.
For example, a plan like:
A -> B -> C -> D
\> E -> F
would be stored as:
root: G0
G0 : { A -> G1 }
G1 : { B -> [G2, G3] }
G2 : { C -> G4 }
G3 : { E -> G5 }
G4 : { D }
G5 : { F }
Groups are reference-counted, and groups that become unreachable from the root
due to mutations in a subtree get garbage-collected.| Constructor and Description |
|---|
Memo(PlanNodeIdAllocator idAllocator,
PlanNode plan) |
| Modifier and Type | Method and Description |
|---|---|
PlanNode |
extract() |
Optional<PlanCostEstimate> |
getCost(int group) |
int |
getGroupCount() |
PlanNode |
getNode(int group) |
int |
getRootGroup() |
Optional<PlanNodeStatsEstimate> |
getStats(int group) |
PlanNode |
replace(int group,
PlanNode node,
String reason) |
PlanNode |
resolve(GroupReference groupReference) |
void |
storeCost(int group,
PlanCostEstimate cost) |
void |
storeStats(int groupId,
PlanNodeStatsEstimate stats) |
public Memo(PlanNodeIdAllocator idAllocator, PlanNode plan)
public int getRootGroup()
public PlanNode getNode(int group)
public PlanNode resolve(GroupReference groupReference)
public PlanNode extract()
public Optional<PlanNodeStatsEstimate> getStats(int group)
public void storeStats(int groupId,
PlanNodeStatsEstimate stats)
public Optional<PlanCostEstimate> getCost(int group)
public void storeCost(int group,
PlanCostEstimate cost)
public int getGroupCount()
Copyright © 2012–2019. All rights reserved.