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

A request to gather the statistics the query planner uses.

Rule: SQLITE-ANALYZE-001. Without a name every attached schema is analyzed. An unqualified name is a schema name when a schema with that name is attached, otherwise a table or an index; a qualified name is a table or an index. Attached schemas and indexes are not part of a declaration context, so the name is kept unresolved and no relation fact or diagnostic is recorded. The statistics tables it writes are internal. Source: https://sqlite.org/lang_analyze.html. Status: Implemented.

Reading the target of an analysis requestdoctest
$analyze = (new \SqlSemantics\Platform\Sqlite\Semantics())->analyze('ANALYZE users');
    $analyze->statement->target?->name->value // => 'users'

Properties§

public QualifiedName|null $target = null

Methods§

public function __construct(public QualifiedName|null $target = null)

Parameters

$targetQualifiedName|nullThe schema, table or index name; null analyzes every attached schema
Calls 1
public function deriveStatement(Derivation $derivation): void

Derives nothing: the kind of object the name denotes is connection state.

Parameters

$derivationDerivation
public function render(Output $out): void

Writes the request.

Parameters

$outOutput
Calls 3

Test cases 2§

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 1

Relations§

Instantiated in 2