pub struct CustomOp {
pub plugin_id: &'static str,
pub op_id: &'static str,
pub payload: PluginPayloadBox,
pub children: Vec<PlanNode>,
pub variables: Vec<Variable>,
pub produced_row_count_estimate: u64,
pub cost: Option<CustomOpCost>,
pub pinned: Vec<(Variable, EncodedTerm)>,
}Expand description
One plugin-defined custom operator.
plugin_id names the registered plugin ("geosparql"); op_id names the
operation inside it ("geo_scan"). payload is typed and downcast
inside the plugin — never a stringly blob. children lets future plugins
wrap inner plans (FTS/time); the geo scan is a leaf. Every core pass
(liveness, explain, pushdown, …) treats a CustomOp as an opaque leaf
producing exactly variables unless the plugin supplies hooks.
Fields§
§plugin_id: &'static strRegistered plugin that owns this op ("geosparql").
op_id: &'static strOperation inside the plugin ("geo_scan").
payload: PluginPayloadBoxTyped payload (downcast inside the plugin).
children: Vec<PlanNode>Wrapped inner plan (empty for a leaf like geo_scan).
variables: Vec<Variable>Output schema (variables this op binds).
produced_row_count_estimate: u64Planner estimate for join costing.
cost: Option<CustomOpCost>Explicit regime cost model (CustomOpCost), stamped by the
minting rewrite and clampable by later estimate passes. Cardinality
stays in produced_row_count_estimate — this prices EXECUTION, and
exists so placement/pricing never mistakes a low-output op for a
cheap one. None = opaque (price at the row estimate).
pinned: Vec<(Variable, EncodedTerm)>Pinned output bindings stamped by plan specialization: the
broadcast-probe emulation of a Scan’s grounded pattern slot. When the
op is the probe arm of a join whose driver binds an output variable to
exactly ONE ground term, the rewrite pins (variable, term) and the
executor relates exactly that term (no runtime key delivery needed).
A pin fixes one COLUMN: it makes the op a point only when the op emits
that column alone, so a multi-column op keeps its row estimate.
Empty for driver-side / list-driven ops. Mirrors the Scan contract
that grounded slots survive clear_broadcast_marks.
Implementations§
Source§impl CustomOp
impl CustomOp
Sourcepub fn sweep_cost(&self) -> Option<u64>
pub fn sweep_cost(&self) -> Option<u64>
Keyless (driver-side) execution price: one candidate drain, then a
relate pass over every candidate. The regime a BUILD-side geo scan
runs — the one whose window-wide work is invisible to output-based
pricing. None = opaque op (price at produced_row_count_estimate).
Sourcepub fn probe_page_cost(
&self,
pushed_val_count: u64,
pushed_column: Option<usize>,
) -> Option<(u64, bool)>
pub fn probe_page_cost( &self, pushed_val_count: u64, pushed_column: Option<usize>, ) -> Option<(u64, bool)>
One probe page’s work for pushed_val_count keys, and whether that
page’s road pays the drain. The cheaper of:
- direct, only when the op has that road:
pushed × per_key_unit, no drain; - filter:
examined × probe_filter_unit, whereexaminedis the whole drain output unless the pushed column is one the op answers by key (CustomOpCost::probe_keyed_columns), in which case it ismin(pushed, produced)survivors — plus the drain itself.
the cost model charges the drain once for a memoizable window
(Self::probe_drain_amortized) and per page otherwise.
pushed_column is the pushed output variable’s position, or None
when no column-specific push is known.
None = opaque op (price at produced_row_count_estimate).
Sourcepub fn probe_drain_amortized(&self) -> bool
pub fn probe_drain_amortized(&self) -> bool
Whether the drain is paid ONCE for this op’s window: the op’s drain
memo admits it (produced <= probe_memo_entry_rows, and the op opted
in with a non-zero limit). A false answer prices the drain on every
probe page — the executor re-drains when the memo refuses.
Sourcepub fn keyed_cost(
&self,
pushed_val_count: u64,
pushed_column: Option<usize>,
) -> Option<u64>
pub fn keyed_cost( &self, pushed_val_count: u64, pushed_column: Option<usize>, ) -> Option<u64>
Keyed (probe-side) execution price for ONE execution against
pushed_val_count pushed values in pushed_column: the page price
plus the drain when that road pays it. This is the per-EXECUTION
bound the keyed-driver cost estimate charges per ancestor page; the custom
probe branch uses Self::probe_page_cost plus
Self::probe_drain_amortized to decide between one drain and one
per page. None = opaque op (price at
produced_row_count_estimate).
Trait Implementations§
impl StructuralPartialEq for CustomOp
Auto Trait Implementations§
impl Freeze for CustomOp
impl !RefUnwindSafe for CustomOp
impl Send for CustomOp
impl Sync for CustomOp
impl Unpin for CustomOp
impl UnsafeUnpin for CustomOp
impl !UnwindSafe for CustomOp
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].