Record Class OptimizationResult
java.lang.Object
java.lang.Record
com.darkcollective.relix.optimizer.internal.OptimizationResult
- Record Components:
queryName- name of the query or relation that was optimized; must not be blankoriginal- the unoptimized source tree; must not be nulloptimized- the rewritten tree; must not be nullapplied- the transformations applied; must not be null; empty when no rules fired
public record OptimizationResult(String queryName, RelNode original, RelNode optimized, List<TransformationRecord> applied)
extends Record
The immutable result of optimizing a single query's
RelNode tree.
Carries three things together:
- The
original()unoptimized tree as received from semantic analysis. - The
optimized()rewritten tree; reference-equal tooriginal()when no rules fired. - The ordered list of
TransformationRecords describing every change made.
Instances are created by QueryOptimizer and consumed by
the console's optimization report.
-
Constructor Summary
ConstructorsConstructorDescriptionOptimizationResult(String queryName, RelNode original, RelNode optimized, List<TransformationRecord> applied) Creates an instance of aOptimizationResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionapplied()Returns the value of theappliedrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theoptimizedrecord component.original()Returns the value of theoriginalrecord component.Returns the value of thequeryNamerecord component.final StringtoString()Returns a string representation of this record class.intReturns the number of transformations applied to this query.booleanReturnstruewhen at least one transformation was applied to this query's tree.
-
Constructor Details
-
OptimizationResult
public OptimizationResult(String queryName, RelNode original, RelNode optimized, List<TransformationRecord> applied) Creates an instance of aOptimizationResultrecord class.
-
-
Method Details
-
wasOptimized
public boolean wasOptimized()Returnstruewhen at least one transformation was applied to this query's tree.- Returns:
trueiffapplied()is non-empty
-
transformationCount
public int transformationCount()Returns the number of transformations applied to this query.- Returns:
- count ≥ 0; equal to
applied().size()
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
queryName
Returns the value of thequeryNamerecord component.- Returns:
- the value of the
queryNamerecord component
-
original
Returns the value of theoriginalrecord component.- Returns:
- the value of the
originalrecord component
-
optimized
Returns the value of theoptimizedrecord component.- Returns:
- the value of the
optimizedrecord component
-
applied
Returns the value of theappliedrecord component.- Returns:
- the value of the
appliedrecord component
-