Dataflow: Performance fixes #9098
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Two fixes:
The first commit fixes a bad join-order in
nodeMayUseSummary
:Before:
After:
The second commit removes some tuples from
consCand
that belonged to unreachable access paths:Consider the set of cons candidates accumulated during reverse flow in the predicate
revFlowConsCand(Ap cons, Content c, Ap tail, Configuration config)
. These are the set of reads that are reached during reverse flow and are matched up with stores as those steps are subsequently reached. The subset that do reach a store is collected after the flow recursion inrevConsCand
(formerlyconsCand
), but due to this filtering it now means that we can have cons candidates for access paths that are no longer possible to construct using just the remaining cons candidates inrevConsCand
, so we can do a bit of additional filtering (which is now done in this PR). In the example I looked at this filtered just 2 tuples in stage 4, but removing those two tuples allowed us to construct 2 million fewerAccessPath
s for the final stage. This was because the expansion ofAccessPathApprox
toAccessPath
assumed that the set of cons candidates didn't include such unreachable tuples and their existence invalidated the calculation ofevalUnfold
.