pub struct QueryPlan {
pub nodes: HashMap<String, QueryNode>,
pub roots: Vec<String>,
pub execution_phases: Vec<Vec<String>>,
pub max_depth: usize,
pub total_estimated_rows: usize,
pub metadata: HashMap<String, Value>,
}Expand description
Query execution plan for optimized loading
Fields§
§nodes: HashMap<String, QueryNode>All nodes in the plan, keyed by ID
roots: Vec<String>Root node IDs (entry points)
execution_phases: Vec<Vec<String>>Execution phases (nodes that can run in parallel)
max_depth: usizeMaximum depth of the plan
total_estimated_rows: usizeTotal estimated rows
metadata: HashMap<String, Value>Plan metadata
Implementations§
Source§impl QueryPlan
impl QueryPlan
Sourcepub fn build_execution_phases(&mut self) -> OrmResult<()>
pub fn build_execution_phases(&mut self) -> OrmResult<()>
Build execution phases (groups of nodes that can run in parallel)
Sourcepub fn nodes_at_depth(&self, depth: usize) -> Vec<&QueryNode>
pub fn nodes_at_depth(&self, depth: usize) -> Vec<&QueryNode>
Get nodes at a specific depth
Sourcepub fn leaf_nodes(&self) -> Vec<&QueryNode>
pub fn leaf_nodes(&self) -> Vec<&QueryNode>
Get all leaf nodes
Sourcepub fn complexity_score(&self) -> f64
pub fn complexity_score(&self) -> f64
Calculate plan complexity score
Sourcepub fn add_metadata(&mut self, key: String, value: Value)
pub fn add_metadata(&mut self, key: String, value: Value)
Add metadata to the plan
Sourcepub fn statistics(&self) -> PlanStatistics
pub fn statistics(&self) -> PlanStatistics
Get plan statistics
Trait Implementations§
Auto Trait Implementations§
impl Freeze for QueryPlan
impl RefUnwindSafe for QueryPlan
impl Send for QueryPlan
impl Sync for QueryPlan
impl Unpin for QueryPlan
impl UnwindSafe 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
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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