Skip to main content

Class: IndexScans

Defined in: packages/core/src/optimizer/rules/index-scans.ts:41

Finds selections that can be satisfied by an index scan and replaces them with an index scan operator.

Implements

Constructors

Constructor

new IndexScans(db): IndexScans

Defined in: packages/core/src/optimizer/rules/index-scans.ts:47

Parameters

ParameterTypeDescription
dbDortDBAsFriendInternal database interface.

Returns

IndexScans

Properties

calcBuilders

protected calcBuilders: Record<string, PlanVisitor<CalculationParams>>

Defined in: packages/core/src/optimizer/rules/index-scans.ts:43

Per-language calculation-builder visitor instances.


db

protected db: DortDBAsFriend

Defined in: packages/core/src/optimizer/rules/index-scans.ts:49

Internal database interface.


eqCheckers

protected eqCheckers: Record<string, EqualityChecker>

Defined in: packages/core/src/optimizer/rules/index-scans.ts:45

Per-language equality-checker visitor instances.


operator

operator: typeof Selection = Selection

Defined in: packages/core/src/optimizer/rules/index-scans.ts:219

The operator this rule starts matching at.

Implementation of

PatternRule.operator

Methods

getExprCandidates()

protected getExprCandidates(selections): IndexMatchInput & object[]

Defined in: packages/core/src/optimizer/rules/index-scans.ts:172

Extracts IndexMatchInput candidates from the given selections, tagged with their selection-array index.

Parameters

ParameterType
selectionsSelection[]

Returns


match()

match(node): PatternRuleMatchResult<IndexScansBindings>

Defined in: packages/core/src/optimizer/rules/index-scans.ts:55

Matches the given plan operator against this rule.

Parameters

ParameterTypeDescription
nodeSelectionThe plan operator to match.

Returns

PatternRuleMatchResult<IndexScansBindings>

Implementation of

PatternRule.match


matchIndex()

protected matchIndex(index, candidates, renameMap): object

Defined in: packages/core/src/optimizer/rules/index-scans.ts:114

Tests whether index can satisfy any of the candidates; returns the surviving candidates and an accessor, or null.

Parameters

ParameterType
indexIndex
candidatesIndexMatchInput & object[]
renameMapRenameMap

Returns

accessor

accessor: Calculation

Calculation that invokes the index to retrieve matching records.

candidates

candidates: IndexMatchInput & object[]

Filtered candidates that participate in the matched index expression.


transform()

transform(node, bindings): PlanOperator

Defined in: packages/core/src/optimizer/rules/index-scans.ts:187

Transforms the given plan operator using the provided bindings.

Parameters

ParameterTypeDescription
nodeSelectionThe plan operator to transform.
bindingsIndexScansBindingsThe bindings to use for the transformation.

Returns

PlanOperator

Implementation of

PatternRule.transform