Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memoize results in SourceScanOptimizer for better CTE generation #1563

Merged
merged 4 commits into from
Dec 11, 2024

Conversation

plypaul
Copy link
Contributor

@plypaul plypaul commented Dec 11, 2024

Generation of CTEs is determined by identical nodes in the dataflow plan. Previously, the SourceScanOptimizer would create new nodes whenever it was able to optimize a branch. In addition, it would create new nodes in some cases where it was not necessary.

This PR updates SourceScanOptimizer to memoize results so that identical nodes are used in cases where the dataflow branch is the same.

This results in snapshot changes for tests where the optimizer previously prevented CTEs from being used - please view by commit.

@plypaul plypaul force-pushed the plypaul--55--common-nodes-in-source-scan-optimizer branch from 3215b65 to fe50fe2 Compare December 11, 2024 01:00
@plypaul plypaul marked this pull request as ready for review December 11, 2024 01:12
@plypaul plypaul merged commit 50c1c5a into main Dec 11, 2024
11 checks passed
@plypaul plypaul deleted the plypaul--55--common-nodes-in-source-scan-optimizer branch December 11, 2024 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants