classHandlerIndexSeek
final class HandlerIndexSeek
implements Statement
uses Snapshot
Public API: explicitly declared with
@visibility public.HANDLER ... READ index op (value, ...): reads rows of an open handler from the first index key that compares as asked.
The values are compared with the leading columns of the index. The facts follow MYSQL-HANDLER-READ-001. Source: https://dev.mysql.com/doc/refman/8.4/en/handler.html.
$read = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('HANDLER h READ idx >= (1, 2) LIMIT 3');
[$read->statement->comparison, count($read->statement->values), $read->toString()] // => [\SqlSemantics\Platform\MySql\Statement\Dml\Handler\KeyComparison::GreaterOrEqual, 2, 'HANDLER h READ idx >= (1, 2) LIMIT 3']Properties§
public list<Scalar> $valuespublic OpenHandler $handlerpublic Name $indexpublic KeyComparison $comparisonpublic Scalar|null $where = nullpublic Limit|null $limit = nullMethods§
public function __construct(
public OpenHandler $handler,
public Name $index,
public KeyComparison $comparison,
list<Scalar> $values,
public Scalar|null $where = null,
public Limit|null $limit = null,
)Parameters
$handler | OpenHandler | The handler read from |
$index | Name | The index searched; `PRIMARY` names the primary key |
$comparison | KeyComparison | How the key is compared with the values |
$values | list<Scalar> | The key values; at least one |
$where | Scalar|null | The condition rows must meet |
$limit | Limit|null | The most rows read |
Calls 2
- static-call Check::listOf() line 55
- class-const Scalar::class() line 55
public function deriveStatement(Derivation $derivation): voidDerives the handler, the key values, WHERE and LIMIT, and records the rows read.
Parameters
$derivation | Derivation |
Calls 2
- method-call HandlerFacts::read() line 63
- new HandlerFacts line 63
public function render(Output $out): voidWrites the statement.
Parameters
$out | Output |
Calls 3
- method-call Output::keyword() line 71
- class-const NameUse::Label() line 71
- method-call Output::node() line 76
Test cases 2§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.