Avoid a case where the planner was erroneously dropping predicates#3965
Avoid a case where the planner was erroneously dropping predicates#3965alecgrieser wants to merge 2 commits intoFoundationDB:mainfrom
Conversation
79c4b37 to
3911001
Compare
97d21e5 to
ddd955b
Compare
… in the compaensation as needed Validate behavior in new query test, as well as in more purpose built unit tests.
cbb9a3e to
5ade72f
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: 4 queries Statistical Summary (Plan and Metrics Changed)
There were no queries with significant regressions detected. Minor Changes (Plan and Metrics Changed)In addition, there were 4 queries with minor changes. |
There was a case in
RangeConstraints.asComparisonRangewhere the process of merging different comparison ranges could result in predicates being dropped. The fundamental error was that there is a function,merge, which merges a comparison into a comparison range. However, if the comparison can't be successfully merged, then it will be added to a residual comparison list. But theasComparisonRangefunction was ignoring those predicates entirely.This modifies the method so that it collects the ranges rather than dropping them. It then also modifies the compensation function so that if there are residual predicates, we are sure to generate a predicate for it.
This fixes #3950.