pub struct IndexAwareTopK<T, F>{ /* private fields */ }Expand description
Top-K with index awareness
When the index only partially matches the ORDER BY (e.g., index on col1 but ORDER BY col1, col2), we can still use the index for the first column and apply top-K for the rest.
Implementations§
Source§impl<T, F> IndexAwareTopK<T, F>
impl<T, F> IndexAwareTopK<T, F>
Sourcepub fn push(&mut self, item: T, same_index_key_as_previous: bool)
pub fn push(&mut self, item: T, same_index_key_as_previous: bool)
Process an item from an index-ordered scan
Items must be provided in index order. When the index key changes, the previous batch is finalized.
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Check if we have enough results
Sourcepub fn into_result(self) -> Vec<T>
pub fn into_result(self) -> Vec<T>
Drain into final result
Auto Trait Implementations§
impl<T, F> Freeze for IndexAwareTopK<T, F>where
F: Freeze,
impl<T, F> RefUnwindSafe for IndexAwareTopK<T, F>where
F: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, F> Send for IndexAwareTopK<T, F>
impl<T, F> Sync for IndexAwareTopK<T, F>
impl<T, F> Unpin for IndexAwareTopK<T, F>
impl<T, F> UnwindSafe for IndexAwareTopK<T, F>where
F: UnwindSafe,
T: UnwindSafe,
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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 more