pub struct OperatorNode {
pub id: usize,
pub op_type: OperatorType,
pub estimated_rows: f64,
pub estimated_cost: f64,
pub actual_rows: Option<f64>,
pub actual_time_ms: Option<f64>,
pub embedding: Option<Vec<f32>>,
}Expand description
A node in the query DAG
Fields§
§id: usize§op_type: OperatorType§estimated_rows: f64§estimated_cost: f64§actual_rows: Option<f64>§actual_time_ms: Option<f64>§embedding: Option<Vec<f32>>Implementations§
Source§impl OperatorNode
impl OperatorNode
Sourcepub fn new(id: usize, op_type: OperatorType) -> Self
pub fn new(id: usize, op_type: OperatorType) -> Self
Create a new operator node
Sourcepub fn index_scan(id: usize, index: &str, table: &str) -> Self
pub fn index_scan(id: usize, index: &str, table: &str) -> Self
Create an index scan node
Sourcepub fn ivf_flat_scan(id: usize, index: &str, nprobe: u32) -> Self
pub fn ivf_flat_scan(id: usize, index: &str, nprobe: u32) -> Self
Create an IVF-Flat scan node
Sourcepub fn nested_loop_join(id: usize) -> Self
pub fn nested_loop_join(id: usize) -> Self
Create a nested loop join node
Sourcepub fn merge_join(id: usize, key: &str) -> Self
pub fn merge_join(id: usize, key: &str) -> Self
Create a merge join node
Sourcepub fn sort_with_order(
id: usize,
keys: Vec<String>,
descending: Vec<bool>,
) -> Self
pub fn sort_with_order( id: usize, keys: Vec<String>, descending: Vec<bool>, ) -> Self
Create a sort node with descending flags
Sourcepub fn vector_distance(id: usize, metric: &str) -> Self
pub fn vector_distance(id: usize, metric: &str) -> Self
Create a vector distance node
Sourcepub fn materialize(id: usize) -> Self
pub fn materialize(id: usize) -> Self
Create a materialize node
Sourcepub fn with_estimates(self, rows: f64, cost: f64) -> Self
pub fn with_estimates(self, rows: f64, cost: f64) -> Self
Set estimated statistics
Sourcepub fn with_actuals(self, rows: f64, time_ms: f64) -> Self
pub fn with_actuals(self, rows: f64, time_ms: f64) -> Self
Set actual statistics
Sourcepub fn with_embedding(self, embedding: Vec<f32>) -> Self
pub fn with_embedding(self, embedding: Vec<f32>) -> Self
Set embedding vector
Trait Implementations§
Source§impl Clone for OperatorNode
impl Clone for OperatorNode
Source§fn clone(&self) -> OperatorNode
fn clone(&self) -> OperatorNode
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OperatorNode
impl Debug for OperatorNode
Source§impl<'de> Deserialize<'de> for OperatorNode
impl<'de> Deserialize<'de> for OperatorNode
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for OperatorNode
impl RefUnwindSafe for OperatorNode
impl Send for OperatorNode
impl Sync for OperatorNode
impl Unpin for OperatorNode
impl UnsafeUnpin for OperatorNode
impl UnwindSafe for OperatorNode
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