pub struct QueryPlan {
pub analyzed_output: Option<RowSchema>,
pub analyzed_source: Option<Arc<AnalyzedSource>>,
pub analyzed_grouping: Option<AnalyzedGroupingSets>,
pub relations_bound: bool,
pub relation_privilege_subject: Option<RoleReference>,
pub ctes: Vec<CtePlan>,
pub root: RelationalPlan,
}Expand description
A relational query with its CTE scope and one relational root.
Fields§
§analyzed_output: Option<RowSchema>Positional output metadata from this statement’s analysis. Stored syntax must be analyzed in its next catalog scope instead of retaining these descriptors.
analyzed_source: Option<Arc<AnalyzedSource>>Already-analyzed input layouts, consumed before any optimizer rewrite changes source topology. Stored syntax never retains them.
analyzed_grouping: Option<AnalyzedGroupingSets>Grouping-set equality established before scalar optimization. Stored SQL retains its original grouping syntax.
relations_bound: boolWhether relation references in this tree are stored catalog identities rather than names that must be resolved in the executing session.
relation_privilege_subject: Option<RoleReference>Relation authorization retained when a rewritten query is nested beneath another statement’s owner. SQL-visible identity and function privileges remain the invoking session’s.
ctes: Vec<CtePlan>§root: RelationalPlanImplementations§
Source§impl QueryPlan
impl QueryPlan
Sourcepub fn clone_with_control(
&self,
control: &ProductionControl<'_>,
) -> Result<Produced<Self>, SQLError>
pub fn clone_with_control( &self, control: &ProductionControl<'_>, ) -> Result<Produced<Self>, SQLError>
Copy a relational executable and its query/mutation CTEs, admitting destination capacities and owned payloads before allocation. Immutable analysis descriptors and retained row/literal identities remain shared.
Source§impl QueryPlan
impl QueryPlan
Sourcepub fn rewrite_scalar_expressions(
&mut self,
rewrite: &mut dyn FnMut(&mut ScalarExpr),
)
pub fn rewrite_scalar_expressions( &mut self, rewrite: &mut dyn FnMut(&mut ScalarExpr), )
Rewrite every physical scalar node owned by this query exactly once, including CTEs, relational sources, and scalar-subquery plans.
Sourcepub fn visit_sources_mut(&mut self, visit: &mut dyn FnMut(&mut SourcePlan))
pub fn visit_sources_mut(&mut self, visit: &mut dyn FnMut(&mut SourcePlan))
Visit every FROM item this query owns, including those of nested queries.
pub fn lower(statement: SelectStmt) -> Self
pub fn lower_with( statement: SelectStmt, aggregates: &dyn AggregateClassifier, ) -> Self
Source§impl QueryPlan
impl QueryPlan
pub fn visit_sources(&self, visit: &mut dyn FnMut(&SourcePlan))
Source§impl QueryPlan
impl QueryPlan
Sourcepub fn visit_scalar_expressions(&self, visit: &mut dyn FnMut(&ScalarExpr))
pub fn visit_scalar_expressions(&self, visit: &mut dyn FnMut(&ScalarExpr))
Visit every scalar expression this query owns, each root once, including those of its CTEs, relational sources and scalar subqueries.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for QueryPlan
impl<'de> Deserialize<'de> for QueryPlan
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl !RefUnwindSafe for QueryPlan
impl !UnwindSafe for QueryPlan
impl Freeze for QueryPlan
impl Send for QueryPlan
impl Sync for QueryPlan
impl Unpin for QueryPlan
impl UnsafeUnpin for QueryPlan
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more