final class KeyCacheRule
Restricted visibility: declared "@visibility SqlSemantics\Platform\MySql\Lowering\Server". Code outside that scope must not name this declaration.

Lowers CACHE INDEX and LOAD INDEX INTO CACHE.

Rule: MYSQL-KEY-CACHE-001. Scope: keycache, keycache_list_or_parts, assign_to_keycache_parts, preload, preload_list_or_parts, preload_keys_parts, cache_keys_spec, cache_key_list_or_empty (5.6, 5.7), keycache_stmt, preload_stmt, opt_cache_key_list (8.0 and later), keycache_list, assign_to_keycache, key_cache_name, preload_list, preload_keys, adm_partition, opt_ignore_leaves. The index list goes through the query family's index rule, which reads PRIMARY as the primary key; the partitions through the table change family's partition list rule. KEY and INDEX are synonyms (LeafNoise). Constructs: CacheIndex, CachedTable, LoadIndex, PreloadedTable. Terminates: lists are flattened iteratively. Source: https://dev.mysql.com/doc/refman/8.4/en/cache-index.html, https://dev.mysql.com/doc/refman/8.4/en/load-index.html. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe lowering this rule belongs to
public function entries(Node $list): list<Form>
public function partitions(Node $partition): PartitionSelection

Lowers a partition selection: a node of adm_partition.

Parameters

$partitionNode

Throws

ImplementationGap When a production has no rule
Called from 1
Calls 3
public function marked(Form $form): PartitionSelection

Lowers the 5.x partition selection that holds the have_partitioning marker.

Parameters

$formForm

Throws

ImplementationGap When a production has no rule
Called from 1
Calls 1
public function indexes(Node $list): list<Name|PrimaryIndex>|null

Lowers an optional index list: a node of cache_keys_spec or opt_cache_key_list; an absent list is null.

Parameters

$listNode

Returns

list<Name|PrimaryIndex>|null

Throws

ImplementationGap When a production has no rule
Called from 1
Calls 3
public function keys(Form $form): list<Name|PrimaryIndex>

Lowers a written index list.

Parameters

$formForm

Returns

Throws

ImplementationGap When a production has no rule
Called from 1
Calls 1
public function leaves(Node $leaves): bool

Lowers IGNORE LEAVES: a node of opt_ignore_leaves.

Parameters

$leavesNode

Returns

bool

Throws

ImplementationGap When a production has no rule
Called from 1
Calls 2

Private surface 3§

Implementation details, listed for orientation only.

private const ENTRIES = ['assign_to_keycache: table_ident cache_keys_spec' => [0, null, 1, null], 'assi…
private const LISTS = ['keycache_list_or_parts: keycache_list', 'keycache_list_or_parts: assign_to_ke…
private Lowering $lowering

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 1
Method calls 1