Skip to main content

CustomOp

Struct CustomOp 

Source
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 str

Registered plugin that owns this op ("geosparql").

§op_id: &'static str

Operation inside the plugin ("geo_scan").

§payload: PluginPayloadBox

Typed 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: u64

Planner 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

Source

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).

Source

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, where examined is the whole drain output unless the pushed column is one the op answers by key (CustomOpCost::probe_keyed_columns), in which case it is min(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).

Source

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.

Source

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§

Source§

impl Clone for CustomOp

Source§

fn clone(&self) -> CustomOp

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CustomOp

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for CustomOp

Source§

fn eq(&self, other: &CustomOp) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for CustomOp

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in [Layered].
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,