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

Update SqlPlanNode.copy() to copy ancestor nodes #1673

Merged
merged 3 commits into from
Feb 18, 2025
Merged

Update SqlPlanNode.copy() to copy ancestor nodes #1673

merged 3 commits into from
Feb 18, 2025

Conversation

plypaul
Copy link
Contributor

@plypaul plypaul commented Feb 8, 2025

  • For the nodes in a SqlPlan, the invariant is that there are no duplicate nodes.
  • With the recent caching updates that allow for more reuse, copying all nodes in the hierarchy is simpler to reason for correctness.
  • With the update to do additional copying, the node IDs in the snapshots have changed.
  • The additional copy overhead should be small as there aren't that many node in a SQL plan for a query (<100), though the overhead can grow ~n^2 with the number of nodes.
  • New copies of the fields in the nodes are not created. Since they are much more numerous, creating copies of those could have a more significant impact.

@cla-bot cla-bot bot added the cla:yes label Feb 8, 2025
@plypaul plypaul marked this pull request as ready for review February 8, 2025 00:36
@plypaul plypaul requested a review from a team as a code owner February 8, 2025 00:36
Base automatically changed from p--misc--07 to main February 18, 2025 22:00
@plypaul plypaul merged commit 3c4dab1 into main Feb 18, 2025
11 checks passed
@plypaul plypaul deleted the p--misc--08 branch February 18, 2025 23:20
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