classKeyMethod
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.
$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> $columnspublic bool $linearpublic Numeral|null $algorithmMethods§
public function __construct(
public bool $linear,
public Numeral|null $algorithm,
list<Name> $columns,
)Parameters
Calls 2
- static-call Check::listOf() line 46
- class-const Name::class() line 46
public function deriveMethod(Derivation $derivation, Environment $scope): voidReports the column names the completely known table does not have.
Parameters
$derivation | Derivation | |
$scope | Environment |
Calls 2
- method-call ColumnNames::check() line 54
- new ColumnNames line 54
public function render(Output $out): voidWrites the method.
Parameters
$out | Output |
Calls 3
- method-call Output::keyword() line 63
- method-call ColumnNames::write() line 69
- new ColumnNames line 69
Test cases 2§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
KeyMethodTestcalls