pub type OrderingEquivalentClass = EquivalentClass<LexOrdering>;
Expand description

LexOrdering stores the lexicographical ordering for a schema. OrderingEquivalentClass keeps track of different alternative orderings than can describe the schema. For instance, for the table below |a|b|c|d| |1|4|3|1| |2|3|3|2| |3|1|2|2| |3|2|1|3| both vec![a ASC, b ASC] and vec![c DESC, d ASC] describe the ordering of the table. For this case, we say that vec![a ASC, b ASC], and vec![c DESC, d ASC] are ordering equivalent.

Aliased Type§

struct OrderingEquivalentClass { /* private fields */ }

Implementations§

source§

impl OrderingEquivalentClass

source

pub fn add_offset(&self, offset: usize) -> Result<OrderingEquivalentClass>

Adds offset value to the index of each expression inside self.head and self.others.

source

pub fn normalize_with_equivalence_properties( &self, eq_properties: &EquivalenceProperties ) -> OrderingEquivalentClass

This function normalizes OrderingEquivalenceProperties according to eq_properties. More explicitly, it makes sure that expressions in oeq_class are head entries in eq_properties, replacing any non-head entries with head entries if necessary.

source

pub fn prefix_ordering_equivalent_class_with_existing_ordering( &self, existing_ordering: &[PhysicalSortExpr], eq_properties: &EquivalenceProperties ) -> OrderingEquivalentClass

Prefix with existing ordering.