final class UpdateHistogram
    implements Histogram
    uses Snapshot
Public API: explicitly declared with @visibility public.

UPDATE HISTOGRAM ON column, … [WITH n BUCKETS] [MANUAL UPDATE | AUTO UPDATE]: a request to build histograms from the column values.

The columns are those of the one table ANALYZE TABLE names; the statement checks them (MYSQL-HISTOGRAM-001). Source: https://dev.mysql.com/doc/refman/8.4/en/analyze-table.html.

Reading the histogram requestdoctest
$analyze = (new \SqlSemantics\Platform\MySql\Semantics())->analyze("ANALYZE TABLE t UPDATE HISTOGRAM ON a WITH 8 BUCKETS");
    [$analyze->toString(), $analyze->statement->histogram->buckets?->text === '8'] // => ["ANALYZE TABLE t UPDATE HISTOGRAM ON a WITH 8 BUCKETS", true]

Properties§

public list<Name> $columns
public Numeral|null $buckets = null
public HistogramUpdate|null $update = null

Methods§

public function __construct(
    list<Name> $columns,
    public Numeral|null $buckets = null,
    public HistogramUpdate|null $update = null,
)

Parameters

$columnslist<Name>The column names in written order; at least one
$bucketsNumeral|nullThe number of buckets, when written; the server allows 1 to 1024 and uses 100 by default
$updateHistogramUpdate|nullMANUAL UPDATE or AUTO UPDATE, when written (MySQL 8.4 and later)

Throws

InvalidConstruction When the column list is empty or the bucket count is not a decimal number
Calls 4
public function columns(): list<Name>

Answers the column names in written order.

Returns

list<Name>
Test cases 1
public function render(Output $out): void

Writes the request.

Parameters

$outOutput
Calls 4

Test cases 1§

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

Dedicated tests 1

Relations§

Instantiated in 3
Type checks 1
Type declarations 1