pub struct ColumnarOrderByValues { /* private fields */ }Expand description
Columnar layout for ORDER BY values - optimized for sorting performance
Instead of Vec<Vec<(Value, bool)>> (row-oriented, N allocations for N rows),
this uses Vec<Vec<Value>> (column-oriented, K allocations for K ORDER BY columns).
Benefits:
- Reduces allocations from O(N) to O(K) where K = number of ORDER BY columns
- Stores ascending flags once per column instead of once per value
- Better cache locality when accessing sort keys across rows
Implementations§
Source§impl ColumnarOrderByValues
impl ColumnarOrderByValues
Sourcepub fn num_columns(&self) -> usize
pub fn num_columns(&self) -> usize
Get number of columns
Sourcepub fn is_ascending(&self, col_idx: usize) -> bool
pub fn is_ascending(&self, col_idx: usize) -> bool
Get ascending flag for column
Sourcepub fn nulls_first(&self, col_idx: usize) -> bool
pub fn nulls_first(&self, col_idx: usize) -> bool
Get resolved NULL placement for column.
Sourcepub fn rows_equal(&self, row_a: usize, row_b: usize) -> bool
pub fn rows_equal(&self, row_a: usize, row_b: usize) -> bool
Compare ORDER BY values of two rows for equality (without cloning) Returns true if all ORDER BY column values are equal
Trait Implementations§
Source§impl Clone for ColumnarOrderByValues
impl Clone for ColumnarOrderByValues
Source§fn clone(&self) -> ColumnarOrderByValues
fn clone(&self) -> ColumnarOrderByValues
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ColumnarOrderByValues
impl RefUnwindSafe for ColumnarOrderByValues
impl Send for ColumnarOrderByValues
impl Sync for ColumnarOrderByValues
impl Unpin for ColumnarOrderByValues
impl UnsafeUnpin for ColumnarOrderByValues
impl UnwindSafe for ColumnarOrderByValues
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