execute_query

Function execute_query 

Source
pub fn execute_query<'txn, S: KVStore + 'txn, C: Catalog, T: SqlTxn<'txn, S>>(
    txn: &mut T,
    catalog: &C,
    plan: LogicalPlan,
) -> Result<ExecutionResult>
Expand description

Execute a SELECT logical plan and return a query result.

This function uses an iterator-based execution model that processes rows through a pipeline of operators. This approach:

  • Enables early termination for LIMIT queries
  • Provides streaming execution after the initial scan
  • Allows composable query operators

Note: The Scan stage reads all matching rows into memory, but subsequent operators (Filter, Sort, Limit) process rows through an iterator pipeline. Sort operations additionally require materializing all input rows.