Skip to content

[CALCITE-5679] HepPlanner#buildFinalPlan: do not clear metadata cache if RelNode has not changed#3181

Merged
rubenada merged 1 commit into
apache:mainfrom
rubenada:CALCITE-5679
Apr 29, 2023
Merged

[CALCITE-5679] HepPlanner#buildFinalPlan: do not clear metadata cache if RelNode has not changed#3181
rubenada merged 1 commit into
apache:mainfrom
rubenada:CALCITE-5679

Conversation

@rubenada
Copy link
Copy Markdown
Contributor

CALCITE-5679
Minor optimization:
HepPlanner#buildFinalplan clears the metadata cache info of the impacted RelNode after replacing its inputs, but in the cases where the RelNode does not change (e.g. when it has no inputs) this clear cache should not be necessary (unless I'm missing something).

@rubenada rubenada changed the title [CALCITE-5679] HepPlanner#buildFinalplan: do not clear metadata cache if RelNode has not changed [CALCITE-5679] HepPlanner#buildFinalPlan: do not clear metadata cache if RelNode has not changed Apr 28, 2023
@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@JiajunBernoulli
Copy link
Copy Markdown
Contributor

Because CALCITE-3791.
When a change occurs, the cache of the parent node will be cleared by another block of code.

The commit only affects current node, so I approve the PR.

@JiajunBernoulli JiajunBernoulli self-assigned this Apr 29, 2023
@libenchao
Copy link
Copy Markdown
Member

+1, there is no meaning to recalculate metadata for unchanged nodes.

@rubenada rubenada merged commit a833bd6 into apache:main Apr 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants