Table of Contents

Class CardinalityHint

Namespace
DuckDB.NET.Data
Assembly
DuckDB.NET.Data.dll

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

Value ulong

The number of rows.

IsExact bool

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.

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

bool

Value

The number of rows.

public ulong Value { get; init; }

Property Value

ulong