pub struct LogicalPlan {
pub root: PlanNode,
pub projection: Vec<Variable>,
/* private fields */
}Expand description
A SELECT reduced to a plan tree and a projection list.
Fields§
§root: PlanNodeRoot of the physical plan tree.
projection: Vec<Variable>Variables the query projects, in SELECT order.
Implementations§
Source§impl LogicalPlan
impl LogicalPlan
Sourcepub fn explain(
sparql: &str,
format: ExplainFormat,
pretty: bool,
profile: Option<&StatsProfile>,
) -> Result<String, ComputeError>
pub fn explain( sparql: &str, format: ExplainFormat, pretty: bool, profile: Option<&StatsProfile>, ) -> Result<String, ComputeError>
Format a SPARQL query at the requested EXPLAIN level.
pretty indents S-expression and *-sparql formats.
Sourcepub fn explain_with(
sparql: &str,
format: ExplainFormat,
pretty: bool,
profile: Option<&StatsProfile>,
options: &ExplainOptions,
) -> Result<String, ComputeError>
pub fn explain_with( sparql: &str, format: ExplainFormat, pretty: bool, profile: Option<&StatsProfile>, options: &ExplainOptions, ) -> Result<String, ComputeError>
Self::explain with protocol / --default-union dataset knobs.
Sourcepub fn explain_with_context(
sparql: &str,
format: ExplainFormat,
pretty: bool,
profile: Option<&StatsProfile>,
base_ctx: &QueryContext,
options: &ExplainOptions,
) -> Result<String, ComputeError>
pub fn explain_with_context( sparql: &str, format: ExplainFormat, pretty: bool, profile: Option<&StatsProfile>, base_ctx: &QueryContext, options: &ExplainOptions, ) -> Result<String, ComputeError>
Self::explain_with planning on an already-built engine context.
The §7b delivery invariant: index epochs and the tick histogram ride the context into the planner. Serving surfaces that own an engine must pass its context here; rebuilding one from (snapshot, dataset) alone silently degrades every temporal comparison rewrite to the unindexed residual — execution stays correct, EXPLAIN plans lie.
Source§impl LogicalPlan
impl LogicalPlan
Sourcepub fn parse(sparql: &str) -> Result<Self, ComputeError>
pub fn parse(sparql: &str) -> Result<Self, ComputeError>
Parse and plan a SPARQL SELECT query without a stats profile.
Sourcepub fn parse_with_context(
sparql: &str,
ctx: &QueryContext,
) -> Result<Self, ComputeError>
pub fn parse_with_context( sparql: &str, ctx: &QueryContext, ) -> Result<Self, ComputeError>
Parse and plan with a caller-supplied query context (the plugin
rewrite hooks see it — index epochs, rolled-up histogram). The
dataset still resolves from the query text’s FROM clauses.
Sourcepub fn parse_with_profile(
sparql: &str,
profile: Option<&StatsProfile>,
) -> Result<Self, ComputeError>
pub fn parse_with_profile( sparql: &str, profile: Option<&StatsProfile>, ) -> Result<Self, ComputeError>
Parse and plan, optionally reordering from a local StatsProfile.
Sourcepub fn from_algebra(
pattern: GraphPattern,
profile: Option<&StatsProfile>,
) -> Result<Self, ComputeError>
pub fn from_algebra( pattern: GraphPattern, profile: Option<&StatsProfile>, ) -> Result<Self, ComputeError>
Lower a spargebra WHERE/Project algebra (CONSTRUCT / DESCRIBE / SELECT / ASK).
pattern is the query body after spargebra wrapping (Project, optional
outer Slice). Dataset clauses are taken from ctx.dataset().
Sourcepub fn from_ask_algebra(
pattern: GraphPattern,
profile: Option<&StatsProfile>,
) -> Result<Self, ComputeError>
pub fn from_ask_algebra( pattern: GraphPattern, profile: Option<&StatsProfile>, ) -> Result<Self, ComputeError>
Lower a SPARQL ASK graph pattern: cap the outer slice at LIMIT 1.
ASK { SELECT ... } is a SubSelect under ASK’s implicit SELECT *.
Extra top-level Project nodes are peeled so the inner query is the
ASK body. Nested SELECT in a SELECT WHERE is unchanged.
Sourcepub fn depends_on_eager_scan_filter(&self) -> bool
pub fn depends_on_eager_scan_filter(&self) -> bool
Whether planning removed exact FILTER conjuncts into scan eager
comparisons. When it did, this plan’s answers depend on the eager
scan filter running, so it cannot be executed with a context that
disables it.
Self::parse_with_context plans under the caller’s context: a
context with the filter off keeps every conjunct in the plan, and the
returned plan answers correctly under that same context.
Trait Implementations§
Source§impl Clone for LogicalPlan
impl Clone for LogicalPlan
Source§fn clone(&self) -> LogicalPlan
fn clone(&self) -> LogicalPlan
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LogicalPlan
impl Debug for LogicalPlan
Source§impl PartialEq for LogicalPlan
impl PartialEq for LogicalPlan
impl StructuralPartialEq for LogicalPlan
Auto Trait Implementations§
impl Freeze for LogicalPlan
impl !RefUnwindSafe for LogicalPlan
impl Send for LogicalPlan
impl Sync for LogicalPlan
impl Unpin for LogicalPlan
impl UnsafeUnpin for LogicalPlan
impl !UnwindSafe for LogicalPlan
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> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].