@quereus/quereus 4.3.2 → 4.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/src/common/types.d.ts +9 -0
- package/dist/src/common/types.d.ts.map +1 -1
- package/dist/src/common/types.js.map +1 -1
- package/dist/src/core/database-events.d.ts +49 -0
- package/dist/src/core/database-events.d.ts.map +1 -1
- package/dist/src/core/database-events.js +148 -0
- package/dist/src/core/database-events.js.map +1 -1
- package/dist/src/core/database-external-changes.d.ts +2 -2
- package/dist/src/core/database-external-changes.d.ts.map +1 -1
- package/dist/src/core/database-external-changes.js +12 -9
- package/dist/src/core/database-external-changes.js.map +1 -1
- package/dist/src/core/database-materialized-views-apply.d.ts +156 -14
- package/dist/src/core/database-materialized-views-apply.d.ts.map +1 -1
- package/dist/src/core/database-materialized-views-apply.js +370 -65
- package/dist/src/core/database-materialized-views-apply.js.map +1 -1
- package/dist/src/core/database-materialized-views-plan-builders.d.ts +66 -1
- package/dist/src/core/database-materialized-views-plan-builders.d.ts.map +1 -1
- package/dist/src/core/database-materialized-views-plan-builders.js +368 -8
- package/dist/src/core/database-materialized-views-plan-builders.js.map +1 -1
- package/dist/src/core/database-materialized-views-plans.d.ts +257 -30
- package/dist/src/core/database-materialized-views-plans.d.ts.map +1 -1
- package/dist/src/core/database-materialized-views.d.ts +99 -42
- package/dist/src/core/database-materialized-views.d.ts.map +1 -1
- package/dist/src/core/database-materialized-views.js +198 -121
- package/dist/src/core/database-materialized-views.js.map +1 -1
- package/dist/src/core/database.d.ts +5 -0
- package/dist/src/core/database.d.ts.map +1 -1
- package/dist/src/core/database.js +41 -18
- package/dist/src/core/database.js.map +1 -1
- package/dist/src/core/internal-statement-cache.d.ts +18 -0
- package/dist/src/core/internal-statement-cache.d.ts.map +1 -0
- package/dist/src/core/internal-statement-cache.js +211 -0
- package/dist/src/core/internal-statement-cache.js.map +1 -0
- package/dist/src/func/builtins/aggregate.d.ts +13 -12
- package/dist/src/func/builtins/aggregate.d.ts.map +1 -1
- package/dist/src/func/builtins/aggregate.js +146 -62
- package/dist/src/func/builtins/aggregate.js.map +1 -1
- package/dist/src/func/builtins/builtin-window-functions.d.ts.map +1 -1
- package/dist/src/func/builtins/builtin-window-functions.js +63 -48
- package/dist/src/func/builtins/builtin-window-functions.js.map +1 -1
- package/dist/src/func/registration.d.ts +19 -1
- package/dist/src/func/registration.d.ts.map +1 -1
- package/dist/src/func/registration.js +41 -0
- package/dist/src/func/registration.js.map +1 -1
- package/dist/src/index.d.ts +8 -8
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +12 -11
- package/dist/src/index.js.map +1 -1
- package/dist/src/parser/parser.d.ts +6 -0
- package/dist/src/parser/parser.d.ts.map +1 -1
- package/dist/src/parser/parser.js +45 -34
- package/dist/src/parser/parser.js.map +1 -1
- package/dist/src/planner/analysis/comparison-collation.d.ts +2 -0
- package/dist/src/planner/analysis/comparison-collation.d.ts.map +1 -1
- package/dist/src/planner/analysis/comparison-collation.js +1 -1
- package/dist/src/planner/analysis/comparison-collation.js.map +1 -1
- package/dist/src/planner/analysis/equi-correlation.d.ts +26 -0
- package/dist/src/planner/analysis/equi-correlation.d.ts.map +1 -0
- package/dist/src/planner/analysis/equi-correlation.js +62 -0
- package/dist/src/planner/analysis/equi-correlation.js.map +1 -0
- package/dist/src/planner/analysis/expression-fingerprint.d.ts.map +1 -1
- package/dist/src/planner/analysis/expression-fingerprint.js +29 -0
- package/dist/src/planner/analysis/expression-fingerprint.js.map +1 -1
- package/dist/src/planner/analysis/query-rewrite-matcher.d.ts +60 -18
- package/dist/src/planner/analysis/query-rewrite-matcher.d.ts.map +1 -1
- package/dist/src/planner/analysis/query-rewrite-matcher.js +95 -42
- package/dist/src/planner/analysis/query-rewrite-matcher.js.map +1 -1
- package/dist/src/planner/analysis/sat-checker.d.ts.map +1 -1
- package/dist/src/planner/analysis/sat-checker.js +43 -4
- package/dist/src/planner/analysis/sat-checker.js.map +1 -1
- package/dist/src/planner/analysis/scalar-subqueries.d.ts +28 -0
- package/dist/src/planner/analysis/scalar-subqueries.d.ts.map +1 -0
- package/dist/src/planner/analysis/scalar-subqueries.js +60 -0
- package/dist/src/planner/analysis/scalar-subqueries.js.map +1 -0
- package/dist/src/planner/building/delete.d.ts.map +1 -1
- package/dist/src/planner/building/delete.js +10 -3
- package/dist/src/planner/building/delete.js.map +1 -1
- package/dist/src/planner/building/expression.d.ts.map +1 -1
- package/dist/src/planner/building/expression.js +87 -6
- package/dist/src/planner/building/expression.js.map +1 -1
- package/dist/src/planner/building/foreign-key-builder.d.ts +44 -1
- package/dist/src/planner/building/foreign-key-builder.d.ts.map +1 -1
- package/dist/src/planner/building/foreign-key-builder.js +54 -0
- package/dist/src/planner/building/foreign-key-builder.js.map +1 -1
- package/dist/src/planner/building/insert.d.ts.map +1 -1
- package/dist/src/planner/building/insert.js +9 -12
- package/dist/src/planner/building/insert.js.map +1 -1
- package/dist/src/planner/building/select.d.ts.map +1 -1
- package/dist/src/planner/building/select.js +15 -1
- package/dist/src/planner/building/select.js.map +1 -1
- package/dist/src/planner/building/update.d.ts.map +1 -1
- package/dist/src/planner/building/update.js +13 -4
- package/dist/src/planner/building/update.js.map +1 -1
- package/dist/src/planner/building/with.d.ts.map +1 -1
- package/dist/src/planner/building/with.js +5 -8
- package/dist/src/planner/building/with.js.map +1 -1
- package/dist/src/planner/cache/materialization-advisory.d.ts +33 -0
- package/dist/src/planner/cache/materialization-advisory.d.ts.map +1 -1
- package/dist/src/planner/cache/materialization-advisory.js +164 -28
- package/dist/src/planner/cache/materialization-advisory.js.map +1 -1
- package/dist/src/planner/cache/reference-graph.d.ts +0 -4
- package/dist/src/planner/cache/reference-graph.d.ts.map +1 -1
- package/dist/src/planner/cache/reference-graph.js +5 -13
- package/dist/src/planner/cache/reference-graph.js.map +1 -1
- package/dist/src/planner/cost/index.d.ts +28 -7
- package/dist/src/planner/cost/index.d.ts.map +1 -1
- package/dist/src/planner/cost/index.js +26 -0
- package/dist/src/planner/cost/index.js.map +1 -1
- package/dist/src/planner/framework/pass.js +3 -3
- package/dist/src/planner/nodes/cache-node.d.ts +18 -2
- package/dist/src/planner/nodes/cache-node.d.ts.map +1 -1
- package/dist/src/planner/nodes/cache-node.js +42 -3
- package/dist/src/planner/nodes/cache-node.js.map +1 -1
- package/dist/src/planner/nodes/cte-node.d.ts +15 -1
- package/dist/src/planner/nodes/cte-node.d.ts.map +1 -1
- package/dist/src/planner/nodes/cte-node.js +12 -2
- package/dist/src/planner/nodes/cte-node.js.map +1 -1
- package/dist/src/planner/nodes/dml-executor-node.d.ts +0 -9
- package/dist/src/planner/nodes/dml-executor-node.d.ts.map +1 -1
- package/dist/src/planner/nodes/dml-executor-node.js.map +1 -1
- package/dist/src/planner/nodes/recursive-cte-node.d.ts +30 -1
- package/dist/src/planner/nodes/recursive-cte-node.d.ts.map +1 -1
- package/dist/src/planner/nodes/recursive-cte-node.js +30 -3
- package/dist/src/planner/nodes/recursive-cte-node.js.map +1 -1
- package/dist/src/planner/nodes/scalar.d.ts.map +1 -1
- package/dist/src/planner/nodes/scalar.js +26 -3
- package/dist/src/planner/nodes/scalar.js.map +1 -1
- package/dist/src/planner/optimizer.d.ts.map +1 -1
- package/dist/src/planner/optimizer.js +129 -8
- package/dist/src/planner/optimizer.js.map +1 -1
- package/dist/src/planner/rules/access/rule-select-access-path.d.ts.map +1 -1
- package/dist/src/planner/rules/access/rule-select-access-path.js +43 -18
- package/dist/src/planner/rules/access/rule-select-access-path.js.map +1 -1
- package/dist/src/planner/rules/cache/rule-cte-optimization.d.ts.map +1 -1
- package/dist/src/planner/rules/cache/rule-cte-optimization.js +8 -1
- package/dist/src/planner/rules/cache/rule-cte-optimization.js.map +1 -1
- package/dist/src/planner/rules/cache/rule-materialized-view-rewrite.d.ts.map +1 -1
- package/dist/src/planner/rules/cache/rule-materialized-view-rewrite.js +72 -54
- package/dist/src/planner/rules/cache/rule-materialized-view-rewrite.js.map +1 -1
- package/dist/src/planner/rules/cache/rule-mutating-subquery-cache.d.ts.map +1 -1
- package/dist/src/planner/rules/cache/rule-mutating-subquery-cache.js +6 -0
- package/dist/src/planner/rules/cache/rule-mutating-subquery-cache.js.map +1 -1
- package/dist/src/planner/rules/cache/rule-nested-loop-right-cache.d.ts +25 -0
- package/dist/src/planner/rules/cache/rule-nested-loop-right-cache.d.ts.map +1 -0
- package/dist/src/planner/rules/cache/rule-nested-loop-right-cache.js +176 -0
- package/dist/src/planner/rules/cache/rule-nested-loop-right-cache.js.map +1 -0
- package/dist/src/planner/rules/cache/rule-scalar-subquery-cache.d.ts +31 -0
- package/dist/src/planner/rules/cache/rule-scalar-subquery-cache.d.ts.map +1 -0
- package/dist/src/planner/rules/cache/rule-scalar-subquery-cache.js +68 -0
- package/dist/src/planner/rules/cache/rule-scalar-subquery-cache.js.map +1 -0
- package/dist/src/planner/rules/join/rule-fanout-lookup-join.d.ts.map +1 -1
- package/dist/src/planner/rules/join/rule-fanout-lookup-join.js +1 -54
- package/dist/src/planner/rules/join/rule-fanout-lookup-join.js.map +1 -1
- package/dist/src/planner/rules/predicate/rule-predicate-inference-equivalence.js +8 -1
- package/dist/src/planner/rules/predicate/rule-predicate-inference-equivalence.js.map +1 -1
- package/dist/src/planner/rules/subquery/rule-scalar-agg-decorrelation.d.ts +191 -0
- package/dist/src/planner/rules/subquery/rule-scalar-agg-decorrelation.d.ts.map +1 -0
- package/dist/src/planner/rules/subquery/rule-scalar-agg-decorrelation.js +627 -0
- package/dist/src/planner/rules/subquery/rule-scalar-agg-decorrelation.js.map +1 -0
- package/dist/src/planner/rules/subquery/rule-subquery-decorrelation.d.ts +10 -1
- package/dist/src/planner/rules/subquery/rule-subquery-decorrelation.d.ts.map +1 -1
- package/dist/src/planner/rules/subquery/rule-subquery-decorrelation.js +242 -51
- package/dist/src/planner/rules/subquery/rule-subquery-decorrelation.js.map +1 -1
- package/dist/src/runtime/cache/shared-cache.d.ts +7 -0
- package/dist/src/runtime/cache/shared-cache.d.ts.map +1 -1
- package/dist/src/runtime/cache/shared-cache.js +34 -1
- package/dist/src/runtime/cache/shared-cache.js.map +1 -1
- package/dist/src/runtime/deferred-constraint-queue.d.ts.map +1 -1
- package/dist/src/runtime/deferred-constraint-queue.js +10 -0
- package/dist/src/runtime/deferred-constraint-queue.js.map +1 -1
- package/dist/src/runtime/emit/aggregate-setup.d.ts +49 -0
- package/dist/src/runtime/emit/aggregate-setup.d.ts.map +1 -0
- package/dist/src/runtime/emit/aggregate-setup.js +99 -0
- package/dist/src/runtime/emit/aggregate-setup.js.map +1 -0
- package/dist/src/runtime/emit/aggregate.d.ts +2 -3
- package/dist/src/runtime/emit/aggregate.d.ts.map +1 -1
- package/dist/src/runtime/emit/aggregate.js +10 -84
- package/dist/src/runtime/emit/aggregate.js.map +1 -1
- package/dist/src/runtime/emit/alter-table.d.ts.map +1 -1
- package/dist/src/runtime/emit/alter-table.js +348 -165
- package/dist/src/runtime/emit/alter-table.js.map +1 -1
- package/dist/src/runtime/emit/asof-scan.d.ts.map +1 -1
- package/dist/src/runtime/emit/asof-scan.js +6 -0
- package/dist/src/runtime/emit/asof-scan.js.map +1 -1
- package/dist/src/runtime/emit/between.d.ts.map +1 -1
- package/dist/src/runtime/emit/between.js +32 -3
- package/dist/src/runtime/emit/between.js.map +1 -1
- package/dist/src/runtime/emit/binary.d.ts.map +1 -1
- package/dist/src/runtime/emit/binary.js +22 -2
- package/dist/src/runtime/emit/binary.js.map +1 -1
- package/dist/src/runtime/emit/bloom-join.d.ts.map +1 -1
- package/dist/src/runtime/emit/bloom-join.js +24 -3
- package/dist/src/runtime/emit/bloom-join.js.map +1 -1
- package/dist/src/runtime/emit/cache.d.ts +7 -3
- package/dist/src/runtime/emit/cache.d.ts.map +1 -1
- package/dist/src/runtime/emit/cache.js +23 -6
- package/dist/src/runtime/emit/cache.js.map +1 -1
- package/dist/src/runtime/emit/cast.d.ts.map +1 -1
- package/dist/src/runtime/emit/cast.js +10 -23
- package/dist/src/runtime/emit/cast.js.map +1 -1
- package/dist/src/runtime/emit/constraint-check.d.ts.map +1 -1
- package/dist/src/runtime/emit/constraint-check.js +41 -44
- package/dist/src/runtime/emit/constraint-check.js.map +1 -1
- package/dist/src/runtime/emit/create-view.d.ts.map +1 -1
- package/dist/src/runtime/emit/create-view.js +6 -0
- package/dist/src/runtime/emit/create-view.js.map +1 -1
- package/dist/src/runtime/emit/cte.d.ts.map +1 -1
- package/dist/src/runtime/emit/cte.js +43 -20
- package/dist/src/runtime/emit/cte.js.map +1 -1
- package/dist/src/runtime/emit/distinct.d.ts.map +1 -1
- package/dist/src/runtime/emit/distinct.js +6 -3
- package/dist/src/runtime/emit/distinct.js.map +1 -1
- package/dist/src/runtime/emit/dml-executor.d.ts.map +1 -1
- package/dist/src/runtime/emit/dml-executor.js +241 -115
- package/dist/src/runtime/emit/dml-executor.js.map +1 -1
- package/dist/src/runtime/emit/hash-aggregate.d.ts.map +1 -1
- package/dist/src/runtime/emit/hash-aggregate.js +16 -65
- package/dist/src/runtime/emit/hash-aggregate.js.map +1 -1
- package/dist/src/runtime/emit/insert.d.ts.map +1 -1
- package/dist/src/runtime/emit/insert.js +18 -7
- package/dist/src/runtime/emit/insert.js.map +1 -1
- package/dist/src/runtime/emit/join.js +5 -0
- package/dist/src/runtime/emit/join.js.map +1 -1
- package/dist/src/runtime/emit/materialized-view-helpers.d.ts +14 -1
- package/dist/src/runtime/emit/materialized-view-helpers.d.ts.map +1 -1
- package/dist/src/runtime/emit/materialized-view-helpers.js +38 -7
- package/dist/src/runtime/emit/materialized-view-helpers.js.map +1 -1
- package/dist/src/runtime/emit/materialized-view.d.ts.map +1 -1
- package/dist/src/runtime/emit/materialized-view.js +47 -6
- package/dist/src/runtime/emit/materialized-view.js.map +1 -1
- package/dist/src/runtime/emit/merge-join.d.ts.map +1 -1
- package/dist/src/runtime/emit/merge-join.js +18 -8
- package/dist/src/runtime/emit/merge-join.js.map +1 -1
- package/dist/src/runtime/emit/recursive-cte.d.ts.map +1 -1
- package/dist/src/runtime/emit/recursive-cte.js +59 -1
- package/dist/src/runtime/emit/recursive-cte.js.map +1 -1
- package/dist/src/runtime/emit/set-object-tags.d.ts +8 -0
- package/dist/src/runtime/emit/set-object-tags.d.ts.map +1 -1
- package/dist/src/runtime/emit/set-object-tags.js +8 -0
- package/dist/src/runtime/emit/set-object-tags.js.map +1 -1
- package/dist/src/runtime/emit/set-operation.d.ts.map +1 -1
- package/dist/src/runtime/emit/set-operation.js +7 -4
- package/dist/src/runtime/emit/set-operation.js.map +1 -1
- package/dist/src/runtime/emit/sort.d.ts.map +1 -1
- package/dist/src/runtime/emit/sort.js +5 -2
- package/dist/src/runtime/emit/sort.js.map +1 -1
- package/dist/src/runtime/emit/subquery.d.ts.map +1 -1
- package/dist/src/runtime/emit/subquery.js +113 -13
- package/dist/src/runtime/emit/subquery.js.map +1 -1
- package/dist/src/runtime/emit/temporal-arithmetic.d.ts +7 -0
- package/dist/src/runtime/emit/temporal-arithmetic.d.ts.map +1 -1
- package/dist/src/runtime/emit/temporal-arithmetic.js +15 -7
- package/dist/src/runtime/emit/temporal-arithmetic.js.map +1 -1
- package/dist/src/runtime/emit/update.d.ts.map +1 -1
- package/dist/src/runtime/emit/update.js +44 -3
- package/dist/src/runtime/emit/update.js.map +1 -1
- package/dist/src/runtime/emit/window.d.ts.map +1 -1
- package/dist/src/runtime/emit/window.js +72 -55
- package/dist/src/runtime/emit/window.js.map +1 -1
- package/dist/src/runtime/foreign-key-actions.d.ts +36 -1
- package/dist/src/runtime/foreign-key-actions.d.ts.map +1 -1
- package/dist/src/runtime/foreign-key-actions.js +238 -116
- package/dist/src/runtime/foreign-key-actions.js.map +1 -1
- package/dist/src/runtime/parallel-driver.d.ts +20 -1
- package/dist/src/runtime/parallel-driver.d.ts.map +1 -1
- package/dist/src/runtime/parallel-driver.js +23 -1
- package/dist/src/runtime/parallel-driver.js.map +1 -1
- package/dist/src/runtime/types.d.ts +54 -0
- package/dist/src/runtime/types.d.ts.map +1 -1
- package/dist/src/runtime/types.js.map +1 -1
- package/dist/src/schema/catalog-persistability.d.ts +58 -0
- package/dist/src/schema/catalog-persistability.d.ts.map +1 -0
- package/dist/src/schema/catalog-persistability.js +87 -0
- package/dist/src/schema/catalog-persistability.js.map +1 -0
- package/dist/src/schema/catalog.d.ts +17 -1
- package/dist/src/schema/catalog.d.ts.map +1 -1
- package/dist/src/schema/catalog.js +25 -3
- package/dist/src/schema/catalog.js.map +1 -1
- package/dist/src/schema/constraint-builder.d.ts +20 -22
- package/dist/src/schema/constraint-builder.d.ts.map +1 -1
- package/dist/src/schema/constraint-builder.js +43 -36
- package/dist/src/schema/constraint-builder.js.map +1 -1
- package/dist/src/schema/ddl-generator.d.ts +23 -0
- package/dist/src/schema/ddl-generator.d.ts.map +1 -1
- package/dist/src/schema/ddl-generator.js +27 -0
- package/dist/src/schema/ddl-generator.js.map +1 -1
- package/dist/src/schema/function.d.ts +109 -1
- package/dist/src/schema/function.d.ts.map +1 -1
- package/dist/src/schema/function.js.map +1 -1
- package/dist/src/schema/manager.d.ts +28 -0
- package/dist/src/schema/manager.d.ts.map +1 -1
- package/dist/src/schema/manager.js +82 -14
- package/dist/src/schema/manager.js.map +1 -1
- package/dist/src/schema/schema-differ.d.ts.map +1 -1
- package/dist/src/schema/schema-differ.js +51 -12
- package/dist/src/schema/schema-differ.js.map +1 -1
- package/dist/src/schema/unique-enforcement.d.ts +31 -0
- package/dist/src/schema/unique-enforcement.d.ts.map +1 -1
- package/dist/src/schema/unique-enforcement.js +37 -1
- package/dist/src/schema/unique-enforcement.js.map +1 -1
- package/dist/src/schema/window-function.d.ts +30 -10
- package/dist/src/schema/window-function.d.ts.map +1 -1
- package/dist/src/schema/window-function.js +20 -16
- package/dist/src/schema/window-function.js.map +1 -1
- package/dist/src/types/cast-semantics.d.ts +43 -0
- package/dist/src/types/cast-semantics.d.ts.map +1 -0
- package/dist/src/types/cast-semantics.js +59 -0
- package/dist/src/types/cast-semantics.js.map +1 -0
- package/dist/src/types/index.d.ts +1 -1
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/src/types/index.js +1 -1
- package/dist/src/types/index.js.map +1 -1
- package/dist/src/types/json-type.d.ts.map +1 -1
- package/dist/src/types/json-type.js +31 -10
- package/dist/src/types/json-type.js.map +1 -1
- package/dist/src/types/logical-type.d.ts +22 -0
- package/dist/src/types/logical-type.d.ts.map +1 -1
- package/dist/src/types/logical-type.js.map +1 -1
- package/dist/src/types/temporal-types.d.ts.map +1 -1
- package/dist/src/types/temporal-types.js +33 -11
- package/dist/src/types/temporal-types.js.map +1 -1
- package/dist/src/types/validation.d.ts +39 -1
- package/dist/src/types/validation.d.ts.map +1 -1
- package/dist/src/types/validation.js +60 -0
- package/dist/src/types/validation.js.map +1 -1
- package/dist/src/util/ast-spine-clone.d.ts +23 -0
- package/dist/src/util/ast-spine-clone.d.ts.map +1 -0
- package/dist/src/util/ast-spine-clone.js +41 -0
- package/dist/src/util/ast-spine-clone.js.map +1 -0
- package/dist/src/util/coercion.d.ts +13 -0
- package/dist/src/util/coercion.d.ts.map +1 -1
- package/dist/src/util/coercion.js +10 -1
- package/dist/src/util/coercion.js.map +1 -1
- package/dist/src/util/comparison.d.ts +89 -0
- package/dist/src/util/comparison.d.ts.map +1 -1
- package/dist/src/util/comparison.js +156 -27
- package/dist/src/util/comparison.js.map +1 -1
- package/dist/src/vtab/manifest.d.ts +7 -0
- package/dist/src/vtab/manifest.d.ts.map +1 -1
- package/dist/src/vtab/memory/connection.d.ts +14 -1
- package/dist/src/vtab/memory/connection.d.ts.map +1 -1
- package/dist/src/vtab/memory/connection.js +20 -2
- package/dist/src/vtab/memory/connection.js.map +1 -1
- package/dist/src/vtab/memory/layer/base.d.ts +6 -1
- package/dist/src/vtab/memory/layer/base.d.ts.map +1 -1
- package/dist/src/vtab/memory/layer/base.js +14 -5
- package/dist/src/vtab/memory/layer/base.js.map +1 -1
- package/dist/src/vtab/memory/layer/connection.d.ts +17 -0
- package/dist/src/vtab/memory/layer/connection.d.ts.map +1 -1
- package/dist/src/vtab/memory/layer/connection.js +26 -0
- package/dist/src/vtab/memory/layer/connection.js.map +1 -1
- package/dist/src/vtab/memory/layer/manager.d.ts +96 -13
- package/dist/src/vtab/memory/layer/manager.d.ts.map +1 -1
- package/dist/src/vtab/memory/layer/manager.js +595 -119
- package/dist/src/vtab/memory/layer/manager.js.map +1 -1
- package/dist/src/vtab/memory/layer/plan-filter.d.ts +41 -20
- package/dist/src/vtab/memory/layer/plan-filter.d.ts.map +1 -1
- package/dist/src/vtab/memory/layer/plan-filter.js +57 -27
- package/dist/src/vtab/memory/layer/plan-filter.js.map +1 -1
- package/dist/src/vtab/memory/layer/row-convert.d.ts +21 -0
- package/dist/src/vtab/memory/layer/row-convert.d.ts.map +1 -0
- package/dist/src/vtab/memory/layer/row-convert.js +30 -0
- package/dist/src/vtab/memory/layer/row-convert.js.map +1 -0
- package/dist/src/vtab/memory/layer/scan-layer.d.ts +6 -3
- package/dist/src/vtab/memory/layer/scan-layer.d.ts.map +1 -1
- package/dist/src/vtab/memory/layer/scan-layer.js +69 -36
- package/dist/src/vtab/memory/layer/scan-layer.js.map +1 -1
- package/dist/src/vtab/memory/layer/transaction.d.ts +127 -13
- package/dist/src/vtab/memory/layer/transaction.d.ts.map +1 -1
- package/dist/src/vtab/memory/layer/transaction.js +214 -65
- package/dist/src/vtab/memory/layer/transaction.js.map +1 -1
- package/dist/src/vtab/memory/module.d.ts.map +1 -1
- package/dist/src/vtab/memory/module.js +9 -2
- package/dist/src/vtab/memory/module.js.map +1 -1
- package/dist/src/vtab/memory/table.d.ts.map +1 -1
- package/dist/src/vtab/memory/table.js +3 -2
- package/dist/src/vtab/memory/table.js.map +1 -1
- package/dist/src/vtab/memory/types.d.ts +27 -1
- package/dist/src/vtab/memory/types.d.ts.map +1 -1
- package/dist/src/vtab/memory/types.js +16 -1
- package/dist/src/vtab/memory/types.js.map +1 -1
- package/dist/src/vtab/memory/utils/primary-key.d.ts +9 -0
- package/dist/src/vtab/memory/utils/primary-key.d.ts.map +1 -1
- package/dist/src/vtab/memory/utils/primary-key.js +11 -0
- package/dist/src/vtab/memory/utils/primary-key.js.map +1 -1
- package/dist/src/vtab/module.d.ts +63 -0
- package/dist/src/vtab/module.d.ts.map +1 -1
- package/dist/src/vtab/table.d.ts +24 -6
- package/dist/src/vtab/table.d.ts.map +1 -1
- package/dist/src/vtab/table.js.map +1 -1
- package/package.json +3 -3
- package/dist/src/planner/rules/cache/rule-in-subquery-cache.d.ts +0 -19
- package/dist/src/planner/rules/cache/rule-in-subquery-cache.d.ts.map +0 -1
- package/dist/src/planner/rules/cache/rule-in-subquery-cache.js +0 -53
- package/dist/src/planner/rules/cache/rule-in-subquery-cache.js.map +0 -1
|
@@ -0,0 +1,627 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rule: Scalar-Aggregate Subquery Decorrelation
|
|
3
|
+
*
|
|
4
|
+
* Rewrites a correlated scalar-aggregate subquery in a SELECT projection into a
|
|
5
|
+
* grouped LEFT JOIN, so the inner table is scanned/aggregated ONCE instead of
|
|
6
|
+
* once per outer row:
|
|
7
|
+
*
|
|
8
|
+
* Project[..., ScalarSubquery(Agg(Filter(corr ∧ rest, inner))) ...](outer)
|
|
9
|
+
* becomes
|
|
10
|
+
* Project[..., <guarded value read> ...]
|
|
11
|
+
* LeftJoin[corr] -- outer.a = inner.k, verbatim
|
|
12
|
+
* outer
|
|
13
|
+
* Aggregate(groupBy=[inner.k...], aggregates=[orig agg])
|
|
14
|
+
* Filter(rest, inner) -- residual inner-only predicates
|
|
15
|
+
*
|
|
16
|
+
* In SQL terms: `(select agg(x) from c where c.fk = o.k)` →
|
|
17
|
+
* `left join (select fk, agg(x) as val from c group by fk) g on g.fk = o.k`.
|
|
18
|
+
*
|
|
19
|
+
* The grouped aggregate PRESERVES the inner correlation attribute ids as its
|
|
20
|
+
* group-by output attribute ids (the same id-preservation ProjectNode applies
|
|
21
|
+
* to bare column-reference projections), so the original correlation conjuncts
|
|
22
|
+
* serve verbatim as the join condition and hash-join equi-pair extraction sees
|
|
23
|
+
* plain `colref = colref` pairs.
|
|
24
|
+
*
|
|
25
|
+
* Empty-group semantics ("the count bug"): a scalar aggregate over zero rows
|
|
26
|
+
* still yields one row (`count(*)` → 0, `sum(x)` → NULL), but the grouped join
|
|
27
|
+
* produces NO group for an outer row with no matches. The aggregate's
|
|
28
|
+
* empty-input value is computed at plan time via the exact runtime path
|
|
29
|
+
* (`finalizeFunction(cloneInitialValue(initialValue))`):
|
|
30
|
+
* - empty value NULL (sum/min/max/avg/json_group_array/…): the join miss
|
|
31
|
+
* already yields NULL — the replacement is a bare column reference;
|
|
32
|
+
* - otherwise (count/total): the replacement is
|
|
33
|
+
* `CASE WHEN <group key> IS NULL THEN <empty literal> ELSE <value> END`.
|
|
34
|
+
* A matched row always has a non-NULL group key (the equality matched), and
|
|
35
|
+
* an inner group with a NULL key can never match any outer row, so
|
|
36
|
+
* `key IS NULL` holds exactly on join misses — a separate `1 AS __present`
|
|
37
|
+
* marker column is unnecessary. This is a marker, not `coalesce(...)`, so
|
|
38
|
+
* an aggregate legitimately returning NULL on non-empty input stays NULL.
|
|
39
|
+
*
|
|
40
|
+
* Outer references OUTSIDE the correlation conjuncts (e.g. in aggregate
|
|
41
|
+
* arguments: `json_object('entryId', e.id, …)`) are remapped to the inner
|
|
42
|
+
* column they are equated with — justified by the equality predicate — but only
|
|
43
|
+
* when the equality is value-faithful (value-discriminating collation AND same
|
|
44
|
+
* logical type); otherwise the rule bails and the subquery stays correlated.
|
|
45
|
+
*
|
|
46
|
+
* Bail (leave the subquery correlated) when:
|
|
47
|
+
* - the subquery is uncorrelated, or correlates beyond the immediate outer;
|
|
48
|
+
* - the inner subtree carries a side effect (per-row firing is observable);
|
|
49
|
+
* - the subquery root is not a bare zero-group single-aggregate beneath
|
|
50
|
+
* bare pass-through Project/Alias wrappers (a Sort/LimitOffset wrapper, a
|
|
51
|
+
* GROUP BY, a composite expression over aggregates, or a non-aggregate
|
|
52
|
+
* `... limit 1` shape all keep today's behavior, including the >1-row
|
|
53
|
+
* scalar-subquery runtime error);
|
|
54
|
+
* - the aggregate's source is not a Filter whose predicate splits into
|
|
55
|
+
* `outer.col = inner.col` equi-conjuncts plus inner-only residuals
|
|
56
|
+
* (non-equi correlation such as `inner.ts < outer.ts` bails);
|
|
57
|
+
* - the aggregate's empty-input value cannot be folded to a plan-time
|
|
58
|
+
* literal (finalize throws, is async, non-deterministic, or yields a
|
|
59
|
+
* non-primitive);
|
|
60
|
+
* - an outer reference outside the conjuncts is not value-faithfully
|
|
61
|
+
* remappable.
|
|
62
|
+
*
|
|
63
|
+
* Registered unconditionally (no cost gate) after `fanout-lookup-join`, so the
|
|
64
|
+
* remote-latency fan-out path keeps first claim on the branches it is tuned
|
|
65
|
+
* for; the tiny-outer/huge-inner cost tradeoff is tracked in
|
|
66
|
+
* `backlog/feat-decorrelation-cost-model`.
|
|
67
|
+
*
|
|
68
|
+
* FOUR MATCH SITES share the identical per-subquery rewrite (`decorrelateOne`):
|
|
69
|
+
* - `ruleScalarAggDecorrelation` — subqueries in a ProjectNode's projection
|
|
70
|
+
* expressions; the join stack lands between the Project and its source.
|
|
71
|
+
* - `ruleScalarAggDecorrelationAggregate` — subqueries inside an
|
|
72
|
+
* AggregateNode's aggregate-argument (and group-by) expressions; the join
|
|
73
|
+
* stack lands BELOW the aggregate, between it and its source. Cardinality
|
|
74
|
+
* safety: the grouped subtree's GROUP BY keys are a unique key on its
|
|
75
|
+
* output, so the LEFT join matches at most one row per source row — the
|
|
76
|
+
* aggregate's input row count and multiplicity are preserved exactly, and
|
|
77
|
+
* every existing group-by/aggregate reference resolves unchanged by
|
|
78
|
+
* attribute id (left-side attributes stay visible through the join).
|
|
79
|
+
* - `ruleScalarAggDecorrelationFilter` — subqueries anywhere in a FilterNode's
|
|
80
|
+
* predicate (WHERE, and HAVING — a HAVING clause plans as a FilterNode whose
|
|
81
|
+
* source is an AggregateNode); the join stack lands between the Filter and
|
|
82
|
+
* its source, and the subquery reference in the predicate is substituted with
|
|
83
|
+
* the guarded value read. A FilterNode publishes its source's attributes
|
|
84
|
+
* verbatim, so the LEFT join's appended grouped-aggregate columns would leak
|
|
85
|
+
* to whatever consumes the filter — and a HAVING filter is frequently the
|
|
86
|
+
* query's output node itself (the SELECT projection is fused into the
|
|
87
|
+
* Aggregate below it, leaving no capping Project). The rule therefore caps its
|
|
88
|
+
* own result with a bare pass-through Project that re-exposes exactly the
|
|
89
|
+
* Filter's original attributes; the outer columns keep their original indices
|
|
90
|
+
* (the LEFT join places the outer on the left), so that projection's column
|
|
91
|
+
* references — and everything above — resolve unchanged.
|
|
92
|
+
* - `ruleScalarAggDecorrelationSort` — subqueries in a SortNode's sort-key
|
|
93
|
+
* expressions (`order by (select count(*) from c where c.fk = o.k)`); the
|
|
94
|
+
* join stack lands BELOW the Sort so the sort key can read the grouped
|
|
95
|
+
* value column. A SortNode publishes its source's attributes VERBATIM (it
|
|
96
|
+
* never consumes/hides columns the way a Project does), so the LEFT join's
|
|
97
|
+
* appended grouped-aggregate columns would otherwise leak upward and change
|
|
98
|
+
* the row shape every ancestor (a capping Project, a view body, a compound
|
|
99
|
+
* arm, LIMIT/OFFSET) sees. Like the Filter site, the rule caps its result
|
|
100
|
+
* with the same bare pass-through Project (`capToAttributes`) that
|
|
101
|
+
* re-exposes exactly the Sort's original attributes; the outer columns keep
|
|
102
|
+
* their original indices (the LEFT join places the outer on the left), so
|
|
103
|
+
* that projection — and everything above — resolves unchanged.
|
|
104
|
+
*
|
|
105
|
+
* SCOPE: like every site, `decorrelateOne` requires the correlation columns
|
|
106
|
+
* to be attributes of the Sort's OWN source. That holds for identity
|
|
107
|
+
* projections (`select o.* … order by (select … where c.fk = o.k)`) and
|
|
108
|
+
* for any query that also selects the correlation column. When the SELECT
|
|
109
|
+
* list projects the correlation column AWAY (`select o.id from o order by
|
|
110
|
+
* (select … where c.fk = o.k)`), the Sort sits above a stripping Project
|
|
111
|
+
* whose output no longer carries `o.k`, so the rule BAILS and the subquery
|
|
112
|
+
* stays correlated — still correct, because the runtime resolves `o.k` from
|
|
113
|
+
* the still-live base-scan row context below the Project; it is merely not
|
|
114
|
+
* decorrelated. Threading the grouped value column up through a stripping
|
|
115
|
+
* Project is tracked in
|
|
116
|
+
* `backlog/feat-decorrelate-order-by-subquery-nonselected-column`.
|
|
117
|
+
*
|
|
118
|
+
* NESTED subqueries converge level by level: the Structural pass is top-down
|
|
119
|
+
* with rules firing BEFORE descent, so the grouped aggregate built by one
|
|
120
|
+
* level's rewrite (whose aggregate argument carries the next level's subquery,
|
|
121
|
+
* outer references already remapped to the enclosing inner columns) is itself
|
|
122
|
+
* visited later in the same pass, where the Aggregate-site rule fires on it.
|
|
123
|
+
*/
|
|
124
|
+
import { createLogger } from '../../../common/logger.js';
|
|
125
|
+
import { isRelationalNode } from '../../nodes/plan-node.js';
|
|
126
|
+
import { FunctionFlags } from '../../../common/constants.js';
|
|
127
|
+
import { ProjectNode } from '../../nodes/project-node.js';
|
|
128
|
+
import { AliasNode } from '../../nodes/alias-node.js';
|
|
129
|
+
import { FilterNode } from '../../nodes/filter.js';
|
|
130
|
+
import { SortNode } from '../../nodes/sort.js';
|
|
131
|
+
import { AggregateNode } from '../../nodes/aggregate-node.js';
|
|
132
|
+
import { JoinNode } from '../../nodes/join-node.js';
|
|
133
|
+
import { ColumnReferenceNode } from '../../nodes/reference.js';
|
|
134
|
+
import { UnaryOpNode, LiteralNode, CaseExprNode } from '../../nodes/scalar.js';
|
|
135
|
+
import { AggregateFunctionCallNode } from '../../nodes/aggregate-function.js';
|
|
136
|
+
import { isAggregateFunctionSchema } from '../../../schema/function.js';
|
|
137
|
+
import { cloneInitialValue } from '../../../func/registration.js';
|
|
138
|
+
import { splitConjuncts, combineConjuncts } from '../../analysis/predicate-conjuncts.js';
|
|
139
|
+
import { isEquiCorrelation, referencesAnyAttr } from '../../analysis/equi-correlation.js';
|
|
140
|
+
import { collectScalarSubqueries, substituteSubqueries } from '../../analysis/scalar-subqueries.js';
|
|
141
|
+
import { collectExternalReferences } from '../../cache/correlation-detector.js';
|
|
142
|
+
import { isValueDiscriminatingEquality } from '../../analysis/comparison-collation.js';
|
|
143
|
+
import { PlanNodeCharacteristics } from '../../framework/characteristics.js';
|
|
144
|
+
const log = createLogger('optimizer:rule:scalar-agg-decorrelation');
|
|
145
|
+
export function ruleScalarAggDecorrelation(node, _context) {
|
|
146
|
+
if (!(node instanceof ProjectNode))
|
|
147
|
+
return null;
|
|
148
|
+
// Collect candidate subqueries across all projection expression trees
|
|
149
|
+
// (bare and wrapped), deduplicated by node identity.
|
|
150
|
+
const candidates = collectCandidates(node.projections.map(p => p.node));
|
|
151
|
+
if (candidates.length === 0)
|
|
152
|
+
return null;
|
|
153
|
+
const rewrite = decorrelateAll(candidates, node.source);
|
|
154
|
+
if (!rewrite)
|
|
155
|
+
return null;
|
|
156
|
+
log('Decorrelated %d scalar-aggregate subquery(ies) into grouped left join(s)', rewrite.replacements.size);
|
|
157
|
+
return rebuildProject(node, rewrite.source, rewrite.replacements);
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Aggregate-argument match site: the same rewrite for subqueries embedded in
|
|
161
|
+
* an AggregateNode's aggregate-argument (or group-by) expressions — the shape
|
|
162
|
+
* a nested aggregate subquery takes after the Project-site rewrite of its
|
|
163
|
+
* enclosing level (the enclosing rewrite's outer-reference remap makes a
|
|
164
|
+
* two-level correlation local to the new grouped aggregate's source). The join
|
|
165
|
+
* stack lands below the aggregate; see the module header for cardinality
|
|
166
|
+
* safety and multi-level convergence.
|
|
167
|
+
*
|
|
168
|
+
* NOTE: this site can also fire on an aggregate INSIDE a still-correlated
|
|
169
|
+
* subquery (e.g. when the enclosing level's remap bailed but the nested
|
|
170
|
+
* correlation is local). That is correct but the grouped subtree then
|
|
171
|
+
* re-executes per outer row — whether it beats the per-inner-row correlated
|
|
172
|
+
* plan is data-dependent; if a workload regresses here, gate this site on the
|
|
173
|
+
* enclosing subtree being decorrelated (part of
|
|
174
|
+
* `backlog/feat-decorrelation-cost-model`).
|
|
175
|
+
*/
|
|
176
|
+
export function ruleScalarAggDecorrelationAggregate(node, _context) {
|
|
177
|
+
if (!(node instanceof AggregateNode))
|
|
178
|
+
return null;
|
|
179
|
+
// Both aggregate arguments and group-by expressions are scalar trees
|
|
180
|
+
// evaluated per source row, so substitution is uniform across them.
|
|
181
|
+
const candidates = collectCandidates([
|
|
182
|
+
...node.groupBy,
|
|
183
|
+
...node.aggregates.map(a => a.expression),
|
|
184
|
+
]);
|
|
185
|
+
if (candidates.length === 0)
|
|
186
|
+
return null;
|
|
187
|
+
const rewrite = decorrelateAll(candidates, node.source);
|
|
188
|
+
if (!rewrite)
|
|
189
|
+
return null;
|
|
190
|
+
log('Decorrelated %d scalar-aggregate subquery(ies) below an enclosing aggregate', rewrite.replacements.size);
|
|
191
|
+
return rebuildAggregate(node, rewrite.source, rewrite.replacements);
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Filter match site (WHERE and HAVING): the same rewrite for a correlated
|
|
195
|
+
* scalar-aggregate subquery used anywhere in a FilterNode's predicate —
|
|
196
|
+
* `where o.total > (select avg(c.amount) from c where c.fk = o.k)`. The join
|
|
197
|
+
* stack lands between the Filter and its source, and the subquery reference in
|
|
198
|
+
* the predicate is substituted with the guarded value read; the result is
|
|
199
|
+
* `Filter[pred'](LeftJoin(outer, groupedAgg))`.
|
|
200
|
+
*
|
|
201
|
+
* HAVING needs no special-casing: `... group by o.k having sum(o.v) > (select …)`
|
|
202
|
+
* plans as a FilterNode whose source is an AggregateNode, so the aggregate's
|
|
203
|
+
* group-key / aggregate-result attributes are exactly the outer attributes the
|
|
204
|
+
* subquery correlates to — `decorrelateAll` treats the AggregateNode as the outer
|
|
205
|
+
* like any other relation.
|
|
206
|
+
*
|
|
207
|
+
* The LEFT join is load-bearing (an outer row with no inner match survives
|
|
208
|
+
* carrying the aggregate's empty-input value, which the replacement reproduces
|
|
209
|
+
* byte-for-byte), so three-valued predicate logic is preserved with no new code.
|
|
210
|
+
*
|
|
211
|
+
* The rewritten Filter's source gains the grouped join's columns; a FilterNode
|
|
212
|
+
* publishes its source's attributes verbatim, so the result is capped with a bare
|
|
213
|
+
* pass-through Project (see `capToAttributes`) that re-exposes exactly the
|
|
214
|
+
* original Filter attributes — without it the extra columns leak to the query
|
|
215
|
+
* output whenever the Filter is not already under a projection (the common HAVING
|
|
216
|
+
* shape, where the SELECT list is fused into the Aggregate below the filter).
|
|
217
|
+
*/
|
|
218
|
+
export function ruleScalarAggDecorrelationFilter(node, _context) {
|
|
219
|
+
if (!(node instanceof FilterNode))
|
|
220
|
+
return null;
|
|
221
|
+
// The predicate is a single scalar tree; collect every scalar-agg subquery in it.
|
|
222
|
+
const candidates = collectCandidates([node.predicate]);
|
|
223
|
+
if (candidates.length === 0)
|
|
224
|
+
return null;
|
|
225
|
+
// Original Filter attributes (= its source's) — the signature the cap restores.
|
|
226
|
+
const filterAttrs = node.getAttributes();
|
|
227
|
+
const rewrite = decorrelateAll(candidates, node.source);
|
|
228
|
+
if (!rewrite)
|
|
229
|
+
return null;
|
|
230
|
+
log('Decorrelated %d scalar-aggregate subquery(ies) in a filter predicate into grouped left join(s)', rewrite.replacements.size);
|
|
231
|
+
const decorrelatedFilter = new FilterNode(node.scope, rewrite.source, substituteSubqueries(node.predicate, rewrite.replacements));
|
|
232
|
+
return capToAttributes(node.scope, decorrelatedFilter, filterAttrs);
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Sort match site: a correlated scalar-aggregate subquery in a SortNode's
|
|
236
|
+
* sort-key expression — `order by (select count(*) from c where c.fk = o.k)`.
|
|
237
|
+
* The join stack lands BELOW the Sort (so the sort key can read the grouped
|
|
238
|
+
* value column), and each recognized subquery reference in the keys is
|
|
239
|
+
* substituted with the guarded value read; direction/nulls are copied verbatim.
|
|
240
|
+
*
|
|
241
|
+
* A SortNode publishes its source's attributes verbatim, so the LEFT join's
|
|
242
|
+
* appended columns would leak upward and change the row shape every ancestor
|
|
243
|
+
* sees. The result is therefore capped with the same bare pass-through Project
|
|
244
|
+
* as the Filter site (`capToAttributes`), re-exposing exactly the Sort's
|
|
245
|
+
* original attributes — invariant output shape regardless of whether an
|
|
246
|
+
* enclosing Project exists (view body / compound arm / bare top-level Sort).
|
|
247
|
+
*
|
|
248
|
+
* Ordering is stable: the substituted value is byte-identical to the scalar the
|
|
249
|
+
* subquery would return (same empty-input replacement as the other sites), and
|
|
250
|
+
* the LEFT join matches at most one row per outer row (unique group keys), so
|
|
251
|
+
* row count, multiplicity, and per-row sort-key values are all unchanged.
|
|
252
|
+
*/
|
|
253
|
+
export function ruleScalarAggDecorrelationSort(node, _context) {
|
|
254
|
+
if (!(node instanceof SortNode))
|
|
255
|
+
return null;
|
|
256
|
+
const candidates = collectCandidates(node.sortKeys.map(k => k.expression));
|
|
257
|
+
if (candidates.length === 0)
|
|
258
|
+
return null;
|
|
259
|
+
// NOTE: decorrelateAll requires the correlation columns to be in this Sort's
|
|
260
|
+
// OWN source. A `select o.id from o order by (select … where c.fk = o.k)`
|
|
261
|
+
// puts the Sort above a Project that stripped o.k, so decorrelateOne bails and
|
|
262
|
+
// the subquery stays correlated (still correct — the runtime reads o.k from the
|
|
263
|
+
// live base-scan context below the Project). Pushing the join through a
|
|
264
|
+
// stripping Project is backlog/feat-decorrelate-order-by-subquery-nonselected-column.
|
|
265
|
+
// Original Sort attributes (= its source's) — the signature the cap restores.
|
|
266
|
+
const sortAttrs = node.getAttributes();
|
|
267
|
+
const rewrite = decorrelateAll(candidates, node.source);
|
|
268
|
+
if (!rewrite)
|
|
269
|
+
return null;
|
|
270
|
+
log('Decorrelated %d scalar-aggregate subquery(ies) in an ORDER BY key into grouped left join(s)', rewrite.replacements.size);
|
|
271
|
+
const newKeys = node.sortKeys.map(k => ({
|
|
272
|
+
expression: substituteSubqueries(k.expression, rewrite.replacements),
|
|
273
|
+
direction: k.direction,
|
|
274
|
+
nulls: k.nulls,
|
|
275
|
+
}));
|
|
276
|
+
const decorrelatedSort = new SortNode(node.scope, rewrite.source, newKeys);
|
|
277
|
+
return capToAttributes(node.scope, decorrelatedSort, sortAttrs);
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Wrap `source` in a bare pass-through Project that re-exposes exactly
|
|
281
|
+
* `origAttrs` (the decorrelated Filter's or Sort's original output signature),
|
|
282
|
+
* discarding the grouped LEFT join's appended columns. The outer columns sit at
|
|
283
|
+
* indices `0..origAttrs.length-1` of the join output (LEFT join places the outer
|
|
284
|
+
* on the left), so each projection is a plain column reference at its original
|
|
285
|
+
* index and every id is preserved — consumers above resolve unchanged.
|
|
286
|
+
*/
|
|
287
|
+
function capToAttributes(scope, source, origAttrs) {
|
|
288
|
+
const projections = origAttrs.map((attr, index) => ({
|
|
289
|
+
node: new ColumnReferenceNode(scope, { type: 'column', name: attr.name }, attr.type, attr.id, index),
|
|
290
|
+
attributeId: attr.id,
|
|
291
|
+
}));
|
|
292
|
+
// preserveInputColumns: false — output is exactly the projected columns, and
|
|
293
|
+
// predefinedAttributes pins the ids/types to the original signature.
|
|
294
|
+
// NOTE: for a WHERE filter / ORDER BY already under a SELECT Project this cap
|
|
295
|
+
// is a redundant pass-through (the outer Project would re-cap anyway); it is
|
|
296
|
+
// NOT eliminated because its source carries MORE attributes, so no
|
|
297
|
+
// trivial-project rule sees it as an identity. Harmless (one extra Project
|
|
298
|
+
// node, correct output). If this shows up in plan-shape noise or profiling,
|
|
299
|
+
// skip the cap when `node`'s consumer is already a Project that outputs a
|
|
300
|
+
// subset of `origAttrs`.
|
|
301
|
+
return new ProjectNode(scope, source, projections, undefined, [...origAttrs], false);
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Collect candidate `ScalarSubqueryNode`s across a list of scalar expression
|
|
305
|
+
* trees (bare and wrapped), deduplicated by node identity, in deterministic
|
|
306
|
+
* expression-order pre-order.
|
|
307
|
+
*/
|
|
308
|
+
function collectCandidates(exprs) {
|
|
309
|
+
const candidates = [];
|
|
310
|
+
const seen = new Set();
|
|
311
|
+
for (const expr of exprs) {
|
|
312
|
+
const found = [];
|
|
313
|
+
collectScalarSubqueries(expr, found);
|
|
314
|
+
for (const cand of found) {
|
|
315
|
+
if (!seen.has(cand)) {
|
|
316
|
+
seen.add(cand);
|
|
317
|
+
candidates.push(cand);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
return candidates;
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Decorrelate every recognizable candidate against `outer`. Each recognized
|
|
325
|
+
* subquery becomes its own LEFT JOIN, stacked left-deep on the outer in
|
|
326
|
+
* deterministic (collection-order) sequence. The outer's attributes stay
|
|
327
|
+
* visible through every stacked left join, so later subqueries' correlations
|
|
328
|
+
* still resolve. Returns null when no candidate is recognized.
|
|
329
|
+
*/
|
|
330
|
+
function decorrelateAll(candidates, outer) {
|
|
331
|
+
const outerAttrIds = new Set(outer.getAttributes().map(a => a.id));
|
|
332
|
+
let currentSource = outer;
|
|
333
|
+
const replacements = new Map();
|
|
334
|
+
for (const cand of candidates) {
|
|
335
|
+
const rewrite = decorrelateOne(cand, outerAttrIds, currentSource);
|
|
336
|
+
if (!rewrite)
|
|
337
|
+
continue;
|
|
338
|
+
currentSource = rewrite.join;
|
|
339
|
+
replacements.set(cand, rewrite.replacement);
|
|
340
|
+
}
|
|
341
|
+
if (replacements.size === 0)
|
|
342
|
+
return null;
|
|
343
|
+
return { source: currentSource, replacements };
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Attempt to decorrelate one scalar-aggregate subquery into a grouped LEFT
|
|
347
|
+
* JOIN over `leftSource`. Returns null (leaving the subquery correlated) when
|
|
348
|
+
* any recognition or safety gate fails. Never mutates the original tree.
|
|
349
|
+
*/
|
|
350
|
+
function decorrelateOne(cand, outerAttrIds, leftSource) {
|
|
351
|
+
const subquery = cand.subquery;
|
|
352
|
+
// Correlated, and every external reference resolves to the immediate outer.
|
|
353
|
+
const external = collectExternalReferences(subquery);
|
|
354
|
+
if (external.size === 0)
|
|
355
|
+
return null;
|
|
356
|
+
for (const id of external) {
|
|
357
|
+
if (!outerAttrIds.has(id))
|
|
358
|
+
return null;
|
|
359
|
+
}
|
|
360
|
+
// Decorrelation changes the inner subtree's execution count (per outer row
|
|
361
|
+
// → once); per-row firing of a write is contractually observable.
|
|
362
|
+
if (PlanNodeCharacteristics.subtreeHasSideEffects(subquery))
|
|
363
|
+
return null;
|
|
364
|
+
// A scalar subquery exposes exactly one output attribute (validated at
|
|
365
|
+
// build); anything else is not this shape.
|
|
366
|
+
const subAttrs = subquery.getAttributes();
|
|
367
|
+
if (subAttrs.length !== 1)
|
|
368
|
+
return null;
|
|
369
|
+
// Descend bare pass-through wrappers to the logical AggregateNode. A
|
|
370
|
+
// Sort/LimitOffset wrapper is NOT descended: a `limit 0` would change the
|
|
371
|
+
// one-row-per-group contract, and dropping an ordering wrapper silently is
|
|
372
|
+
// exactly the trap this rule must not fall into — bail conservatively.
|
|
373
|
+
let root = subquery;
|
|
374
|
+
while (!(root instanceof AggregateNode)) {
|
|
375
|
+
if (root instanceof ProjectNode || root instanceof AliasNode) {
|
|
376
|
+
const src = root.getRelations()[0];
|
|
377
|
+
if (!src || !isRelationalNode(src))
|
|
378
|
+
return null;
|
|
379
|
+
root = src;
|
|
380
|
+
continue;
|
|
381
|
+
}
|
|
382
|
+
return null;
|
|
383
|
+
}
|
|
384
|
+
const agg = root;
|
|
385
|
+
// Zero grouping keys ⇒ exactly one row per outer row. A GROUP BY subquery
|
|
386
|
+
// can yield >1 row and must keep the scalar-context runtime error.
|
|
387
|
+
if (agg.groupBy.length !== 0)
|
|
388
|
+
return null;
|
|
389
|
+
// Phase-1 scope: exactly one bare aggregate — the value column IS the
|
|
390
|
+
// aggregate output. Composite expressions over aggregates (`max(x)-min(x)`)
|
|
391
|
+
// plan as multi-aggregate nodes under a computing Project and bail here.
|
|
392
|
+
if (agg.aggregates.length !== 1)
|
|
393
|
+
return null;
|
|
394
|
+
// The exposed value column must be the aggregate's own output attribute:
|
|
395
|
+
// bare column-reference Project wrappers and Alias preserve attribute ids,
|
|
396
|
+
// while an aliasing/computing wrapper mints a fresh id and fails this check.
|
|
397
|
+
const aggAttrs = agg.getAttributes();
|
|
398
|
+
if (aggAttrs.length !== 1 || aggAttrs[0].id !== subAttrs[0].id)
|
|
399
|
+
return null;
|
|
400
|
+
const valueAttr = aggAttrs[0];
|
|
401
|
+
const aggExpr = agg.aggregates[0].expression;
|
|
402
|
+
if (!(aggExpr instanceof AggregateFunctionCallNode))
|
|
403
|
+
return null;
|
|
404
|
+
const schema = aggExpr.functionSchema;
|
|
405
|
+
if (!isAggregateFunctionSchema(schema))
|
|
406
|
+
return null;
|
|
407
|
+
// A non-deterministic finalize could yield a different empty value at
|
|
408
|
+
// runtime than the one folded here.
|
|
409
|
+
if ((schema.flags & FunctionFlags.DETERMINISTIC) === 0)
|
|
410
|
+
return null;
|
|
411
|
+
const emptyValue = computeEmptyInputValue(schema);
|
|
412
|
+
if (!emptyValue)
|
|
413
|
+
return null;
|
|
414
|
+
// Correlation extraction: the aggregate's source must be a Filter whose
|
|
415
|
+
// predicate splits into outer=inner equi-conjuncts + inner-only residuals.
|
|
416
|
+
// (Predicate pushdown leaves correlated conjuncts in a FilterNode above the
|
|
417
|
+
// Retrieve boundary — same shape the EXISTS/IN decorrelation rule relies on.)
|
|
418
|
+
if (!(agg.source instanceof FilterNode))
|
|
419
|
+
return null;
|
|
420
|
+
const filter = agg.source;
|
|
421
|
+
const innerSource = filter.source;
|
|
422
|
+
// Top-level attributes only: the correlation columns become GROUP BY keys
|
|
423
|
+
// evaluated against the aggregate's source rows, so they must be visible in
|
|
424
|
+
// the source's own output row (not buried below a projection).
|
|
425
|
+
const innerTopAttrIds = new Set(innerSource.getAttributes().map(a => a.id));
|
|
426
|
+
const conjuncts = splitConjuncts(filter.predicate);
|
|
427
|
+
const corrConjuncts = [];
|
|
428
|
+
const residualConjuncts = [];
|
|
429
|
+
for (const conj of conjuncts) {
|
|
430
|
+
if (isEquiCorrelation(conj, outerAttrIds, innerTopAttrIds)) {
|
|
431
|
+
corrConjuncts.push(conj);
|
|
432
|
+
}
|
|
433
|
+
else {
|
|
434
|
+
residualConjuncts.push(conj);
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
if (corrConjuncts.length === 0)
|
|
438
|
+
return null;
|
|
439
|
+
// Residual conjuncts must be inner-only: a correlated conjunct that did not
|
|
440
|
+
// match the strict equi-pattern (non-equi `inner.ts < outer.ts`, casts,
|
|
441
|
+
// deep-projected inner columns) cannot be turned into a group key — bail.
|
|
442
|
+
for (const conj of residualConjuncts) {
|
|
443
|
+
if (referencesAnyAttr(conj, outerAttrIds))
|
|
444
|
+
return null;
|
|
445
|
+
}
|
|
446
|
+
const pairs = corrConjuncts.map(c => {
|
|
447
|
+
const left = c.left;
|
|
448
|
+
const right = c.right;
|
|
449
|
+
return outerAttrIds.has(left.attributeId)
|
|
450
|
+
? { outerRef: left, innerRef: right }
|
|
451
|
+
: { outerRef: right, innerRef: left };
|
|
452
|
+
});
|
|
453
|
+
// Remap outer references remaining in the retained subtrees (aggregate
|
|
454
|
+
// arguments, deeper inner source) to the inner column each is equated with.
|
|
455
|
+
const pairsByOuterId = new Map();
|
|
456
|
+
for (const p of pairs) {
|
|
457
|
+
if (!pairsByOuterId.has(p.outerRef.attributeId)) {
|
|
458
|
+
pairsByOuterId.set(p.outerRef.attributeId, p);
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
const remappedInnerSource = remapOuterRefs(innerSource, outerAttrIds, pairsByOuterId);
|
|
462
|
+
if (!remappedInnerSource || !isRelationalNode(remappedInnerSource))
|
|
463
|
+
return null;
|
|
464
|
+
const remappedAggExpr = remapOuterRefs(aggExpr, outerAttrIds, pairsByOuterId);
|
|
465
|
+
if (!remappedAggExpr)
|
|
466
|
+
return null;
|
|
467
|
+
// Rebuild the inner pipeline: residual inner-only predicates stay as a
|
|
468
|
+
// Filter over the (possibly remapped) inner source.
|
|
469
|
+
const residualPredicate = combineConjuncts(residualConjuncts);
|
|
470
|
+
const groupedSource = residualPredicate
|
|
471
|
+
? new FilterNode(filter.scope, remappedInnerSource, residualPredicate)
|
|
472
|
+
: remappedInnerSource;
|
|
473
|
+
// Group keys: one per distinct inner correlation attribute (a duplicate
|
|
474
|
+
// conjunct pair on the same inner column contributes one key). The group-by
|
|
475
|
+
// expressions are the inner column references themselves, and the grouped
|
|
476
|
+
// aggregate PRESERVES their attribute ids as its group-output ids so the
|
|
477
|
+
// original correlation conjuncts serve verbatim as the join condition.
|
|
478
|
+
const keyRefs = [];
|
|
479
|
+
const seenKeys = new Set();
|
|
480
|
+
for (const p of pairs) {
|
|
481
|
+
if (!seenKeys.has(p.innerRef.attributeId)) {
|
|
482
|
+
seenKeys.add(p.innerRef.attributeId);
|
|
483
|
+
keyRefs.push(p.innerRef);
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
const innerAttrById = new Map(innerSource.getAttributes().map(a => [a.id, a]));
|
|
487
|
+
const groupAttrs = [];
|
|
488
|
+
for (const ref of keyRefs) {
|
|
489
|
+
const attr = innerAttrById.get(ref.attributeId);
|
|
490
|
+
if (!attr)
|
|
491
|
+
return null;
|
|
492
|
+
groupAttrs.push({ ...attr });
|
|
493
|
+
}
|
|
494
|
+
const groupedAgg = new AggregateNode(agg.scope, groupedSource, keyRefs, [{ expression: remappedAggExpr, alias: agg.aggregates[0].alias }], undefined, [...groupAttrs, valueAttr]);
|
|
495
|
+
// Correctness backstop: the rebuilt right side must be fully decorrelated.
|
|
496
|
+
// (E.g. an outer reference the remap map did not cover would surface here.)
|
|
497
|
+
if (collectExternalReferences(groupedAgg).size !== 0)
|
|
498
|
+
return null;
|
|
499
|
+
const joinCondition = combineConjuncts(corrConjuncts);
|
|
500
|
+
const join = new JoinNode(cand.scope, leftSource, groupedAgg, 'left', joinCondition);
|
|
501
|
+
const leftWidth = leftSource.getAttributes().length;
|
|
502
|
+
const nullable = (t) => (t.nullable ? t : { ...t, nullable: true });
|
|
503
|
+
const valueColRef = new ColumnReferenceNode(cand.scope, { type: 'column', name: valueAttr.name }, nullable(valueAttr.type), valueAttr.id, leftWidth + groupAttrs.length);
|
|
504
|
+
let replacement;
|
|
505
|
+
if (emptyValue.value === null) {
|
|
506
|
+
// Join miss already yields NULL — exactly the aggregate's empty value.
|
|
507
|
+
replacement = valueColRef;
|
|
508
|
+
}
|
|
509
|
+
else {
|
|
510
|
+
// `CASE WHEN <group key> IS NULL THEN <empty literal> ELSE <value> END`.
|
|
511
|
+
// See the module header for why the group key is a sound miss marker.
|
|
512
|
+
const keyAttr = groupAttrs[0];
|
|
513
|
+
const keyColRef = new ColumnReferenceNode(cand.scope, { type: 'column', name: keyAttr.name }, nullable(keyAttr.type), keyAttr.id, leftWidth);
|
|
514
|
+
const isNullNode = new UnaryOpNode(cand.scope, { type: 'unary', operator: 'IS NULL', expr: keyColRef.expression }, keyColRef);
|
|
515
|
+
const emptyLiteral = new LiteralNode(cand.scope, { type: 'literal', value: emptyValue.value }, { ...valueAttr.type, nullable: false });
|
|
516
|
+
replacement = new CaseExprNode(cand.scope, {
|
|
517
|
+
type: 'case',
|
|
518
|
+
whenThenClauses: [{ when: isNullNode.expression, then: emptyLiteral.expression }],
|
|
519
|
+
elseExpr: valueColRef.expression,
|
|
520
|
+
}, undefined, [{ when: isNullNode, then: emptyLiteral }], valueColRef);
|
|
521
|
+
}
|
|
522
|
+
log('Decorrelated scalar %s() subquery into grouped LEFT JOIN on %d key(s)', aggExpr.functionName, groupAttrs.length);
|
|
523
|
+
return { join, replacement };
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
526
|
+
* Compute the aggregate's empty-input value by the SAME path the runtime uses
|
|
527
|
+
* for a zero-row scalar aggregate: a fresh accumulator through
|
|
528
|
+
* `finalizeFunction` (see the stream/hash aggregate emitters). Returns null
|
|
529
|
+
* when the value cannot be folded to a plan-time literal: finalize throws, is
|
|
530
|
+
* async, or yields a non-primitive (e.g. a native JSON array/object).
|
|
531
|
+
*/
|
|
532
|
+
function computeEmptyInputValue(schema) {
|
|
533
|
+
let value;
|
|
534
|
+
try {
|
|
535
|
+
// The UNBOUND schema suffices here — no bindAggregateSchema call needed:
|
|
536
|
+
// finalize of the identity accumulator never compares values, so every
|
|
537
|
+
// comparison-sensitive aggregate (min/max) yields the same empty-group
|
|
538
|
+
// value (NULL) under any argument binding.
|
|
539
|
+
value = schema.finalizeFunction(cloneInitialValue(schema.initialValue));
|
|
540
|
+
}
|
|
541
|
+
catch {
|
|
542
|
+
return null;
|
|
543
|
+
}
|
|
544
|
+
if (value === null ||
|
|
545
|
+
typeof value === 'string' ||
|
|
546
|
+
typeof value === 'number' ||
|
|
547
|
+
typeof value === 'bigint' ||
|
|
548
|
+
typeof value === 'boolean' ||
|
|
549
|
+
value instanceof Uint8Array) {
|
|
550
|
+
return { value };
|
|
551
|
+
}
|
|
552
|
+
return null;
|
|
553
|
+
}
|
|
554
|
+
/**
|
|
555
|
+
* The remap safety gate: replacing a reference to `outer.a` with `inner.b`
|
|
556
|
+
* (justified by the `outer.a = inner.b` conjunct) is value-faithful only when
|
|
557
|
+
* the equality is value-discriminating (no weak collation — a NOCASE `=`
|
|
558
|
+
* passes byte-different values) AND both sides share a logical type (a lossy
|
|
559
|
+
* cross-affinity `=` can equate values that render differently).
|
|
560
|
+
*/
|
|
561
|
+
function isValueFaithfulPair(pair) {
|
|
562
|
+
if (!isValueDiscriminatingEquality(pair.outerRef, pair.innerRef))
|
|
563
|
+
return false;
|
|
564
|
+
return pair.outerRef.getType().logicalType.name === pair.innerRef.getType().logicalType.name;
|
|
565
|
+
}
|
|
566
|
+
/**
|
|
567
|
+
* Deep-rewrite `node`, replacing every column reference to an outer attribute
|
|
568
|
+
* with the inner column reference it is equated with. Returns null (bail) when
|
|
569
|
+
* an outer reference has no value-faithful mapping. Untouched subtrees are
|
|
570
|
+
* shared, and `withChildren` rebuilds preserve output attribute ids along the
|
|
571
|
+
* changed path.
|
|
572
|
+
*/
|
|
573
|
+
function remapOuterRefs(node, outerAttrIds, pairsByOuterId) {
|
|
574
|
+
if (node instanceof ColumnReferenceNode) {
|
|
575
|
+
if (!outerAttrIds.has(node.attributeId))
|
|
576
|
+
return node;
|
|
577
|
+
const pair = pairsByOuterId.get(node.attributeId);
|
|
578
|
+
if (!pair || !isValueFaithfulPair(pair))
|
|
579
|
+
return null;
|
|
580
|
+
return pair.innerRef;
|
|
581
|
+
}
|
|
582
|
+
const children = node.getChildren();
|
|
583
|
+
if (children.length === 0)
|
|
584
|
+
return node;
|
|
585
|
+
const newChildren = [];
|
|
586
|
+
let changed = false;
|
|
587
|
+
for (const child of children) {
|
|
588
|
+
const replaced = remapOuterRefs(child, outerAttrIds, pairsByOuterId);
|
|
589
|
+
if (replaced === null)
|
|
590
|
+
return null;
|
|
591
|
+
newChildren.push(replaced);
|
|
592
|
+
if (replaced !== child)
|
|
593
|
+
changed = true;
|
|
594
|
+
}
|
|
595
|
+
return changed ? node.withChildren(newChildren) : node;
|
|
596
|
+
}
|
|
597
|
+
/**
|
|
598
|
+
* Rebuild the outer projection over the join-stacked source, substituting each
|
|
599
|
+
* decorrelated `ScalarSubqueryNode` with its replacement expression (bare
|
|
600
|
+
* column read or empty-value CASE guard) while preserving the projection's
|
|
601
|
+
* output attribute ids.
|
|
602
|
+
*/
|
|
603
|
+
function rebuildProject(project, newSource, replacements) {
|
|
604
|
+
const attributes = project.getAttributes();
|
|
605
|
+
const newProjections = project.projections.map((p, i) => ({
|
|
606
|
+
node: substituteSubqueries(p.node, replacements),
|
|
607
|
+
alias: p.alias,
|
|
608
|
+
attributeId: attributes[i].id,
|
|
609
|
+
}));
|
|
610
|
+
return new ProjectNode(project.scope, newSource, newProjections, undefined, attributes, project.preserveInputColumns);
|
|
611
|
+
}
|
|
612
|
+
/**
|
|
613
|
+
* Rebuild the enclosing aggregate over the join-stacked source, substituting
|
|
614
|
+
* each decorrelated `ScalarSubqueryNode` in its group-by / aggregate-argument
|
|
615
|
+
* expressions while preserving the aggregate's output attribute ids (so
|
|
616
|
+
* group-by references, HAVING filters, and everything above resolve
|
|
617
|
+
* unchanged). The inserted LEFT joins each match at most one row per source
|
|
618
|
+
* row (the grouped subtree's GROUP BY keys are a unique key on its output),
|
|
619
|
+
* so group contents — row count and multiplicity — are preserved exactly.
|
|
620
|
+
*/
|
|
621
|
+
function rebuildAggregate(agg, newSource, replacements) {
|
|
622
|
+
return new AggregateNode(agg.scope, newSource, agg.groupBy.map(expr => substituteSubqueries(expr, replacements)), agg.aggregates.map(a => ({
|
|
623
|
+
expression: substituteSubqueries(a.expression, replacements),
|
|
624
|
+
alias: a.alias,
|
|
625
|
+
})), undefined, agg.getAttributes());
|
|
626
|
+
}
|
|
627
|
+
//# sourceMappingURL=rule-scalar-agg-decorrelation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rule-scalar-agg-decorrelation.js","sourceRoot":"","sources":["../../../../../src/planner/rules/subquery/rule-scalar-agg-decorrelation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0HG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAK5D,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAgB,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,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