Skip to main content

SelectExecutor

Struct SelectExecutor 

Source
pub struct SelectExecutor { /* private fields */ }
Expand description

SELECT query executor for SSTable-based storage

Implementations§

Source§

impl SelectExecutor

Source

pub fn new(schema: Arc<SchemaManager>, storage: Arc<StorageEngine>) -> Self

Create a new SELECT executor

Source

pub async fn execute(&self, plan: OptimizedQueryPlan) -> Result<QueryResult>

Execute an optimized query plan

Source

pub async fn execute_streaming( &self, plan: OptimizedQueryPlan, config: StreamingConfig, ) -> Result<QueryResultIterator>

Execute an optimized query plan with streaming results (Issue #280)

Instead of materializing all rows in memory, this method returns a QueryResultIterator that yields rows incrementally via a bounded channel. This enables memory-efficient processing of large result sets.

§Memory Budget

With default StreamingConfig::buffer_size of 1024 rows and ~1KB avg row size:

  • Channel buffer: ~1MB in flight
  • Background task: minimal overhead
  • Total streaming overhead: ~1-2MB (well within 128MB target)
§Limitations

Currently supports:

  • SSTableScan with predicates (streaming)
  • Filter/Limit/Project (applied during scan)

LIMIT (and OFFSET, when present in the plan) is enforced by the streaming producer (execute_streaming_background): it skips OFFSET matches and stops scanning once count rows have been sent, so a LIMIT N query yields exactly N rows without materializing the rest (Issue #581).

For ORDER BY/GROUP BY/DISTINCT, falls back to full execution then streams results.

Trait Implementations§

Source§

impl Debug for SelectExecutor

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.