java.lang.Object
com.darkcollective.relix.cost.OrderDeriver
Derives the
Ordering a RelNode sub-tree is guaranteed to deliver,
bottom-up and purely structurally.
Rules
- Establish —
τ(SORT) delivers exactly its sort keys. - Preserve — order-preserving operators carry their input's
ordering through:
σ(selection filters but keeps order),λ(limit/offset takes an ordered prefix), and a relation-onlyρ(renames the relation, not its columns). - Clear — every other operator delivers
Ordering.none()conservatively (it may reorder, regroup, or — for a column-renamingρ— invalidate the ordering's column names). Under-claiming order is always safe: it only ever keeps a sort that could have been removed.
This is the conservative C1 set; richer propagation (key-preserving π,
merge-join output order, sort-capable sources) arrives with the merge operators.
-
Method Summary
-
Method Details
-
derive
Derives the ordering delivered bynode.- Parameters:
node- the tree to analyse; must not be null- Returns:
- the delivered ordering; never null (conservatively
Ordering.none()when no order is guaranteed)
-