Compiled

Struct Compiled 

Source
pub struct Compiled {
    pub fields: Vec<Field>,
    pub projected: bool,
    pub residual: Vec<Expr>,
    /* private fields */
}
Expand description

A select’s relational half, compiled and ready to run.

Fields§

§fields: Vec<Field>

What the rows this produces are called, in order.

§projected: bool

Whether those rows are already the select list’s answer.

True for a group by and for a distinct, because the operator that produced them was compiled from that list — the projection happened inside the plan. False for a plain join, whose rows carry every column of every table so that a where or an order by can name one the select list does not.

§residual: Vec<Expr>

The where terms this did not apply, for the caller to apply to the rows.

A term that names one table is pushed into that table’s scan. One that spans two tables cannot be, and is left here — except an equality between two columns, which is a join condition written in the where and is moved into the on it means.

Implementations§

Source§

impl Compiled

Source

pub fn plan(&self) -> &Plan

The plan this query compiles to — what beck explain prints, and what a gate reads.

Source

pub fn run( &self, schema: &Schema, rows: &dyn Rows, ) -> Result<Vec<Vec<Cell>>, SqlError>

Read the tables, run the plan, and answer with the rows.

Source

pub fn run_measured( &self, schema: &Schema, rows: &dyn Rows, ) -> Result<(Vec<Vec<Cell>>, Work), SqlError>

The same, and what the engine did to produce it.

crate::engine::Work counts applications, entries touched and operators recomputed, so a gate can say “answering this join did not reconsider every pair” without a clock in it — which is what scaling.rs asserts about a program’s loops and now asserts about a query’s.

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<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, 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.