feat(queryopt): absorption-idempotency optimizer#3051
Open
jzelinskie wants to merge 4 commits intoauthzed:mainfrom
Open
feat(queryopt): absorption-idempotency optimizer#3051jzelinskie wants to merge 4 commits intoauthzed:mainfrom
jzelinskie wants to merge 4 commits intoauthzed:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3051 +/- ##
==========================================
+ Coverage 73.64% 73.69% +0.06%
==========================================
Files 499 500 +1
Lines 60165 60248 +83
==========================================
+ Hits 44301 44393 +92
+ Misses 12674 12666 -8
+ Partials 3190 3189 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
3e14dd6 to
6e45bdc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR implements a new optimizer pass that canonicalizes the structure of union expressions according two to laws from set theory: idempotency (A ∪ A = A) and absorption (A ∪ (A ∩ B) = A).
Caveats are treated as opaque structural units: A ∪ Caveat(A) is not simplified, but A ∪ (A ∩ Caveat(B)) = A because A appears as a direct factor.
Arrows are treated as opaque structural units: (A->B) ∪ (A->B ∩ C) = A->B, but (A->B) ∪ (A->C) is not simplified.
This must run after caveat pushdown so it sees the final caveat shape and before reachability-pruning so pruning works on a smaller tree.
Testing
Added unit tests, but also ran the full test suite. LMK if I need to add any other kind of tests when adding optimizers
References