Push distinct-by-primary-key operators below map operators in plans#3860
Push distinct-by-primary-key operators below map operators in plans#3860alecgrieser wants to merge 1 commit intoFoundationDB:mainfrom
Conversation
c8aca9d to
73a0dd0
Compare
This adds a new planner rule to push a distinct-by-primary-key operator below a map operator. This can be relevant for plans like an update plan when there are version columns (now broken out into its own yamsql file) as the new logic added in 4.9.0.1 (see: FoundationDB#3809) can result in additional maps being inserted into plans in such a way that the distinct was forced to happen after. This also had some knock on effects like resulting in preferring an index scan over a covering scan if there were some predicates that could be pushed below a fetch (but also some that couldn't). This resolves FoundationDB#3858.
73a0dd0 to
b3c5820
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: 6 queries Statistical Summary (Plan and Metrics Changed)
Significant Regressions (Plan and Metrics Changed)There was 1 outlier 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 5 queries with minor changes. Only Metrics ChangedThese queries experienced only metrics changes without any plan changes. If these metrics have substantially changed, Total: 9 queries Statistical Summary (Only Metrics Changed)
There were no queries with significant regressions detected. Minor Changes (Only Metrics Changed)In addition, there were 9 queries with minor changes. |
This adds a new planner rule to push a distinct-by-primary-key operator below a map operator. This can be relevant for plans like an update plan when there are version columns (now broken out into its own yamsql file) as the new logic added in 4.9.0.1 (see: #3809) can result in additional maps being inserted into plans in such a way that the distinct was forced to happen after. This also had some knock on effects like resulting in preferring an index scan over a covering scan if there were some predicates that could be pushed below a fetch (but also some that couldn't).
This resolves #3858.