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
| Parameter | Type | Description |
|---|---|---|
db | DortDBAsFriend | Internal database interface. |
Returns
IndexScans
Properties
calcBuilders
protectedcalcBuilders:Record<string,PlanVisitor<CalculationParams>>
Defined in: packages/core/src/optimizer/rules/index-scans.ts:43
Per-language calculation-builder visitor instances.
db
protecteddb:DortDBAsFriend
Defined in: packages/core/src/optimizer/rules/index-scans.ts:49
Internal database interface.
eqCheckers
protectedeqCheckers: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
Methods
getExprCandidates()
protectedgetExprCandidates(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
| Parameter | Type |
|---|---|
selections | Selection[] |
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
| Parameter | Type | Description |
|---|---|---|
node | Selection | The plan operator to match. |
Returns
PatternRuleMatchResult<IndexScansBindings>
Implementation of
matchIndex()
protectedmatchIndex(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
| Parameter | Type |
|---|---|
index | Index |
candidates | IndexMatchInput & object[] |
renameMap | RenameMap |
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
| Parameter | Type | Description |
|---|---|---|
node | Selection | The plan operator to transform. |
bindings | IndexScansBindings | The bindings to use for the transformation. |