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: boolWhether 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
impl Compiled
Sourcepub fn plan(&self) -> &Plan
pub fn plan(&self) -> &Plan
The plan this query compiles to — what beck explain prints, and what a gate reads.
Sourcepub fn run(
&self,
schema: &Schema,
rows: &dyn Rows,
) -> Result<Vec<Vec<Cell>>, SqlError>
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.
Sourcepub fn run_measured(
&self,
schema: &Schema,
rows: &dyn Rows,
) -> Result<(Vec<Vec<Cell>>, Work), SqlError>
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.