Package com.darkcollective.relix.cost
Interface MonotoneGeneratorSource
- All Known Implementing Classes:
GeneratorMonotonicitySource
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Supplies, for a leaf relation, the column on which it is a
monotone-ascending unbounded generator — the one fact the optimizer needs to
decide that an upper-bound selection (
n < k) can be folded into the
producer as a termination stop (GEN-001).
It is the producer analogue of DistinctnessSource /
BoundednessSource: a leaf seam supplied by the runtime (which knows the
generator catalogue), consulted by the optimizer through the
OptimizationContext. A leaf that is not an ascending unbounded generator
returns Optional.empty() and is never bounded by this pass.
Only ascending, unbounded generators (Naturals, Primes)
need report a column: a finite generator terminates on its own, and a non-monotone
one cannot be safely stopped by a value threshold.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MonotoneGeneratorSourceA source under which no leaf is a monotone generator (the production default off-path). -
Method Summary
Modifier and TypeMethodDescriptionascendingColumn(String relationName) Returns the ascending value column of the leaf namedrelationNamewhen it is a monotone-ascending unbounded generator, elseOptional.empty().
-
Field Details
-
NONE
A source under which no leaf is a monotone generator (the production default off-path).
-
-
Method Details
-
ascendingColumn
Returns the ascending value column of the leaf namedrelationNamewhen it is a monotone-ascending unbounded generator, elseOptional.empty().- Parameters:
relationName- the leaf relation name; never null- Returns:
- the ascending column name, or empty when not an ascending unbounded generator
-