final class KeyMethod
    implements PartitionMethod
    uses Snapshot
Public API: explicitly declared with @visibility public.

[LINEAR] KEY [ALGORITHM = n] (columns): partitioning by the server's hash of column values.

Mirrors PT_part_type_def_key and PT_sub_partition_by_key. An empty column list means the primary key (or the only unique key). ALGORITHM selects the hash function of 5.1 (1) or of 5.5 and later (2). A column name the completely known table does not have is a diagnostic. Source: https://dev.mysql.com/doc/refman/8.4/en/partitioning-key.html.

Holding a linear key partitioningdoctest
$method = new \SqlSemantics\Platform\MySql\Statement\Partition\Method\KeyMethod(true, null, [new \SqlSemantics\Platform\MySql\Model\Statement\Identifier\Name('id')]);
    [$method->linear, $method->columns[0]->value] // => [true, 'id']

Properties§

public list<Name> $columns
public bool $linear
public Numeral|null $algorithm

Methods§

public function __construct(
    public bool $linear,
    public Numeral|null $algorithm,
    list<Name> $columns,
)

Parameters

$linearboolWhether LINEAR is written
$algorithmNumeral|nullThe ALGORITHM number, when written
$columnslist<Name>The partitioning columns in order; empty for the primary key
Calls 2
public function deriveMethod(Derivation $derivation, Environment $scope): void

Reports the column names the completely known table does not have.

Parameters

$derivationDerivation
$scopeEnvironment
Calls 2
public function render(Output $out): void

Writes the method.

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 1
Type checks 1