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.

Reading an index seek of a handlerdoctest
$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> $values
public OpenHandler $handler
public Name $index
public KeyComparison $comparison
public Scalar|null $where = null
public Limit|null $limit = null

Methods§

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

$handlerOpenHandlerThe handler read from
$indexNameThe index searched; `PRIMARY` names the primary key
$comparisonKeyComparisonHow the key is compared with the values
$valueslist<Scalar>The key values; at least one
$whereScalar|nullThe condition rows must meet
$limitLimit|nullThe most rows read
Calls 2
public function deriveStatement(Derivation $derivation): void

Derives the handler, the key values, WHERE and LIMIT, and records the rows read.

Parameters

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

Writes the statement.

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 2

Relations§

Instantiated in 1