final class Reindex
    implements Statement
    uses Snapshot
Public API: explicitly declared with @visibility public.

REINDEX: a request to rebuild indexes.

Rule: PG-REINDEX-001. Mirrors PostgreSQL's ReindexStmt (kind, relation or name, params) with the CONCURRENTLY word, which the server turns into the option of that name. An index or a table is named by a relation name, a schema by its name, and SYSTEM or DATABASE by the name of the current database or by nothing. Facts: the table of REINDEX TABLE is resolved; an index, a schema and a database are not part of a declaration context; a table declared as another kind than a table or a materialized view is reported (PG-RELATION-KIND-001). Diagnostics: an option REINDEX does not know; a value the option cannot take; SYSTEM rebuilt concurrently, by the word or by the option. Source: https://www.postgresql.org/docs/17/sql-reindex.html. Status: Implemented.

Reading a concurrent REINDEX of a tabledoctest
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('REINDEX (VERBOSE) TABLE CONCURRENTLY app.t');
    [$operation->statement->target, $operation->statement->concurrently, $operation->statement->object->name->value] // => [\SqlSemantics\Platform\PostgreSql\Statement\Utility\Maintenance\ReindexTarget::Table, true, 't']
Refusing a schema named like a relationdoctest
new \SqlSemantics\Platform\PostgreSql\Statement\Utility\Maintenance\Reindex(\SqlSemantics\Platform\PostgreSql\Statement\Utility\Maintenance\ReindexTarget::Schema, new \SqlSemantics\Platform\PostgreSql\Model\Statement\Identifier\QualifiedName(new \SqlSemantics\Platform\PostgreSql\Model\Statement\Identifier\Name('s'))) // throws \SqlSemantics\Platform\PostgreSql\Model\Diagnostic\InvalidConstruction

Properties§

public list<UtilityOption> $options
public ReindexTarget $target
public QualifiedName|Name|null $object
public bool $concurrently = false

Methods§

public function __construct(
    public ReindexTarget $target,
    public QualifiedName|Name|null $object,
    list<UtilityOption> $options = [],
    public bool $concurrently = false,
)

Parameters

$targetReindexTargetWhat is rebuilt
$objectQualifiedName|Name|nullThe relation name of an index or table, the name of a schema, or the optional name of the database
$optionslist<UtilityOption>The parenthesized options in the order written
$concurrentlyboolWhether CONCURRENTLY is written
Calls 8
public function render(Output $out): void

Test cases 3§

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

Dedicated tests 1
Other tests reaching this symbol 2

Relations§

Instantiated in 3