pub enum JoinStrategy {
Hash,
Broadcast,
Shuffle,
Semi,
SemiScan,
}Expand description
Physical join hint chosen at plan time (Phase 9b executes broadcast/shuffle).
Variants§
Hash
Compute-side hash join (Phase 6 default).
Broadcast
Small build side → broadcast allow-list to storage (Phase 9b).
Shuffle
Both sides large → shuffle by join key (Phase 9b).
Semi
General semi join: build one key set from the right side — a scan or
a subtree — and keep only the left rows whose key is present, emitting
the left columns. This is the umbrella strategy: the Self::SemiScan
special case claims a key-unique scan whose fetch-once verdict chose
the whole read, and the general road builds from whatever the
promotion left, scan or subtree.
Never returned by JoinStrategy::from_cardinalities_and_domains.
SemiScan
Scan-source semi join: the right is a single scan whose fetch_once
verdict already chose the whole read, and the scan is key-unique with
no payload beyond the key. The kernel is
[waratah_exec::SemiJoinSet], the one FILTER EXISTS already uses.
Key-uniqueness is the row-multiplicity proof: a repeated right key
multiplies every left column, and a plain COUNT of a left column
observes that multiplication, so a bag mark on the key alone is not
enough. The cost is the verdict’s build side, never a cardinality
choice. Never returned by
JoinStrategy::from_cardinalities_and_domains.
Implementations§
Source§impl JoinStrategy
impl JoinStrategy
Sourcepub fn from_cardinalities(left: u64, right: u64) -> Self
pub fn from_cardinalities(left: u64, right: u64) -> Self
Pick a strategy from estimated left/right row counts (no HLL domain).
Sourcepub fn from_cardinalities_and_domains(
left_rows: u64,
right_rows: u64,
left_domain: Option<u64>,
right_domain: Option<u64>,
) -> Self
pub fn from_cardinalities_and_domains( left_rows: u64, right_rows: u64, left_domain: Option<u64>, right_domain: Option<u64>, ) -> Self
Prefer distinct join-key domains when known; broadcast pushes the key set.
Domain estimates are capped by row counts (min(domain, rows)) so a
selective prior scan cannot be inflated by a global predicate HLL.
Trait Implementations§
Source§impl Clone for JoinStrategy
impl Clone for JoinStrategy
Source§fn clone(&self) -> JoinStrategy
fn clone(&self) -> JoinStrategy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more