pub struct VectorizedExecutor { /* private fields */ }Expand description
Vectorized executor for batch predicate evaluation
§Performance Characteristics
- Traditional row-at-a-time: ~100M rows/sec (branch misprediction bound)
- Vectorized with selection vector: ~1B rows/sec (branch-free)
§Usage
ⓘ
let executor = VectorizedExecutor::new(1024);
let columns = vec![/* column batches */];
let predicates = vec![/* predicates */];
let selection = executor.evaluate_batch(&columns, &predicates);Implementations§
Source§impl VectorizedExecutor
impl VectorizedExecutor
Sourcepub fn default_batch_size() -> usize
pub fn default_batch_size() -> usize
Default batch size (1024 rows)
Sourcepub fn evaluate_batch(
&self,
columns: &[ColumnBatch],
predicates: &[VectorPredicate],
) -> SelectionVector
pub fn evaluate_batch( &self, columns: &[ColumnBatch], predicates: &[VectorPredicate], ) -> SelectionVector
Evaluate predicates on columnar batch
Returns selection vector of rows that pass all predicates. Short-circuits at batch level when selection becomes empty.
Sourcepub fn materialize(
&self,
columns: &[ColumnBatch],
selection: &SelectionVector,
) -> Vec<SochRow>
pub fn materialize( &self, columns: &[ColumnBatch], selection: &SelectionVector, ) -> Vec<SochRow>
Materialize selected rows from columnar data
Sourcepub fn row_to_columnar(
&self,
rows: &[SochRow],
column_names: &[String],
) -> Vec<ColumnBatch>
pub fn row_to_columnar( &self, rows: &[SochRow], column_names: &[String], ) -> Vec<ColumnBatch>
Convert row-oriented data to columnar batches
Trait Implementations§
Auto Trait Implementations§
impl Freeze for VectorizedExecutor
impl RefUnwindSafe for VectorizedExecutor
impl Send for VectorizedExecutor
impl Sync for VectorizedExecutor
impl Unpin for VectorizedExecutor
impl UnsafeUnpin for VectorizedExecutor
impl UnwindSafe for VectorizedExecutor
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