Skip to content

PgCustomScanPath

Namespace: Ankus

Assembly: Ankus.Runtime.dll

Describes one way a custom scan can produce a table’s rows, with the costs the planner compares against other paths.

public readonly struct PgCustomScanPath : IEquatable<PgCustomScanPath>

Costs use the same units as the table’s existing paths, so a path cheaper than CheapestTotalCost usually wins.

Implements: IEquatable<PgCustomScanPath>

Describes one way a custom scan can produce a table’s rows, with the costs the planner compares against other paths.

public PgCustomScanPath(double StartupCost, double TotalCost)

Parameters:

StartupCost — double

The cost before the first row, in PostgreSQL’s planner units.

TotalCost — double

The cost to produce every row, at least StartupCost.

Costs use the same units as the table’s existing paths, so a path cheaper than CheapestTotalCost usually wins.

Gets bytes the plan keeps and passes to Begin(PgCustomScanContext), such as an encoded choice.

public ReadOnlyMemory<byte> Data { get; init; }

Value: ReadOnlyMemory<byte>

A cached plan can be executed many times, so the data must remain valid without state from planning.

Gets the estimated row count before the query’s conditions, or null to keep the planner’s estimate.

public double? Rows { get; init; }

Value: double?

A path that depends on an outer query’s values, such as inside a lateral join, always uses the planner’s estimate.

Gets the columns by which the path returns its rows in order, most significant first, or null when the rows have no order.

public IReadOnlyList<PgCustomScanSortKey>? SortKeys { get; init; }

Value: IReadOnlyList<PgCustomScanSortKey>

An ordered path can save a query a sort, for ORDER BY, a merge join or a LIMIT. The planner keeps only the leading keys the query can use. On a parallel path, each process returns its own rows in this order, and PostgreSQL merges them.

The cost before the first row, in PostgreSQL’s planner units.

public double StartupCost { get; init; }

Value: double

The cost to produce every row, at least StartupCost.

public double TotalCost { get; init; }

Value: double

public void Deconstruct(out double StartupCost, out double TotalCost)

Parameters:

StartupCost — double

TotalCost — double

public bool Equals(PgCustomScanPath other)

Parameters:

other — PgCustomScanPath

Returns: bool

public override bool Equals(object obj)

Parameters:

obj — object

Returns: bool

public override int GetHashCode()

Returns: int

public override string ToString()

Returns: string

operator ==(PgCustomScanPath, PgCustomScanPath)

Section titled “operator ==(PgCustomScanPath, PgCustomScanPath)”
public static bool operator ==(PgCustomScanPath left, PgCustomScanPath right)

Parameters:

left — PgCustomScanPath

right — PgCustomScanPath

Returns: bool

operator !=(PgCustomScanPath, PgCustomScanPath)

Section titled “operator !=(PgCustomScanPath, PgCustomScanPath)”
public static bool operator !=(PgCustomScanPath left, PgCustomScanPath right)

Parameters:

left — PgCustomScanPath

right — PgCustomScanPath

Returns: bool