pub enum LogicalPlan {
Show 15 variants
Scan {
table: String,
},
IndexScan {
table: String,
index: String,
range_start: Option<Value>,
range_end: Option<Value>,
include_start: bool,
include_end: bool,
},
IndexGet {
table: String,
index: String,
key: Value,
},
IndexInGet {
table: String,
index: String,
keys: Vec<Value>,
},
GinIndexScan {
table: String,
index: String,
column: String,
column_index: usize,
path: String,
value: Option<Value>,
query_type: String,
},
GinIndexScanMulti {
table: String,
index: String,
column: String,
pairs: Vec<(String, Value)>,
},
Filter {
input: Box<LogicalPlan>,
predicate: Expr,
},
Project {
input: Box<LogicalPlan>,
columns: Vec<Expr>,
},
Join {
left: Box<LogicalPlan>,
right: Box<LogicalPlan>,
condition: Expr,
join_type: JoinType,
},
Aggregate {
input: Box<LogicalPlan>,
group_by: Vec<Expr>,
aggregates: Vec<(AggregateFunc, Expr)>,
},
Sort {
input: Box<LogicalPlan>,
order_by: Vec<(Expr, SortOrder)>,
},
Limit {
input: Box<LogicalPlan>,
limit: usize,
offset: usize,
},
CrossProduct {
left: Box<LogicalPlan>,
right: Box<LogicalPlan>,
},
Union {
left: Box<LogicalPlan>,
right: Box<LogicalPlan>,
all: bool,
},
Empty,
}Expand description
Logical query plan node.
Variants§
Scan
Table scan.
IndexScan
Index scan with a key range.
Fields
IndexGet
Index point lookup.
IndexInGet
Index multi-point lookup (for IN queries). Performs multiple index lookups and unions the results.
GinIndexScan
GIN index scan for JSONB queries.
Fields
GinIndexScanMulti
GIN index scan for multiple JSONB predicates (AND combination). More efficient than multiple single GIN scans followed by intersection.
Fields
Filter
Filter (WHERE clause).
Project
Projection (SELECT columns).
Join
Join two relations.
Aggregate
Aggregation (GROUP BY).
Sort
Sort (ORDER BY).
Limit
Limit and offset.
CrossProduct
Cross product (cartesian join).
Union
Union of two relations.
Empty
Empty relation.
Implementations§
Source§impl LogicalPlan
impl LogicalPlan
Sourcepub fn filter(input: LogicalPlan, predicate: Expr) -> Self
pub fn filter(input: LogicalPlan, predicate: Expr) -> Self
Creates a filter plan.
Sourcepub fn project(input: LogicalPlan, columns: Vec<Expr>) -> Self
pub fn project(input: LogicalPlan, columns: Vec<Expr>) -> Self
Creates a projection plan.
Sourcepub fn join(
left: LogicalPlan,
right: LogicalPlan,
condition: Expr,
join_type: JoinType,
) -> Self
pub fn join( left: LogicalPlan, right: LogicalPlan, condition: Expr, join_type: JoinType, ) -> Self
Creates a join plan.
Sourcepub fn inner_join(
left: LogicalPlan,
right: LogicalPlan,
condition: Expr,
) -> Self
pub fn inner_join( left: LogicalPlan, right: LogicalPlan, condition: Expr, ) -> Self
Creates an inner join plan.
Sourcepub fn left_join(left: LogicalPlan, right: LogicalPlan, condition: Expr) -> Self
pub fn left_join(left: LogicalPlan, right: LogicalPlan, condition: Expr) -> Self
Creates a left outer join plan.
Sourcepub fn aggregate(
input: LogicalPlan,
group_by: Vec<Expr>,
aggregates: Vec<(AggregateFunc, Expr)>,
) -> Self
pub fn aggregate( input: LogicalPlan, group_by: Vec<Expr>, aggregates: Vec<(AggregateFunc, Expr)>, ) -> Self
Creates an aggregation plan.
Sourcepub fn limit(input: LogicalPlan, limit: usize, offset: usize) -> Self
pub fn limit(input: LogicalPlan, limit: usize, offset: usize) -> Self
Creates a limit plan.
Sourcepub fn cross_product(left: LogicalPlan, right: LogicalPlan) -> Self
pub fn cross_product(left: LogicalPlan, right: LogicalPlan) -> Self
Creates a cross product plan.
Sourcepub fn inputs(&self) -> Vec<&LogicalPlan>
pub fn inputs(&self) -> Vec<&LogicalPlan>
Returns the input plan(s) of this node.
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 more