radixdb_executor/operators/mod.rs
1// Copyright 2026 RadixDB Contributors
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//! Query operators for streaming execution.
16//!
17//! This module provides Volcano-style operators that implement streaming
18//! execution for SQL queries. Each operator implements the `Operator` trait
19//! with `open()`, `next()`, `close()` lifecycle.
20//!
21//! # Available Operators
22//!
23//! ## Join Operators
24//!
25//! - `HashJoinOperator` - Streaming hash join with O(N+M) complexity
26//! - `MergeJoinOperator` - Merge join for pre-sorted inputs with O(N+M) complexity
27//! - `NestedLoopJoinOperator` - Fallback for complex conditions with O(N*M) complexity
28//! - `IndexNestedLoopJoinOperator` - Index-based join with O(N*log M) complexity
29//! - `BatchIndexNestedLoopJoinOperator` - Batch variant for NO LIMIT queries
30//!
31//! # Algorithm Selection
32//!
33//! | Condition | Recommended Operator |
34//! |-----------|---------------------|
35//! | Equality keys, large tables | `HashJoinOperator` |
36//! | Both inputs pre-sorted | `MergeJoinOperator` |
37//! | Inner table has index | `IndexNestedLoopJoinOperator` |
38//! | No LIMIT + index available | `BatchIndexNestedLoopJoinOperator` |
39//! | Non-equality conditions | `NestedLoopJoinOperator` |
40//! | CROSS JOIN | `NestedLoopJoinOperator` |
41//!
42//! # Note
43//!
44//! For filtering and projection, use the Result Wrapper pattern:
45//! - `FilteredResult` with `RowFilter` for WHERE clauses
46//! - `StreamingProjectionResult` for column projection
47//!
48//! See `executor/result.rs` and `expression/evaluator_bridge.rs` for the
49//! recommended execution model.
50
51pub mod bloom_filter;
52pub mod count_integer_antijoin;
53pub mod count_pk_semijoin;
54pub mod hash_join;
55pub mod index_nested_loop;
56pub mod merge_join;
57pub mod nested_loop_join;
58#[doc(hidden)]
59pub mod reference_unique_lookup;
60
61// Re-export all operators and types
62pub use crate::operator::{ColumnSource, JoinProjection};
63pub use bloom_filter::BloomFilterOperator;
64pub use count_integer_antijoin::{CountIntegerAntiJoinOperator, IntegerAntiJoinLookup};
65pub use count_pk_semijoin::CountPkSemiJoinOperator;
66pub use hash_join::{HashJoinOperator, JoinSide, JoinType};
67pub use index_nested_loop::{
68 BatchIndexNestedLoopJoinOperator, IndexLookupStrategy, IndexNestedLoopJoinOperator,
69};
70pub use merge_join::MergeJoinOperator;
71pub use nested_loop_join::NestedLoopJoinOperator;