Skip to main content

Module operators

Module operators 

Source
Expand description

Query operators for streaming execution.

This module provides Volcano-style operators that implement streaming execution for SQL queries. Each operator implements the Operator trait with open(), next(), close() lifecycle.

§Available Operators

§Join Operators

  • HashJoinOperator - Streaming hash join with O(N+M) complexity
  • MergeJoinOperator - Merge join for pre-sorted inputs with O(N+M) complexity
  • NestedLoopJoinOperator - Fallback for complex conditions with O(N*M) complexity
  • IndexNestedLoopJoinOperator - Index-based join with O(N*log M) complexity
  • BatchIndexNestedLoopJoinOperator - Batch variant for NO LIMIT queries

§Algorithm Selection

ConditionRecommended Operator
Equality keys, large tablesHashJoinOperator
Both inputs pre-sortedMergeJoinOperator
Inner table has indexIndexNestedLoopJoinOperator
No LIMIT + index availableBatchIndexNestedLoopJoinOperator
Non-equality conditionsNestedLoopJoinOperator
CROSS JOINNestedLoopJoinOperator

§Note

For filtering and projection, use the Result Wrapper pattern:

  • FilteredResult with RowFilter for WHERE clauses
  • StreamingProjectionResult for column projection

See executor/result.rs and expression/evaluator_bridge.rs for the recommended execution model.

Re-exports§

pub use crate::operator::ColumnSource;
pub use crate::operator::JoinProjection;
pub use bloom_filter::BloomFilterOperator;
pub use count_integer_antijoin::CountIntegerAntiJoinOperator;
pub use count_integer_antijoin::IntegerAntiJoinLookup;
pub use count_pk_semijoin::CountPkSemiJoinOperator;
pub use hash_join::HashJoinOperator;
pub use hash_join::JoinSide;
pub use hash_join::JoinType;
pub use index_nested_loop::BatchIndexNestedLoopJoinOperator;
pub use index_nested_loop::IndexLookupStrategy;
pub use index_nested_loop::IndexNestedLoopJoinOperator;
pub use merge_join::MergeJoinOperator;
pub use nested_loop_join::NestedLoopJoinOperator;

Modules§

bloom_filter
Bloom filter operator for pre-join filtering.
count_integer_antijoin
Count-only integer anti-join.
count_pk_semijoin
Count-only unique PK semi-join.
hash_join
Streaming hash join operator.
index_nested_loop
Index Nested Loop Join Operator.
merge_join
Merge Join Operator for pre-sorted inputs.
nested_loop_join
Nested Loop Join Operator.