classUpdateHistogram
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.
$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> $columnspublic Numeral|null $buckets = nullpublic HistogramUpdate|null $update = nullMethods§
public function __construct(
list<Name> $columns,
public Numeral|null $buckets = null,
public HistogramUpdate|null $update = null,
)Parameters
$columns | list<Name> | The column names in written order; at least one |
$buckets | Numeral|null | The number of buckets, when written; the server allows 1 to 1024 and uses 100 by default |
$update | HistogramUpdate|null | MANUAL 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 numberCalls 4
- static-call Check::listOf() line 44
- class-const Name::class() line 44
- static-call Check::input() line 45
- function-call
preg_matchline 45
public function columns(): list<Name>public function render(Output $out): voidWrites the request.
Parameters
$out | Output |
Calls 4
- method-call Output::keyword() line 63
- method-call Histograms::render() line 64
- new Histograms line 64
- function-call
explodeline 69
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
- new SqlSemantics\Platform\MySql\Lowering\Server\Maintenance\MaintenanceRule::update() packages/sql-semantics-mysql/src/Lowering/Server/Maintenance/MaintenanceRule.php:236
- new SqlSemantics\Platform\MySql\Lowering\Server\Maintenance\MaintenanceRule::update() packages/sql-semantics-mysql/src/Lowering/Server/Maintenance/MaintenanceRule.php:237
- new SqlSemantics\Platform\MySql\Lowering\Server\Maintenance\MaintenanceRule::update() packages/sql-semantics-mysql/src/Lowering/Server/Maintenance/MaintenanceRule.php:239