Repository navigation
Conversation
Replace `ScanWithFetchMatchCandidate.isOfPushableTypesOrConstant` and the hand-rolled `mapMaybe` fold in `pushValueThroughFetch` with a `MaxMatchMap` against the record a covering scan can provide. The removed guard allowed only `FieldValue` and `RecordConstructorValue`, so any arithmetic in a projection forced a record fetch: `SELECT a + b` over an index on `(a, b)` could not use a covering scan even though both columns are in the index entry. The guard was added by be93a3c (FoundationDB#2090) to keep a `VersionValue` from being pushed; `VersionValue` was since deleted in f737921 (FoundationDB#4101), and `__ROW_VERSION` is now a `PseudoField` that is excluded upstream by `IndexKeyValueToPartialRecord.Builder.validateField`, so the guard no longer protected anything. `IndexEntryToLogicalRecord` gains a `providedRecordValue`: the base record with each carried field reading itself and the rest absent, keyed by ordinal so that escaped SQL identifiers line up with their descriptor names. The translated value is simplified, so a correlated `q0.x` does not come back as a field of a record constructed over `q0`. Plan expectations are updated across the yamsql files; queries only gain covering scans. Where a union now runs over covering legs the fetch sits above the union.
ac4b4c9 to
a98731d
Compare
📊 Metrics Diff Analysis ReportSummary
ℹ️ About this analysisThis automated analysis compares query planner metrics between the base branch and this PR. It categorizes changes into:
The last category in particular may indicate planner regressions that should be investigated. New QueriesCount of new queries by file:
Plan and Metrics ChangedThese queries experienced both plan and metrics changes. This generally indicates that there was some planner change Total: 66 queries Statistical Summary (Plan and Metrics Changed)
Significant Regressions (Plan and Metrics Changed)There were 11 outliers detected. Outlier queries have a significant regression in at least one field. Statistically, this represents either an increase of more than two standard deviations above the mean or a large absolute increase (e.g., 100).
Minor Changes (Plan and Metrics Changed)In addition, there were 55 queries with minor changes. Only Metrics ChangedThese queries experienced only metrics changes without any plan changes. If these metrics have substantially changed, Total: 34 queries Statistical Summary (Only Metrics Changed)
Significant Regressions (Only Metrics Changed)There were 2 outliers detected. Outlier queries have a significant regression in at least one field. Statistically, this represents either an increase of more than two standard deviations above the mean or a large absolute increase (e.g., 100).
Minor Changes (Only Metrics Changed)In addition, there were 32 queries with minor changes. |
Let a covering scan serve values computed from index columns (e.g.
SELECT a + bover an index on(a, b)) instead of forcing a record fetch.