final class RoutineEstimate
    implements RoutineOption
    uses Snapshot
Public API: explicitly declared with @visibility public.

COST number or ROWS number: a planner estimate for the routine.

Source: https://www.postgresql.org/docs/17/sql-createfunction.html.

Reading the estimated costdoctest
$estimate = new \SqlSemantics\Platform\PostgreSql\Statement\Routine\Option\RoutineEstimate(\SqlSemantics\Platform\PostgreSql\Statement\Routine\Option\EstimateKind::Cost, new \SqlSemantics\Platform\PostgreSql\Statement\Literal\SignedNumber(false, new \SqlSemantics\Platform\PostgreSql\Statement\Literal\IntegerConstant('100')));
    [$estimate->setting(), $estimate->value->magnitude->digits] // => ['cost', '100']

Properties§

public SignedNumber $value

Methods§

public function __construct(public EstimateKind $kind, public SignedNumber $value)

Parameters

$kindEstimateKindWhat the estimate states
$valueSignedNumberThe estimate
public function alterable(): bool

Tells that ALTER accepts the option.

Returns

bool
Test cases 1
public function setting(): string

Answers cost or rows.

Returns

string
Test cases 1
Calls 1
public function deriveClause(Derivation $derivation, Environment $environment): void

Derives nothing: a number holds no expression.

Parameters

$derivationDerivation
$environmentEnvironment
Test cases 1
public function render(Output $out): void

Writes the keyword and the number.

Parameters

$outOutput
Test cases 1
Calls 1

Test cases 4§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 4

Relations§

Instantiated in 2