Class CardinalityHint
The number of rows a table function returns, for the optimizer of DuckDB.
public record CardinalityHint : IEquatable<CardinalityHint>
- Inheritance
-
CardinalityHint
- Implements
- Inherited Members
Constructors
CardinalityHint(ulong, bool)
The number of rows a table function returns, for the optimizer of DuckDB.
public CardinalityHint(ulong Value, bool IsExact = false)
Parameters
ValueulongThe number of rows.
IsExactboolPassed to DuckDB as it is. With DuckDB 1.5 and older the meaning is the reverse of the name:
false, the default, makesValuethe most rows the function can return, andtruemakes it an estimate only. DuckDB relies on a maximum: a function that returns more rows than that can get a wrongsum. So with DuckDB 1.5 passfalseonly when the function never returns more thanValuerows, andtruefor a guess. DuckDB 2.0 corrects this: theretruesets the maximum andfalseis an estimate, and a maximum that is too small can also remove aLIMIT.
Properties
IsExact
Passed to DuckDB as it is. With DuckDB 1.5 and older the meaning is the reverse of the name: false, the
default, makes Value the most rows the function can return, and true makes it an
estimate only. DuckDB relies on a maximum: a function that returns more rows than that can get a wrong
sum. So with DuckDB 1.5 pass false only when the function never returns more than
Value rows, and true for a guess. DuckDB 2.0 corrects this: there true sets
the maximum and false is an estimate, and a maximum that is too small can also remove a LIMIT.
public bool IsExact { get; init; }
Property Value
Value
The number of rows.
public ulong Value { get; init; }