pub struct Reducer {
pub leaves: Vec<Leaf>,
pub classes: u32,
pub extremes: Vec<Extreme>,
}Expand description
The relations of one consistent node and the join tree over them.
Fields§
§leaves: Vec<Leaf>One per relation, children before parents.
classes: u32How many classes of join columns there are, numbered from zero.
extremes: Vec<Extreme>One per produced column, in the order the node produces them.
Implementations§
Source§impl Reducer
impl Reducer
Sourcepub fn children(&self, leaf: u32) -> impl Iterator<Item = (u32, u32)> + '_
pub fn children(&self, leaf: u32) -> impl Iterator<Item = (u32, u32)> + '_
The relations directly under leaf, each with the class it shares with leaf.
Sourcepub fn key(&self, leaf: u32, class: u32) -> Option<u32>
pub fn key(&self, leaf: u32, class: u32) -> Option<u32>
The column of leaf that is in class, if it has one.
Sourcepub fn wanted(&self, leaf: u32) -> bool
pub fn wanted(&self, leaf: u32) -> bool
Whether some extreme is read from leaf or from a relation under it.
The second sweep only has to reach the relations an extreme is read from, and a relation with no extreme anywhere under it is one the second sweep can leave alone: nothing that is read later depends on which of its rows survive it.
Sourcepub fn held(&self, leaf: u32) -> bool
pub fn held(&self, leaf: u32) -> bool
Whether the rows of leaf have to be held until the second sweep reaches it.
A root is reduced completely by the first sweep alone, since everything in its tree is under it, so its extremes and the keys it hands down are read off its rows as they are scanned. Every other relation the second sweep reaches has to keep its rows until its parent has been reduced, and that is the memory this node spends.
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Checks the promises the executor relies on.
A parent after its child, a class that both ends of an edge hold a column of, a class number that is in range and an extreme that names a relation there is. Each of these broken is a sweep that reads the wrong column or waits for a set that is built after it is needed, which is a wrong answer rather than an error, so it is checked where the plan is.
§Errors
Naming the relation that broke one.