[CALCITE-3257] RelMetadataQuery cache is not invalidated when log trace is enabled#1385
Closed
xndai wants to merge 3 commits intoapache:masterfrom
Closed
[CALCITE-3257] RelMetadataQuery cache is not invalidated when log trace is enabled#1385xndai wants to merge 3 commits intoapache:masterfrom
xndai wants to merge 3 commits intoapache:masterfrom
Conversation
…Nodes and Graphviz Based on current design, RelMetadataQuery.map needs to be cleared between each rule firing. This is achieved through RelOptCluster.invalidateMetadataQuery() by VolcanoRuleCall.transformTo(). But when trace is enabled, the dump process would actually rebuild the meta data cache from previous rel tree. Then the subsequent rule firing doesn't get a chance to update rel node cost as it's been in the cache. A simple fix will just add a call to RelOptCluster.invalidateMetadataQuery() after dumping rel nodes.
Contributor
|
Please change the description "Need to..." is not accurate. This is a workaround for another issue. Please add the necessary context. |
…ce is enabled Based on current design, RelMetadataQuery.map needs to be cleared between each rule firing. This is achieved through RelOptCluster.invalidateMetadataQuery() by VolcanoRuleCall.transformTo(). But when trace is enabled, the dump process would actually rebuild the meta data cache from previous rel tree. Then the subsequent rule firing doesn't get a chance to update rel node cost as it's been in the cache. A simple fix will just add a call to RelOptCluster.invalidateMetadataQuery() after dumping rel nodes.
Contributor
Author
|
hi @julianhyde , this PR is to ensure we purge meta data cache when trace is enabled, same as when trace is disabled. CALCITE-2018 is to fix issue during propogateCostImprovement(). @vvysotskyi also agrees they are two different issues. More details please refer to the Jira. Thanks. |
wangxlong
pushed a commit
to wangxlong/calcite
that referenced
this pull request
Feb 13, 2020
…ce is enabled (Xiening Dai) Based on current design, RelMetadataQuery.map needs to be cleared between each rule firing. This is achieved through RelOptCluster.invalidateMetadataQuery() by VolcanoRuleCall.transformTo(). But when trace is enabled, the dump process would actually rebuild the meta data cache from previous rel tree. Then the subsequent rule firing doesn't get a chance to update rel node cost as it's been in the cache. A simple fix will just add a call to RelOptCluster.invalidateMetadataQuery() after dumping rel nodes. Close apache#1385
hbtoo
pushed a commit
to hbtoo/calcite
that referenced
this pull request
Oct 2, 2020
…ce is enabled (Xiening Dai) Based on current design, RelMetadataQuery.map needs to be cleared between each rule firing. This is achieved through RelOptCluster.invalidateMetadataQuery() by VolcanoRuleCall.transformTo(). But when trace is enabled, the dump process would actually rebuild the meta data cache from previous rel tree. Then the subsequent rule firing doesn't get a chance to update rel node cost as it's been in the cache. A simple fix will just add a call to RelOptCluster.invalidateMetadataQuery() after dumping rel nodes. Close apache#1385 Change-Id: Ibc09f391632c1e6fdfd5ce40f1a1762584033357
jamesstarr
pushed a commit
to jamesstarr/calcite
that referenced
this pull request
Aug 28, 2025
…ce is enabled (Xiening Dai) Based on current design, RelMetadataQuery.map needs to be cleared between each rule firing. This is achieved through RelOptCluster.invalidateMetadataQuery() by VolcanoRuleCall.transformTo(). But when trace is enabled, the dump process would actually rebuild the meta data cache from previous rel tree. Then the subsequent rule firing doesn't get a chance to update rel node cost as it's been in the cache. A simple fix will just add a call to RelOptCluster.invalidateMetadataQuery() after dumping rel nodes. Close apache#1385 Change-Id: I2dd3965e54d2927732ef7ecd8ab2264a98a5626f
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.
Based on current design, RelMetadataQuery.map needs to be cleared between each rule firing. This is achieved through RelOptCluster.invalidateMetadataQuery() by VolcanoRuleCall.transformTo(). But when trace is enabled, the dump process would actually rebuild the meta data cache from previous rel tree. Then the subsequent rule firing doesn't get a chance to update rel node cost as it's been in the cache.
A simple fix will just add a call to RelOptCluster.invalidateMetadataQuery() after dumping rel nodes.
https://issues.apache.org/jira/browse/CALCITE-3257