Trait tidb_query_executors::interface::BatchExecutor[][src]

pub trait BatchExecutor: Send {
    type StorageStats;
    fn schema(&self) -> &[FieldType];
fn next_batch(&mut self, scan_rows: usize) -> BatchExecuteResult;
fn collect_exec_stats(&mut self, dest: &mut ExecuteStats);
fn collect_storage_stats(&mut self, dest: &mut Self::StorageStats);
fn take_scanned_range(&mut self) -> IntervalRange;
fn can_be_cached(&self) -> bool; fn collect_summary(
        self,
        output_index: usize
    ) -> WithSummaryCollector<ExecSummaryCollectorEnabled, Self>
    where
        Self: Sized
, { ... } }
[]

The interface for pull-based executors. It is similar to the Volcano Iterator model, but pulls data in batch and stores data by column.

Associated Types

type StorageStats[src]

Required methods

fn schema(&self) -> &[FieldType][src][]

Gets the schema of the output.

fn next_batch(&mut self, scan_rows: usize) -> BatchExecuteResult[src][]

Pulls next several rows of data (stored by column).

This function might return zero rows, which doesn’t mean that there is no more result. See is_drained in BatchExecuteResult.

fn collect_exec_stats(&mut self, dest: &mut ExecuteStats)[src][]

Collects execution statistics (including but not limited to metrics and execution summaries) accumulated during execution and prepares for next collection.

The executor implementation must invoke this function for each children executor. However the invocation order of children executors is not stipulated.

This function may be invoked several times during execution. For each invocation, it should not contain accumulated meta data in last invocation. Normally the invocation frequency of this function is less than next_batch().

fn collect_storage_stats(&mut self, dest: &mut Self::StorageStats)[src][]

Collects underlying storage statistics accumulated during execution and prepares for next collection.

Similar to collect_exec_stats(), the implementation must invoke this function for each children executor and this function may be invoked several times during execution.

fn take_scanned_range(&mut self) -> IntervalRange[src]

fn can_be_cached(&self) -> bool[src]

Provided methods

fn collect_summary(
    self,
    output_index: usize
) -> WithSummaryCollector<ExecSummaryCollectorEnabled, Self> where
    Self: Sized
[src]

Implementations on Foreign Types

impl<T: BatchExecutor + ?Sized> BatchExecutor for Box<T>[src][]

type StorageStats = T::StorageStats

Implementors

impl<C: ExecSummaryCollector + Send, T: BatchExecutor> BatchExecutor for WithSummaryCollector<C, T>[src][+]

impl<S: Storage> BatchExecutor for BatchIndexScanExecutor<S>[src][+]

impl<S: Storage> BatchExecutor for BatchTableScanExecutor<S>[src][+]

impl<S: Storage, I: ScanExecutorImpl> BatchExecutor for ScanExecutor<S, I>[src][+]

impl<Src: BatchExecutor> BatchExecutor for BatchFastHashAggregationExecutor<Src>[src][+]

impl<Src: BatchExecutor> BatchExecutor for BatchLimitExecutor<Src>[src][+]

impl<Src: BatchExecutor> BatchExecutor for BatchSelectionExecutor<Src>[src][+]

impl<Src: BatchExecutor> BatchExecutor for BatchSimpleAggregationExecutor<Src>[src][+]

impl<Src: BatchExecutor> BatchExecutor for BatchSlowHashAggregationExecutor<Src>[src][+]

impl<Src: BatchExecutor> BatchExecutor for BatchStreamAggregationExecutor<Src>[src][+]

impl<Src: BatchExecutor> BatchExecutor for BatchTopNExecutor<Src>[src][+]

impl<Src: BatchExecutor, I: AggregationExecutorImpl<Src>> BatchExecutor for AggregationExecutor<Src, I>[src][+]