pub struct PathKeys {
pub keys: Vec<PathKey>,
}Expand description
A list of pathkeys describing a plan operator’s output
order. The order is lexicographic: keys[0] is the primary
sort key, keys[1] breaks ties, etc.
Fields§
§keys: Vec<PathKey>Implementations§
Source§impl PathKeys
impl PathKeys
Sourcepub fn is_unordered(&self) -> bool
pub fn is_unordered(&self) -> bool
True when the operator emits rows with no guaranteed order. Consumers that need a specific order must add a Sort node above.
Sourcepub fn prefix_match(&self, required: &PathKeys) -> usize
pub fn prefix_match(&self, required: &PathKeys) -> usize
Returns the number of leading pathkeys that match
required. Used by the planner to decide whether to
emit an incremental sort: if prefix_match returns
≥ 1, the input already satisfies a prefix of the
required order and an incremental sort is cheaper
than a full sort.
Example:
-
self:
[a ASC, b ASC] -
required:
[a ASC, b ASC, c DESC] -
returns:
2 -
self:
[a ASC] -
required:
[b ASC, a ASC] -
returns:
0(prefix doesn’t match)
Sourcepub fn satisfies(&self, required: &PathKeys) -> bool
pub fn satisfies(&self, required: &PathKeys) -> bool
True when self fully satisfies required — i.e.
self.prefix_match(required) == required.keys.len()
AND self has at least as many keys as required.
Callers use this to decide whether a Sort node can be
elided entirely.
Sourcepub fn appended(&self, key: PathKey) -> Self
pub fn appended(&self, key: PathKey) -> Self
Append a pathkey, returning a new PathKeys with one
more column at the end. Used by the planner when
composing pathkeys from an index scan + a tiebreaker.
Trait Implementations§
impl Eq for PathKeys
impl StructuralPartialEq for PathKeys
Auto Trait Implementations§
impl Freeze for PathKeys
impl RefUnwindSafe for PathKeys
impl Send for PathKeys
impl Sync for PathKeys
impl Unpin for PathKeys
impl UnsafeUnpin for PathKeys
impl UnwindSafe for PathKeys
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request