Skip to main content

Module var_order

Module var_order 

Source
Expand description

Variable-ordering interface for multiway-join planning.

The variable order is the sequence in which a multiway evaluator binds variables. Different orders produce identical results but can vary widely in cost (intermediate sizes, work per step). The initial interface defines the trait shape and ships one trivial implementation (AppearanceOrder) so the rest of the planner has something deterministic to call. Cost-aware implementations slot in here without breaking the trait.

§Trait signature rationale

VariableOrder::order takes the full HypergraphRule (not just a &[Vertex]) on purpose: future selectivity-aware implementations need to inspect hyperedge structure to weigh orderings. Taking the whole IR now means the trivial implementation and the selectivity-aware implementation share one signature.

Structs§

AppearanceOrder
Trivial variable order: variables in their first-appearance order across the body. Already the construction order produced by HypergraphRule::from_rule, so this is just an IntoIterator over hg.vertex_ids().
CostPredictionRecord
Cost-model output for WCOJ-vs-hash prediction.
FullVariableOrder
Planned all-variable order and edge permutation for a WCOJ shape.
KCliqueEdge
Binary relation edge in a planned WCOJ shape.
KCliqueShape
Shape consumed by the full-variable WCOJ planner.
VariableShare
Per-variable share allocated by the planner.

Enums§

PredictedWinner
Predicted lower-cost path for a benchmark cell.

Traits§

StatsSource
Relation-level statistics required by the full-variable WCOJ planner.
VariableOrder
Compute a variable order for a HypergraphRule.

Functions§

plan_kclique_var_order
Plans a full variable order for a K-clique-family WCOJ shape.