Package com.darkcollective.relix.symbol
Record Class ColumnStatistics
java.lang.Object
java.lang.Record
com.darkcollective.relix.symbol.ColumnStatistics
- Record Components:
distinctCount- the number of distinct (non-null) values, if knownnullCount- the number ofNULLvalues, if known
Per-column statistics used by the cost model to refine cardinality estimates.
Both fields are optional: a -1-style "unknown" is modelled with an
empty OptionalLong rather than a sentinel, so a consumer can tell
"zero distinct values" from "distinct count not collected".
distinctCount drives the cost model's grouped-aggregation, equi-join
and equality-selectivity estimates under the uniformity assumption;
nullCount gives IS NULL / IS NOT NULL an exact frequency
rather than an assumed one. Neither carries a min/max or a histogram, which is
why a range predicate (x > 5) is unestimable and the cost model falls
back to a flat selectivity for it.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ColumnStatisticsA column-statistics value carrying no information. -
Constructor Summary
ConstructorsConstructorDescriptionColumnStatistics(OptionalLong distinctCount, OptionalLong nullCount) Creates an instance of aColumnStatisticsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedistinctCountrecord 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 thenullCountrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
UNKNOWN
A column-statistics value carrying no information.
-
-
Constructor Details
-
ColumnStatistics
Creates an instance of aColumnStatisticsrecord class.- Parameters:
distinctCount- the value for thedistinctCountrecord componentnullCount- the value for thenullCountrecord component
-
-
Method Details
-
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). -
distinctCount
Returns the value of thedistinctCountrecord component.- Returns:
- the value of the
distinctCountrecord component
-
nullCount
Returns the value of thenullCountrecord component.- Returns:
- the value of the
nullCountrecord component
-